PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockBeehive.patch
CraftBukkit/Spigot 7b627056c1 #1164, MC-227255, MC-253819: Fix rotation of beehives and bells
By: Jishuna <joshl5324@gmail.com>
2023-04-04 07:01:54 +10:00

28 lines
1.2 KiB
Diff

--- a/net/minecraft/world/level/block/BlockBeehive.java
+++ b/net/minecraft/world/level/block/BlockBeehive.java
@@ -105,7 +105,7 @@
EntityBee entitybee = (EntityBee) iterator.next();
if (entitybee.getTarget() == null) {
- entitybee.setTarget((EntityLiving) list1.get(world.random.nextInt(i)));
+ entitybee.setTarget((EntityLiving) list1.get(world.random.nextInt(i)), org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit
}
}
}
@@ -331,4 +331,16 @@
return super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
}
+
+ // CraftBukkit start - fix MC-227255
+ @Override
+ public IBlockData rotate(IBlockData iblockdata, EnumBlockRotation enumblockrotation) {
+ return iblockdata.setValue(BlockBeehive.FACING, enumblockrotation.rotate(iblockdata.getValue(BlockBeehive.FACING)));
+ }
+
+ @Override
+ public IBlockData mirror(IBlockData iblockdata, EnumBlockMirror enumblockmirror) {
+ return iblockdata.rotate(enumblockmirror.getRotation(iblockdata.getValue(BlockBeehive.FACING)));
+ }
+ // CraftBukkit end
}