2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/entity/monster/EntityShulker.java
|
|
|
|
+++ b/net/minecraft/world/entity/monster/EntityShulker.java
|
2024-04-24 01:15:00 +10:00
|
|
|
@@ -58,6 +58,12 @@
|
2021-03-16 09:00:00 +11:00
|
|
|
import net.minecraft.world.phys.Vec3D;
|
2022-12-08 03:00:00 +11:00
|
|
|
import org.joml.Vector3f;
|
2021-03-09 08:47:33 +11:00
|
|
|
|
2017-02-20 09:55:24 +11:00
|
|
|
+// CraftBukkit start
|
2023-04-19 19:59:19 +10:00
|
|
|
+import org.bukkit.craftbukkit.util.CraftLocation;
|
2017-02-20 09:55:24 +11:00
|
|
|
+import org.bukkit.event.entity.EntityTeleportEvent;
|
2023-06-24 17:15:05 +10:00
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
2017-02-20 09:55:24 +11:00
|
|
|
+// CraftBukkit end
|
2021-03-09 08:47:33 +11:00
|
|
|
+
|
2022-12-08 03:00:00 +11:00
|
|
|
public class EntityShulker extends EntityGolem implements VariantHolder<Optional<EnumColor>>, IMonster {
|
2017-02-20 09:55:24 +11:00
|
|
|
|
2024-06-14 01:05:00 +10:00
|
|
|
private static final MinecraftKey COVERED_ARMOR_MODIFIER_ID = MinecraftKey.withDefaultNamespace("covered");
|
2024-04-24 01:15:00 +10:00
|
|
|
@@ -401,6 +407,14 @@
|
2021-11-22 09:00:00 +11:00
|
|
|
EnumDirection enumdirection = this.findAttachableSurface(blockposition1);
|
2017-02-20 09:55:24 +11:00
|
|
|
|
2020-06-25 10:00:00 +10:00
|
|
|
if (enumdirection != null) {
|
|
|
|
+ // CraftBukkit start
|
2023-06-24 17:15:05 +10:00
|
|
|
+ EntityTeleportEvent teleportEvent = CraftEventFactory.callEntityTeleportEvent(this, blockposition1.getX(), blockposition1.getY(), blockposition1.getZ());
|
|
|
|
+ if (teleportEvent.isCancelled()) {
|
2020-06-25 10:00:00 +10:00
|
|
|
+ return false;
|
2023-06-24 17:15:05 +10:00
|
|
|
+ } else {
|
|
|
|
+ blockposition1 = CraftLocation.toBlockPosition(teleportEvent.getTo());
|
2020-06-25 10:00:00 +10:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-22 09:00:00 +11:00
|
|
|
this.unRide();
|
2021-06-11 15:00:00 +10:00
|
|
|
this.setAttachFace(enumdirection);
|
|
|
|
this.playSound(SoundEffects.SHULKER_TELEPORT, 1.0F, 1.0F);
|
2024-04-24 01:15:00 +10:00
|
|
|
@@ -471,7 +485,7 @@
|
2022-12-08 03:00:00 +11:00
|
|
|
if (entityshulker != null) {
|
|
|
|
entityshulker.setVariant(this.getVariant());
|
|
|
|
entityshulker.moveTo(vec3d);
|
2023-06-08 01:30:00 +10:00
|
|
|
- this.level().addFreshEntity(entityshulker);
|
|
|
|
+ this.level().addFreshEntity(entityshulker, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - the mysteries of life
|
2019-12-11 09:00:00 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|