Files
CatServer/patches/net/minecraft/tileentity/MobSpawnerBaseLogic.java.patch
2018-09-11 21:05:09 +08:00

33 lines
1.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java
+++ ../src-work/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java
@@ -20,7 +20,7 @@
public abstract class MobSpawnerBaseLogic
{
- private int spawnDelay = 20;
+ public int spawnDelay = 20;
private final List<WeightedSpawnerEntity> minecartToSpawn = Lists.<WeightedSpawnerEntity>newArrayList();
private WeightedSpawnerEntity randomEntity = new WeightedSpawnerEntity();
private double mobRotation;
@@ -33,7 +33,7 @@
private int activatingRangeFromPlayer = 16;
private int spawnRange = 4;
- private String getEntityNameToSpawn()
+ public String getEntityNameToSpawn()
{
return this.randomEntity.getNbt().getString("id");
}
@@ -124,7 +124,10 @@
if (!net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn(entityliving, this.getSpawnerWorld(), (float)entity.posX, (float)entity.posY, (float)entity.posZ))
((EntityLiving)entity).onInitialSpawn(world.getDifficultyForLocation(new BlockPos(entity)), (IEntityLivingData)null);
}
-
+ if (entity.worldObj.spigotConfig.nerfSpawnerMobs) entity.fromMobSpawner = true; // Spigot Start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockpos).isCancelled()) {
+ continue;
+ }
AnvilChunkLoader.spawnEntity(entity, world);
world.playEvent(2004, blockpos, 0);