From bb547a574801f48dd1dbb12ac9a2b7f520002109 Mon Sep 17 00:00:00 2001 From: sciwhiz12 Date: Fri, 25 Feb 2022 08:51:00 +0800 Subject: [PATCH] Re-add missing Shulker patch for EntityTeleportEvent (#8481) --- .../world/entity/monster/Shulker.java.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch diff --git a/patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch b/patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch new file mode 100644 index 0000000000..8acc37706f --- /dev/null +++ b/patches/minecraft/net/minecraft/world/entity/monster/Shulker.java.patch @@ -0,0 +1,15 @@ +--- a/net/minecraft/world/entity/monster/Shulker.java ++++ b/net/minecraft/world/entity/monster/Shulker.java +@@ -356,6 +_,12 @@ + if (blockpos1.m_123342_() > this.f_19853_.m_141937_() && this.f_19853_.m_46859_(blockpos1) && this.f_19853_.m_6857_().m_61937_(blockpos1) && this.f_19853_.m_45756_(this, (new AABB(blockpos1)).m_82406_(1.0E-6D))) { + Direction direction = this.m_149810_(blockpos1); + if (direction != null) { ++ net.minecraftforge.event.entity.EntityTeleportEvent.EnderEntity event = net.minecraftforge.event.ForgeEventFactory.onEnderTeleport(this, blockpos1.m_123341_(), blockpos1.m_123342_(), blockpos1.m_123343_()); ++ if (event.isCanceled()) direction = null; ++ blockpos1 = new BlockPos(event.getTargetX(), event.getTargetY(), event.getTargetZ()); ++ } ++ ++ if (direction != null) { + this.m_19877_(); + this.m_149788_(direction); + this.m_5496_(SoundEvents.f_12418_, 1.0F, 1.0F);