From 387571da58d80594d86119413c7a249c3a870830 Mon Sep 17 00:00:00 2001 From: Nassim Date: Fri, 26 Jun 2020 21:34:52 +0200 Subject: [PATCH] Some fixes (#3630) * Fix block action sending * Fix chest property check --- SHIT_TO_CHECK.md | 2 +- Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch | 4 ++-- ...Optimize-sending-packets-to-nearby-locations-sounds-.patch | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SHIT_TO_CHECK.md b/SHIT_TO_CHECK.md index 9c54b6de4c..d6eeb9a774 100644 --- a/SHIT_TO_CHECK.md +++ b/SHIT_TO_CHECK.md @@ -5,4 +5,4 @@ * Make sure the flat bedrock setting doesn't do anything stupid * Check DataBits foreach * lighting is bork (load chunk, fly away, come back, everything or parts are black) -* block actions (particles/sounds) are bork (no chest opening, no bell, no noteblock) +* chunk generation seems slow with a lot of it happening \ No newline at end of file diff --git a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch index 131e4e0ffb..0b53216477 100644 --- a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch +++ b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch @@ -42,7 +42,7 @@ index 1441d096d44ea653539ba20ccda94eb62ffc32df..b9d0d2d42850c3a5d093429cd0d02ac4 protected static final VoxelShape f = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 16.0D); protected static final VoxelShape g = Block.a(0.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D); diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..832fe1d41d69f44e4de1a6f4d037d3e104cac7af 100644 +index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..a016d97be93c4218136f803cc9a7f986d70309d2 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; @@ -107,7 +107,7 @@ index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..832fe1d41d69f44e4de1a6f4d037d3e1 } private void a(SoundEffect soundeffect) { -+ if (!this.getBlock().get(BlockChest.waterlogged())) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074 ++ if (!this.getBlock().b(BlockChest.c)) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074 BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.c); if (blockpropertychesttype != BlockPropertyChestType.LEFT) { diff --git a/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch b/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch index 2050876f0c..496951e4ac 100644 --- a/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch +++ b/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch @@ -11,7 +11,7 @@ This will drastically cut down on packet sending cost for worlds with lots of players in them. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 84707b373bcd9c4eb302b149f242435edfc91f2e..9f4d9ee0100bca5f62f6a3778257e4da97ca2d28 100644 +index 84707b373bcd9c4eb302b149f242435edfc91f2e..bbc5e21c0dd6e790493fc2d4d3b0df4c114712e5 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1062,16 +1062,40 @@ public abstract class PlayerList { @@ -57,7 +57,7 @@ index 84707b373bcd9c4eb302b149f242435edfc91f2e..9f4d9ee0100bca5f62f6a3778257e4da // CraftBukkit end - if (entityplayer != entityhuman && entityplayer.world.getDimensionKey() == resourcekey) { -+ if (entityplayer != entityhuman && entityplayer.world.getDimensionKey() == resourcekey && entityhuman instanceof EntityPlayer && !entityplayer.getBukkitEntity().canSee(((EntityPlayer) entityhuman).getBukkitEntity())) { // Paper ++ if (entityplayer != entityhuman && entityplayer.world.getDimensionKey() == resourcekey && (!(entityhuman instanceof EntityPlayer) || entityplayer.getBukkitEntity().canSee(((EntityPlayer) entityhuman).getBukkitEntity()))) { // Paper double d4 = d0 - entityplayer.locX(); double d5 = d1 - entityplayer.locY(); double d6 = d2 - entityplayer.locZ();