aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Shulker.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Shulker.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Shulker.java.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Shulker.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Shulker.java.patch
new file mode 100644
index 0000000000..2e8b3aa748
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/monster/Shulker.java.patch
@@ -0,0 +1,47 @@
+--- a/net/minecraft/world/entity/monster/Shulker.java
++++ b/net/minecraft/world/entity/monster/Shulker.java
+@@ -59,7 +59,11 @@
+ import net.minecraft.world.phys.Vec3;
+ import org.joml.Vector3f;
+
+-public class Shulker extends AbstractGolem implements VariantHolder<Optional<DyeColor>>, Enemy {
++// CraftBukkit start
++import org.bukkit.craftbukkit.util.CraftLocation;
++import org.bukkit.event.entity.EntityTeleportEvent;
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
+
+ private static final UUID COVERED_ARMOR_MODIFIER_UUID = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F");
+ private static final AttributeModifier COVERED_ARMOR_MODIFIER = new AttributeModifier(Shulker.COVERED_ARMOR_MODIFIER_UUID, "Covered armor bonus", 20.0D, AttributeModifier.Operation.ADDITION);
+@@ -419,7 +405,15 @@
+ if (blockpos1.getY() > this.level().getMinBuildHeight() && this.level().isEmptyBlock(blockpos1) && this.level().getWorldBorder().isWithinBounds(blockpos1) && this.level().noCollision(this, (new AABB(blockpos1)).deflate(1.0E-6D))) {
+ Direction direction = this.findAttachableSurface(blockpos1);
+
+- if (direction != null) {
++ 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(direction);
+ this.playSound(SoundEvents.SHULKER_TELEPORT, 1.0F, 1.0F);
+@@ -489,10 +481,10 @@
+ if (this.level().random.nextFloat() >= f) {
+ Shulker shulker = (Shulker) EntityType.SHULKER.create(this.level());
+
+- if (shulker != null) {
+- shulker.setVariant(this.getVariant());
+- shulker.moveTo(vec3);
+- this.level().addFreshEntity(shulker);
++ if (entityshulker != null) {
++ entityshulker.setVariant(this.getVariant());
++ entityshulker.moveTo(vec3d);
++ this.level().addFreshEntity(entityshulker, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - the mysteries of life
+ }
+
+ }