2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/monster/EntityShulker.java
|
|
|
|
+++ b/net/minecraft/world/entity/monster/EntityShulker.java
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -60,6 +60,12 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.Vec3D;
|
2022-12-07 17:00:00 +01:00
|
|
|
import org.joml.Vector3f;
|
2021-03-08 22:47:33 +01:00
|
|
|
|
2017-02-19 23:55:24 +01:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.Location;
|
2023-04-19 11:59:19 +02:00
|
|
|
+import org.bukkit.craftbukkit.util.CraftLocation;
|
2017-02-19 23:55:24 +01:00
|
|
|
+import org.bukkit.event.entity.EntityTeleportEvent;
|
|
|
|
+// CraftBukkit end
|
2021-03-08 22:47:33 +01:00
|
|
|
+
|
2022-12-07 17:00:00 +01:00
|
|
|
public class EntityShulker extends EntityGolem implements VariantHolder<Optional<EnumColor>>, IMonster {
|
2017-02-19 23:55:24 +01:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
private static final UUID COVERED_ARMOR_MODIFIER_UUID = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F");
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -408,6 +414,16 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
EnumDirection enumdirection = this.findAttachableSurface(blockposition1);
|
2017-02-19 23:55:24 +01:00
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
if (enumdirection != null) {
|
|
|
|
+ // CraftBukkit start
|
2023-04-19 11:59:19 +02:00
|
|
|
+ EntityTeleportEvent teleport = new EntityTeleportEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), CraftLocation.toBukkit(blockposition1, this.level.getWorld()));
|
2021-06-11 13:33:49 +02:00
|
|
|
+ this.level.getCraftServer().getPluginManager().callEvent(teleport);
|
2020-06-25 02:00:00 +02:00
|
|
|
+ if (!teleport.isCancelled()) {
|
|
|
|
+ Location to = teleport.getTo();
|
2023-03-14 17:30:00 +01:00
|
|
|
+ blockposition1 = BlockPosition.containing(to.getX(), to.getY(), to.getZ());
|
2020-06-25 02:00:00 +02:00
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
this.unRide();
|
2021-06-11 07:00:00 +02:00
|
|
|
this.setAttachFace(enumdirection);
|
|
|
|
this.playSound(SoundEffects.SHULKER_TELEPORT, 1.0F, 1.0F);
|
2023-03-14 17:30:00 +01:00
|
|
|
@@ -478,7 +494,7 @@
|
2022-12-07 17:00:00 +01:00
|
|
|
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
|
2019-12-10 23:00:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|