aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/entity/monster/EntityShulker.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/entity/monster/EntityShulker.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/entity/monster/EntityShulker.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/entity/monster/EntityShulker.patch b/patch-remap/og/net/minecraft/world/entity/monster/EntityShulker.patch
new file mode 100644
index 0000000000..1a9d64e269
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/entity/monster/EntityShulker.patch
@@ -0,0 +1,39 @@
+--- a/net/minecraft/world/entity/monster/EntityShulker.java
++++ b/net/minecraft/world/entity/monster/EntityShulker.java
+@@ -59,6 +59,12 @@
+ import net.minecraft.world.phys.Vec3D;
+ import org.joml.Vector3f;
+
++// CraftBukkit start
++import org.bukkit.craftbukkit.util.CraftLocation;
++import org.bukkit.event.entity.EntityTeleportEvent;
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
++
+ public class EntityShulker extends EntityGolem implements VariantHolder<Optional<EnumColor>>, IMonster {
+
+ private static final UUID COVERED_ARMOR_MODIFIER_UUID = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F");
+@@ -400,6 +406,14 @@
+ EnumDirection enumdirection = this.findAttachableSurface(blockposition1);
+
+ if (enumdirection != null) {
++ // CraftBukkit start
++ EntityTeleportEvent teleportEvent = CraftEventFactory.callEntityTeleportEvent(this, blockposition1.getX(), blockposition1.getY(), blockposition1.getZ());
++ if (teleportEvent.isCancelled()) {
++ return false;
++ } else {
++ blockposition1 = CraftLocation.toBlockPosition(teleportEvent.getTo());
++ }
++ // CraftBukkit end
+ this.unRide();
+ this.setAttachFace(enumdirection);
+ this.playSound(SoundEffects.SHULKER_TELEPORT, 1.0F, 1.0F);
+@@ -470,7 +484,7 @@
+ if (entityshulker != null) {
+ entityshulker.setVariant(this.getVariant());
+ entityshulker.moveTo(vec3d);
+- this.level().addFreshEntity(entityshulker);
++ this.level().addFreshEntity(entityshulker, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - the mysteries of life
+ }
+
+ }