ForgePatch/patches/minecraft/net/minecraft/entity/monster/EndermanEntity.java.patch

41 lines
2.8 KiB
Diff
Raw Normal View History

2019-05-23 23:02:15 +00:00
--- a/net/minecraft/entity/monster/EndermanEntity.java
+++ b/net/minecraft/entity/monster/EndermanEntity.java
@@ -225,7 +225,9 @@
if (!this.field_70170_p.func_180495_p(blockpos$mutableblockpos).func_185904_a().func_76230_c()) {
return false;
} else {
- boolean flag = this.func_213373_a(p_70825_1_, p_70825_3_, p_70825_5_, true);
+ net.minecraftforge.event.entity.living.EnderTeleportEvent event = new net.minecraftforge.event.entity.living.EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0);
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return false;
+ boolean flag = this.func_213373_a(event.getTargetX(), event.getTargetY(), event.getTargetZ(), true);
if (flag) {
this.field_70170_p.func_184148_a((PlayerEntity)null, this.field_70169_q, this.field_70167_r, this.field_70166_s, SoundEvents.field_187534_aX, this.func_184176_by(), 1.0F, 1.0F);
this.func_184185_a(SoundEvents.field_187534_aX, 1.0F, 1.0F);
@@ -370,7 +372,7 @@
public boolean func_75250_a() {
if (this.field_179475_a.func_195405_dq() == null) {
return false;
- } else if (!this.field_179475_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179475_a.field_70170_p, this.field_179475_a)) {
return false;
} else {
return this.field_179475_a.func_70681_au().nextInt(2000) == 0;
@@ -388,7 +390,7 @@
BlockPos blockpos1 = blockpos.func_177977_b();
BlockState blockstate1 = iworld.func_180495_p(blockpos1);
BlockState blockstate2 = this.field_179475_a.func_195405_dq();
- if (blockstate2 != null && this.func_220836_a(iworld, blockpos, blockstate2, blockstate, blockstate1, blockpos1)) {
+ if (blockstate2 != null && this.func_220836_a(iworld, blockpos, blockstate2, blockstate, blockstate1, blockpos1) && !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(field_179475_a, new net.minecraftforge.common.util.BlockSnapshot(iworld, blockpos, blockstate1), net.minecraft.util.Direction.UP)) {
iworld.func_180501_a(blockpos, blockstate2, 3);
this.field_179475_a.func_195406_b((BlockState)null);
}
@@ -433,7 +435,7 @@
public boolean func_75250_a() {
if (this.field_179473_a.func_195405_dq() != null) {
return false;
- } else if (!this.field_179473_a.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) {
+ } else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.field_179473_a.field_70170_p, this.field_179473_a)) {
return false;
} else {
return this.field_179473_a.func_70681_au().nextInt(20) == 0;