Files
2019-08-06 04:32:24 +08:00

20 lines
996 B
Diff

--- ../src-base/minecraft/net/minecraft/village/VillageSiege.java
+++ ../src-work/minecraft/net/minecraft/village/VillageSiege.java
@@ -146,6 +146,7 @@
if (vec3d != null)
{
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.village.VillageSiegeEvent(this, world, entityplayer, village, vec3d))) return false;
break;
}
}
@@ -181,7 +182,7 @@
}
entityzombie.setLocationAndAngles(vec3d.x, vec3d.y, vec3d.z, this.world.rand.nextFloat() * 360.0F, 0.0F);
- this.world.spawnEntity(entityzombie);
+ this.world.addEntity(entityzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_INVASION);
BlockPos blockpos = this.village.getCenter();
entityzombie.setHomePosAndDistance(blockpos, this.village.getVillageRadius());
return true;