[Change] Removed Enderman Rate-limit
This commit is contained in:
parent
b1a949d8a1
commit
043ecb5446
2 changed files with 0 additions and 40 deletions
|
@ -1,39 +0,0 @@
|
||||||
package org.betterx.betterend.mixin.common;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.util.RandomSource;
|
|
||||||
import net.minecraft.world.entity.EntityType;
|
|
||||||
import net.minecraft.world.entity.MobSpawnType;
|
|
||||||
import net.minecraft.world.entity.monster.EnderMan;
|
|
||||||
import net.minecraft.world.entity.monster.Monster;
|
|
||||||
import net.minecraft.world.level.ServerLevelAccessor;
|
|
||||||
import net.minecraft.world.phys.AABB;
|
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mixin(Monster.class)
|
|
||||||
public class MonsterMixin {
|
|
||||||
@Inject(method = "checkMonsterSpawnRules", at = @At(value = "RETURN"), cancellable = true)
|
|
||||||
private static void be_checkMonsterSpawnRules(
|
|
||||||
EntityType<? extends Monster> type,
|
|
||||||
ServerLevelAccessor serverWorldAccess,
|
|
||||||
MobSpawnType spawnReason,
|
|
||||||
BlockPos pos,
|
|
||||||
RandomSource random,
|
|
||||||
CallbackInfoReturnable<Boolean> info
|
|
||||||
) {
|
|
||||||
boolean canSpawn = info.getReturnValue();
|
|
||||||
if (canSpawn && spawnReason == MobSpawnType.NATURAL && type == EntityType.ENDERMAN) {
|
|
||||||
AABB box = new AABB(pos).inflate(16);
|
|
||||||
List<EnderMan> entities = serverWorldAccess.getEntitiesOfClass(EnderMan.class, box, (entity) -> {
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
info.setReturnValue(entities.size() < 6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -17,7 +17,6 @@
|
||||||
"EntityMixin",
|
"EntityMixin",
|
||||||
"LevelMixin",
|
"LevelMixin",
|
||||||
"LivingEntityMixin",
|
"LivingEntityMixin",
|
||||||
"MonsterMixin",
|
|
||||||
"NoiseBasedChunkGeneratorAccessor",
|
"NoiseBasedChunkGeneratorAccessor",
|
||||||
"NoiseChunkAccessor",
|
"NoiseChunkAccessor",
|
||||||
"NoiseChunkMixin",
|
"NoiseChunkMixin",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue