diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index 5bad4a25fc..dd9dc31936 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -1,4 +1,4 @@ -From c8f0455c3659ae62743792a22b8f5b7e75136548 Mon Sep 17 00:00:00 2001 +From 2a7df1df57521c5e013a7e71b748d5c73a4904cc Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 19:36:20 -0400 Subject: [PATCH] MC Dev fixes @@ -63,6 +63,31 @@ index b4c8722f04..59d86fc66e 100644 String s1 = ((INamable) t0).getName(); if (this.b.containsKey(s1)) { +diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java +index c973ab6076..30701fd7f3 100644 +--- a/src/main/java/net/minecraft/server/ChunkSection.java ++++ b/src/main/java/net/minecraft/server/ChunkSection.java +@@ -148,6 +148,6 @@ public class ChunkSection { + } + + public boolean a(IBlockData iblockdata) { +- return this.blockIds.a((Object) iblockdata); ++ return this.blockIds.a(iblockdata); // Paper - decompile fix + } + } +diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java +index 45370ad5d9..b566e77869 100644 +--- a/src/main/java/net/minecraft/server/EntityVindicator.java ++++ b/src/main/java/net/minecraft/server/EntityVindicator.java +@@ -25,7 +25,7 @@ public class EntityVindicator extends EntityIllagerAbstract { + this.goalSelector.a(2, new EntityIllagerAbstract.b(this)); + this.goalSelector.a(3, new EntityRaider.a(this, 10.0F)); + this.goalSelector.a(4, new EntityVindicator.c(this)); +- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[] { EntityRaider.class})).a()); ++ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[] { EntityRaider.class})).a(new Class[0])); // Paper - decompile fix + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); diff --git a/src/main/java/net/minecraft/server/GameRules.java b/src/main/java/net/minecraft/server/GameRules.java index d8d2267084..3de9d264db 100644 --- a/src/main/java/net/minecraft/server/GameRules.java @@ -98,6 +123,48 @@ index 8753bea614..809ca0983a 100644 do { if (d12 > 1.0D && d13 > 1.0D && d14 > 1.0D) { +diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java +index e8ae4b5e44..0f4aa698aa 100644 +--- a/src/main/java/net/minecraft/server/IBlockData.java ++++ b/src/main/java/net/minecraft/server/IBlockData.java +@@ -265,12 +265,12 @@ public class IBlockData extends BlockDataAbstract implements + + public static Dynamic a(DynamicOps dynamicops, IBlockData iblockdata) { + ImmutableMap, Comparable> immutablemap = iblockdata.getStateMap(); +- Object object; ++ T object; // Paper - decompile fix + + if (immutablemap.isEmpty()) { + object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()))); + } else { +- object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()), dynamicops.createString("Properties"), dynamicops.createMap((Map) immutablemap.entrySet().stream().map((entry) -> { ++ object = dynamicops.createMap(ImmutableMap.of(dynamicops.createString("Name"), dynamicops.createString(IRegistry.BLOCK.getKey(iblockdata.getBlock()).toString()), dynamicops.createString("Properties"), dynamicops.createMap(immutablemap.entrySet().stream().map((entry) -> { // Paper - decompile fix + return Pair.of(dynamicops.createString(((IBlockState) entry.getKey()).a()), dynamicops.createString(IBlockDataHolder.b((IBlockState) entry.getKey(), (Comparable) entry.getValue()))); + }).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond))))); + } +@@ -329,9 +329,9 @@ public class IBlockData extends BlockDataAbstract implements + if (!iblockdata.o()) { + this.f = null; + } else { +- this.f = new VoxelShape[IBlockData.a.a.length]; ++ this.f = new VoxelShape[a.length]; // Paper - decompile fix + voxelshape = block.h(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO); +- EnumDirection[] aenumdirection = IBlockData.a.a; ++ EnumDirection[] aenumdirection = a; // Paper - decompile fix + int i = aenumdirection.length; + + for (int j = 0; j < i; ++j) { +@@ -342,8 +342,9 @@ public class IBlockData extends BlockDataAbstract implements + } + + voxelshape = block.b(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO, VoxelShapeCollision.a()); ++ final VoxelShape final_voxelshape = voxelshape; // Paper - decompile fix + this.g = Arrays.stream(EnumDirection.EnumAxis.values()).anyMatch((enumdirection_enumaxis) -> { +- return voxelshape.b(enumdirection_enumaxis) < 0.0D || voxelshape.c(enumdirection_enumaxis) > 1.0D; ++ return final_voxelshape.b(enumdirection_enumaxis) < 0.0D || final_voxelshape.c(enumdirection_enumaxis) > 1.0D; // Paper - decompile fix + }); + } + } diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java index bf7e0d17ef..ee22bb0387 100644 --- a/src/main/java/net/minecraft/server/IEntityAccess.java diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index e86bbaba8d..2a773e93d9 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -1,4 +1,4 @@ -From fe856f842c339f1366c793bd3a787c9f6d1e0d69 Mon Sep 17 00:00:00 2001 +From 476438fe56b63e02b76f3c52fa84aae5c3489f2f Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:55:47 -0400 Subject: [PATCH] MC Utils @@ -285,7 +285,7 @@ index e975265a28..aa6a58dd88 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 -index 0000000000..c97e116aaf +index 0000000000..3448b5588e --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +1,316 @@ @@ -384,7 +384,7 @@ index 0000000000..c97e116aaf + * @return + */ + public static void ensureMain(String reason, Runnable run) { -+ if (AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().primaryThread) { ++ if (AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread) { + if (reason != null) { + new IllegalStateException("Asynchronous " + reason + "!").printStackTrace(); + } @@ -409,7 +409,7 @@ index 0000000000..c97e116aaf + * @return + */ + public static T ensureMain(String reason, Supplier run) { -+ if (AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().primaryThread) { ++ if (AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread) { + if (reason != null) { + new IllegalStateException("Asynchronous " + reason + "! Blocking thread until it returns ").printStackTrace(); + } @@ -555,7 +555,7 @@ index 0000000000..c97e116aaf + @Nullable + public static TileEntityHopper getHopper(World world, BlockPosition pos) { + Chunk chunk = world.getChunkIfLoaded(pos.getX() >> 4, pos.getZ() >> 4); -+ if (chunk != null && chunk.getBlockData(pos.getX(), pos.getY(), pos.getZ()).getBlock() == Blocks.HOPPER) { ++ if (chunk != null && chunk.getType(new BlockPosition(pos.getX(), pos.getY(), pos.getZ())).getBlock() == Blocks.HOPPER) { + TileEntity tileEntity = chunk.getTileEntityImmediately(pos); + if (tileEntity instanceof TileEntityHopper) { + return (TileEntityHopper) tileEntity; @@ -573,15 +573,15 @@ index 0000000000..c97e116aaf + return getNMSWorld(entity.getWorld()); + } + -+ public static FluidCollisionOption getNMSFluidCollisionOption(TargetBlockInfo.FluidMode fluidMode) { ++ public static RayTrace.FluidCollisionOption getNMSFluidCollisionOption(TargetBlockInfo.FluidMode fluidMode) { + if (fluidMode == TargetBlockInfo.FluidMode.NEVER) { -+ return FluidCollisionOption.NEVER; ++ return RayTrace.FluidCollisionOption.NONE; + } + if (fluidMode == TargetBlockInfo.FluidMode.SOURCE_ONLY) { -+ return FluidCollisionOption.SOURCE_ONLY; ++ return RayTrace.FluidCollisionOption.SOURCE_ONLY; + } + if (fluidMode == TargetBlockInfo.FluidMode.ALWAYS) { -+ return FluidCollisionOption.ALWAYS; ++ return RayTrace.FluidCollisionOption.ANY; + } + return null; + } diff --git a/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch b/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch index dbcb566b1f..b270d610c3 100644 --- a/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch +++ b/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch @@ -1,4 +1,4 @@ -From ad235c2c832bb36e4bb444861075244c89c22da4 Mon Sep 17 00:00:00 2001 +From 3eca27df8c7688c5f1d10ce9fe77d6c66b48f5f5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Mar 2016 20:16:03 -0400 Subject: [PATCH] Add World Util Methods @@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index c4103680d..9433d04f4 100644 +index c4103680d4..9433d04f43 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -388,6 +388,7 @@ public class Chunk implements IChunkAccess { @@ -18,7 +18,7 @@ index c4103680d..9433d04f4 100644 return this.a(blockposition, i, this.world.getWorldProvider().g()); } diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java -index bac6c9d65..0930552b1 100644 +index bac6c9d65b..0930552b1f 100644 --- a/src/main/java/net/minecraft/server/IWorldReader.java +++ b/src/main/java/net/minecraft/server/IWorldReader.java @@ -36,6 +36,22 @@ public interface IWorldReader extends IIBlockAccess { @@ -45,7 +45,7 @@ index bac6c9d65..0930552b1 100644 @Nullable IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 01f510588..cdc5d7009 100644 +index 01f5105884..556d7af07a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -46,7 +46,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose @@ -57,7 +57,7 @@ index 01f510588..cdc5d7009 100644 protected int j = (new Random()).nextInt(); protected final int k = 1013904223; protected float l; -@@ -208,6 +208,83 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -208,6 +208,84 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose return i < 0 || i >= 256; } @@ -71,36 +71,37 @@ index 01f510588..cdc5d7009 100644 + // test if meets light level, return faster + // logic copied from below + public boolean isLightLevel(BlockPosition blockposition, int level) { -+ if (isValidLocation(blockposition)) { -+ if (this.getType(blockposition).c(this, blockposition)) { -+ int sky = getSkylightSubtracted(); -+ if (this.getLightLevel(blockposition.up(), sky) >= level) { -+ return true; -+ } -+ if (this.getLightLevel(blockposition.east(), sky) >= level) { -+ return true; -+ } -+ if (this.getLightLevel(blockposition.west(), sky) >= level) { -+ return true; -+ } -+ if (this.getLightLevel(blockposition.south(), sky) >= level) { -+ return true; -+ } -+ if (this.getLightLevel(blockposition.north(), sky) >= level) { -+ return true; -+ } -+ return false; -+ } else { -+ if (blockposition.getY() >= 256) { -+ blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); -+ } -+ -+ Chunk chunk = this.getChunkAtWorldCoords(blockposition); -+ return chunk.getLightSubtracted(blockposition, this.getSkylightSubtracted()) >= level; -+ } -+ } else { -+ return true; -+ } ++ return this.getLightLevel(blockposition) >= level; // TODO ++// if (isValidLocation(blockposition)) { ++// if (this.getType(blockposition).c(this, blockposition)) { // use neighbour brightness (where did this go) ++// int sky = getSkylightSubtracted(); ++// if (this.getLightLevel(blockposition.up(), sky) >= level) { ++// return true; ++// } ++// if (this.getLightLevel(blockposition.east(), sky) >= level) { ++// return true; ++// } ++// if (this.getLightLevel(blockposition.west(), sky) >= level) { ++// return true; ++// } ++// if (this.getLightLevel(blockposition.south(), sky) >= level) { ++// return true; ++// } ++// if (this.getLightLevel(blockposition.north(), sky) >= level) { ++// return true; ++// } ++// return false; ++// } else { ++// if (blockposition.getY() >= 256) { ++// blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); ++// } ++// ++// Chunk chunk = this.getChunkAtWorldCoords(blockposition); ++// return chunk.getLightSubtracted(blockposition, this.getSkylightSubtracted()) >= level; ++// } ++// } else { ++// return true; ++// } + } + // reduces need to do isLoaded before getType + public IBlockData getTypeIfLoadedAndInBounds(BlockPosition blockposition) { @@ -118,7 +119,7 @@ index 01f510588..cdc5d7009 100644 + // CraftBukkit end + Chunk chunk = this.getChunkIfLoaded(blockposition); + if (chunk != null) { -+ return isValidLocation(blockposition) ? chunk.getBlockData(blockposition) : Blocks.AIR.getBlockData(); ++ return isValidLocation(blockposition) ? chunk.getType(blockposition) : Blocks.AIR.getBlockData(); + } + return null; + } @@ -141,6 +142,18 @@ index 01f510588..cdc5d7009 100644 public Chunk getChunkAtWorldCoords(BlockPosition blockposition) { return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4); } +diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java +index 94d1c2be11..77b805f3ae 100644 +--- a/src/main/java/net/minecraft/server/WorldBorder.java ++++ b/src/main/java/net/minecraft/server/WorldBorder.java +@@ -19,6 +19,7 @@ public class WorldBorder { + + public WorldBorder() {} + ++ public final boolean isInBounds(BlockPosition blockposition) { return this.a(blockposition); } // Paper - OBFHELPER + public boolean a(BlockPosition blockposition) { + return (double) (blockposition.getX() + 1) > this.c() && (double) blockposition.getX() < this.e() && (double) (blockposition.getZ() + 1) > this.d() && (double) blockposition.getZ() < this.f(); + } -- 2.21.0 diff --git a/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 0c8b09fcbf..5a6907cbf0 100644 --- a/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -1,4 +1,4 @@ -From 106afc897f40321e0f4cad5985e0d38dc225d40e Mon Sep 17 00:00:00 2001 +From 8340921d81719bbc4211856ad6cd864a09883c89 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 19:55:45 -0400 Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener @@ -6,7 +6,7 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener Saves on some object allocation and processing when no plugin listens to this diff --git a/src/main/java/net/minecraft/server/BlockPlant.java b/src/main/java/net/minecraft/server/BlockPlant.java -index 9bf42bb5e..0526af776 100644 +index 9bf42bb5ef..0526af776d 100644 --- a/src/main/java/net/minecraft/server/BlockPlant.java +++ b/src/main/java/net/minecraft/server/BlockPlant.java @@ -16,7 +16,7 @@ public class BlockPlant extends Block { @@ -19,7 +19,7 @@ index 9bf42bb5e..0526af776 100644 } } diff --git a/src/main/java/net/minecraft/server/BlockTallPlant.java b/src/main/java/net/minecraft/server/BlockTallPlant.java -index 469a3be05..f2c429f22 100644 +index 469a3be057..f2c429f22e 100644 --- a/src/main/java/net/minecraft/server/BlockTallPlant.java +++ b/src/main/java/net/minecraft/server/BlockTallPlant.java @@ -55,7 +55,7 @@ public class BlockTallPlant extends BlockPlant { @@ -32,7 +32,7 @@ index 469a3be05..f2c429f22 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4e97e74a2..c5359ae24 100644 +index 4e97e74a20..c5359ae248 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1087,6 +1087,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 78d1a5c71..7d6893cee 100644 +index 3d47fc899e..d8723c82d8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -435,7 +435,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -436,7 +436,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose // CraftBukkit start iblockdata1.b(this, blockposition, j); // Don't call an event for the old block to limit event spam CraftWorld world = ((WorldServer) this).getWorld(); @@ -56,7 +56,7 @@ index 78d1a5c71..7d6893cee 100644 BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); this.getServer().getPluginManager().callEvent(event); -@@ -546,7 +546,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -547,7 +547,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose try { // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); @@ -66,7 +66,7 @@ index 78d1a5c71..7d6893cee 100644 this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 9a4a55846..3bd624569 100644 +index 399a766b3b..7923808ff1 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -76,6 +76,7 @@ public class WorldServer extends World { diff --git a/Spigot-Server-Patches/0081-Do-not-load-chunks-for-light-checks.patch b/Spigot-Server-Patches/0081-Do-not-load-chunks-for-light-checks.patch index 328cd13fe3..c564aafac0 100644 --- a/Spigot-Server-Patches/0081-Do-not-load-chunks-for-light-checks.patch +++ b/Spigot-Server-Patches/0081-Do-not-load-chunks-for-light-checks.patch @@ -1,4 +1,4 @@ -From c4b8da3fa91a24ce82ad15739e925dba59472423 Mon Sep 17 00:00:00 2001 +From 0f751be9903f731ee1db45468076fd0a656c7e70 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 31 Mar 2016 19:17:58 -0400 Subject: [PATCH] Do not load chunks for light checks @@ -7,10 +7,10 @@ Should only happen for blocks on the edge that uses neighbors light level (certain blocks). In that case, there will be 3-4 other neighbors to get a light level from. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7d6893cee..31e477430 100644 +index d8723c82d8..8bd86a5403 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -586,6 +586,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -587,6 +587,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose if (blockposition.getY() >= 256) { blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); } diff --git a/Spigot-Server-Patches/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index 746686c028..c0712baef9 100644 --- a/Spigot-Server-Patches/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/Spigot-Server-Patches/0085-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -1,14 +1,14 @@ -From efe578dd1466202efe8ea41534297bd2dafbe01b Mon Sep 17 00:00:00 2001 +From 6aa1cd8efd3368b9ea4aae8ad13d02caa51c682b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 3 Apr 2016 17:48:50 -0400 Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 31e477430..845cabd29 100644 +index 8bd86a5403..284c29e307 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -504,6 +504,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -505,6 +505,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose public void m(BlockPosition blockposition) {} public void applyPhysics(BlockPosition blockposition, Block block) { diff --git a/Spigot-Server-Patches/0089-Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/0089-Remove-unused-World-Tile-Entity-List.patch index e4a0bd95d8..7479d05570 100644 --- a/Spigot-Server-Patches/0089-Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/0089-Remove-unused-World-Tile-Entity-List.patch @@ -1,4 +1,4 @@ -From dd02890bad92638cecc28b7a2a4c2328901f73f8 Mon Sep 17 00:00:00 2001 +From fcfdd9e7596364da78bf1d8a943eb2d5a39f2586 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 13 Apr 2016 00:25:28 -0400 Subject: [PATCH] Remove unused World Tile Entity List @@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 845cabd29..5637c3872 100644 +index 284c29e307..539dfa26a2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -40,7 +40,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose @@ -18,7 +18,7 @@ index 845cabd29..5637c3872 100644 public final List tileEntityListTick = Lists.newArrayList(); protected final List tileEntityListPending = Lists.newArrayList(); protected final java.util.Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper -@@ -686,9 +686,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -687,9 +687,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose }, tileentity::getPosition}); } @@ -30,7 +30,7 @@ index 845cabd29..5637c3872 100644 this.tileEntityListTick.add(tileentity); } -@@ -724,7 +724,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -725,7 +725,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { this.tileEntityListTick.removeAll(this.tileEntityListUnload); @@ -39,7 +39,7 @@ index 845cabd29..5637c3872 100644 this.tileEntityListUnload.clear(); } -@@ -780,7 +780,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -781,7 +781,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); // Spigot end @@ -48,7 +48,7 @@ index 845cabd29..5637c3872 100644 if (this.isLoaded(tileentity.getPosition())) { this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition()); } -@@ -810,7 +810,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -811,7 +811,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); // CraftBukkit start // From above, don't screw this up - SPIGOT-1746 @@ -57,7 +57,7 @@ index 845cabd29..5637c3872 100644 this.a(tileentity1); } // CraftBukkit end -@@ -1081,7 +1081,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -1082,7 +1082,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose } else { if (tileentity != null) { this.tileEntityListPending.remove(tileentity); diff --git a/Spigot-Server-Patches/0132-Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/0132-Prevent-Pathfinding-out-of-World-Border.patch index 906a070cff..9743620531 100644 --- a/Spigot-Server-Patches/0132-Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/0132-Prevent-Pathfinding-out-of-World-Border.patch @@ -1,4 +1,4 @@ -From d11a8e763b8d40afcfb60ecbda4c3c53a111b005 Mon Sep 17 00:00:00 2001 +From 35aa24c0126b90f8be8c2ca53096fef70a85f5d0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 19 Dec 2016 23:07:42 -0500 Subject: [PATCH] Prevent Pathfinding out of World Border @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent Pathfinding out of World Border This prevents Entities from trying to run outside of the World Border diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 2a391be28..0586597e7 100644 +index 2a391be28a..0586597e73 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -100,6 +100,7 @@ public abstract class NavigationAbstract { @@ -17,19 +17,6 @@ index 2a391be28..0586597e7 100644 if (!this.a()) { return null; } else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { -diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 94d1c2be1..51739e254 100644 ---- a/src/main/java/net/minecraft/server/WorldBorder.java -+++ b/src/main/java/net/minecraft/server/WorldBorder.java -@@ -19,7 +19,7 @@ public class WorldBorder { - - public WorldBorder() {} - -- public boolean a(BlockPosition blockposition) { -+ public final boolean isInBounds(BlockPosition blockposition) { return this.a(blockposition); } public boolean a(BlockPosition blockposition) { // Paper - OBFHELPER - return (double) (blockposition.getX() + 1) > this.c() && (double) blockposition.getX() < this.e() && (double) (blockposition.getZ() + 1) > this.d() && (double) blockposition.getZ() < this.f(); - } - -- 2.21.0 diff --git a/Spigot-Server-Patches/0133-Bound-Treasure-Maps-to-World-Border.patch b/Spigot-Server-Patches/0133-Bound-Treasure-Maps-to-World-Border.patch index ca243cf338..6a525942b2 100644 --- a/Spigot-Server-Patches/0133-Bound-Treasure-Maps-to-World-Border.patch +++ b/Spigot-Server-Patches/0133-Bound-Treasure-Maps-to-World-Border.patch @@ -1,4 +1,4 @@ -From 405c98bc83a1719e73b831630e22620e39d0d307 Mon Sep 17 00:00:00 2001 +From 414758f1b9530fe3176a012dc24d4ba2c1a59369 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:15:11 -0500 Subject: [PATCH] Bound Treasure Maps to World Border @@ -11,7 +11,7 @@ that is outside happens to be closer, but unreachable, yet another reachable one is in border that would of been missed. diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 464e1e101..7b2eace75 100644 +index 464e1e101a..7b2eace75c 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java @@ -103,6 +103,7 @@ public abstract class StructureGenerator @@ -23,10 +23,10 @@ index 464e1e101..7b2eace75 100644 if (structurestart != null && structurestart.e()) { diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 51739e254..2b5c09c62 100644 +index 77b805f3ae..1e622a0434 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java -@@ -23,6 +23,18 @@ public class WorldBorder { +@@ -24,6 +24,18 @@ public class WorldBorder { return (double) (blockposition.getX() + 1) > this.c() && (double) blockposition.getX() < this.e() && (double) (blockposition.getZ() + 1) > this.d() && (double) blockposition.getZ() < this.f(); } diff --git a/Spigot-Server-Patches/0154-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0154-Use-TerminalConsoleAppender-for-console-improvements.patch index 4643f26d92..09091e69dd 100644 --- a/Spigot-Server-Patches/0154-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/0154-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -1,4 +1,4 @@ -From ee5622690e3f68cb3c8e31a3b30763994b3f4371 Mon Sep 17 00:00:00 2001 +From 41f633a47824331f98f400103bb76b0b9a19a49a Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 9 Jun 2017 19:03:43 +0200 Subject: [PATCH] Use TerminalConsoleAppender for console improvements @@ -19,7 +19,7 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index 099d7218c..108c8c05e 100644 +index 099d7218c9..108c8c05e7 100644 --- a/pom.xml +++ b/pom.xml @@ -41,10 +41,27 @@ @@ -75,7 +75,7 @@ index 099d7218c..108c8c05e 100644 org.apache.maven.plugins diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 -index 000000000..688b4715e +index 0000000000..cd6e259239 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -0,0 +1,40 @@ @@ -115,13 +115,13 @@ index 000000000..688b4715e + + @Override + protected void shutdown() { -+ this.server.safeShutdown(); ++ this.server.safeShutdown(false); + } + +} diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java new file mode 100644 -index 000000000..685deaa0e +index 0000000000..685deaa0e5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java @@ -0,0 +1,17 @@ @@ -143,7 +143,7 @@ index 000000000..685deaa0e + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 19e2df309..3d0cb874d 100644 +index 19e2df3098..3d0cb874d7 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -83,6 +83,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -185,7 +185,7 @@ index 19e2df309..3d0cb874d 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2d5e340ee..dc6d7b3a2 100644 +index 2d5e340eea..dc6d7b3a27 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -50,7 +50,7 @@ import org.apache.commons.lang3.Validate; @@ -244,7 +244,7 @@ index 2d5e340ee..dc6d7b3a2 100644 public KeyPair getKeyPair() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 46a3f0751..52b2f4874 100644 +index 46a3f07512..52b2f48749 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -76,8 +76,7 @@ public abstract class PlayerList { @@ -258,7 +258,7 @@ index 46a3f0751..52b2f4874 100644 this.k = new GameProfileBanList(PlayerList.a); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b2aee24e5..2bdbc939e 100644 +index b2aee24e51..2bdbc939e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -41,7 +41,6 @@ import java.util.function.Consumer; @@ -284,7 +284,7 @@ index b2aee24e5..2bdbc939e 100644 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 5203e781e..e3d163ac4 100644 +index 5203e781e3..e3d163ac4d 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -13,7 +13,7 @@ import java.util.logging.Logger; @@ -326,7 +326,7 @@ index 5203e781e..e3d163ac4 100644 if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java deleted file mode 100644 -index fdf2f075e..000000000 +index fdf2f075e2..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java +++ /dev/null @@ -1,72 +0,0 @@ @@ -403,7 +403,7 @@ index fdf2f075e..000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index 48d4dc7e2..24f4a16a6 100644 +index 48d4dc7e2c..24f4a16a69 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java @@ -4,19 +4,30 @@ import java.util.Collections; @@ -485,7 +485,7 @@ index 48d4dc7e2..24f4a16a6 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -index 70f8d4299..449e99d1b 100644 +index 70f8d42992..449e99d1b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java @@ -17,7 +17,7 @@ public class ServerShutdownThread extends Thread { @@ -499,7 +499,7 @@ index 70f8d4299..449e99d1b 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java deleted file mode 100644 -index f239cd623..000000000 +index f239cd6236..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java +++ /dev/null @@ -1,56 +0,0 @@ @@ -560,7 +560,7 @@ index f239cd623..000000000 - } -} diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml -index 490a9acc7..08b6bb7f9 100644 +index 490a9acc70..08b6bb7f97 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -1,12 +1,11 @@ diff --git a/Spigot-Server-Patches/0172-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/0172-Fix-MC-117075-TE-Unload-Lag-Spike.patch index 60c38ca2ca..54784081ed 100644 --- a/Spigot-Server-Patches/0172-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/0172-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -1,14 +1,14 @@ -From b34797104929ce0cfd6143ec47b33616aeafb133 Mon Sep 17 00:00:00 2001 +From a01a2428df3949d2ed0cff75bcbbd0c81ac11b34 Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 9 Aug 2017 17:51:22 -0500 Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1286703bf..c9fc001f2 100644 +index 4b10048303..41908fa2a9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -727,7 +727,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -728,7 +728,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose gameprofilerfiller.enter("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { diff --git a/Spigot-Server-Patches/0184-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/Spigot-Server-Patches/0184-Send-attack-SoundEffects-only-to-players-who-can-see.patch index 0e36633aa1..2ed39ec2e4 100644 --- a/Spigot-Server-Patches/0184-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/Spigot-Server-Patches/0184-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -1,4 +1,4 @@ -From ee17efd1d77554be35135b8e259d2ebd09d6488d Mon Sep 17 00:00:00 2001 +From 336ef354f1d049b9a6b8730d1d42bc7fe2e6bac4 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 31 Oct 2017 03:26:18 +0100 Subject: [PATCH] Send attack SoundEffects only to players who can see the @@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 0f8100a05..a30d88af8 100644 +index 0f8100a05e..a30d88af81 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -941,6 +941,15 @@ public abstract class EntityHuman extends EntityLiving { @@ -72,10 +72,10 @@ index 0f8100a05..a30d88af8 100644 entity.extinguish(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c9fc001f2..4d86e7849 100644 +index 41908fa2a9..0389ecadff 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -664,6 +664,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -665,6 +665,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose this.a(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1); } diff --git a/Spigot-Server-Patches/0188-use-CB-BlockState-implementations-for-captured-block.patch b/Spigot-Server-Patches/0188-use-CB-BlockState-implementations-for-captured-block.patch index 25703b5c7c..12851a5304 100644 --- a/Spigot-Server-Patches/0188-use-CB-BlockState-implementations-for-captured-block.patch +++ b/Spigot-Server-Patches/0188-use-CB-BlockState-implementations-for-captured-block.patch @@ -1,4 +1,4 @@ -From 63a4edb55045af43ed1e849de350c49842029cc9 Mon Sep 17 00:00:00 2001 +From 4ce23a028026ea464b12623a787b7fd10a3de2bb Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 16 Nov 2017 12:12:41 +0000 Subject: [PATCH] use CB BlockState implementations for captured blocks @@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4d86e7849..3737fca81 100644 +index 0389ecadff..dd74f38038 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -342,7 +342,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -343,7 +343,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose // CraftBukkit start - capture blockstates CraftBlockState blockstate = null; if (this.captureBlockStates) { diff --git a/Spigot-Server-Patches/0216-Make-legacy-ping-handler-more-reliable.patch b/Spigot-Server-Patches/0216-Make-legacy-ping-handler-more-reliable.patch index f4f8775567..33a3728d41 100644 --- a/Spigot-Server-Patches/0216-Make-legacy-ping-handler-more-reliable.patch +++ b/Spigot-Server-Patches/0216-Make-legacy-ping-handler-more-reliable.patch @@ -1,4 +1,4 @@ -From 2d7542f78a2a2e686c4777b782f5ef15576a4ac5 Mon Sep 17 00:00:00 2001 +From c6d5999b1480d39890cd4f18a1ad0de0d5aa55ef Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 18:22:50 +0200 Subject: [PATCH] Make legacy ping handler more reliable @@ -28,7 +28,7 @@ respond to the request. [2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13 diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index c8c5df7f9..9bc1cce3f 100644 +index c8c5df7f95..06aefcb638 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -14,6 +14,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { @@ -138,7 +138,7 @@ index c8c5df7f9..9bc1cce3f 100644 + buf.release(); + this.buf = null; + -+ a.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress()); ++ LOGGER.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress()); + + String response = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", + Byte.MAX_VALUE, server.getVersion(), server.getMotd(), server.getPlayerCount(), server.getMaxPlayers()); diff --git a/Spigot-Server-Patches/0217-Call-PaperServerListPingEvent-for-legacy-pings.patch b/Spigot-Server-Patches/0217-Call-PaperServerListPingEvent-for-legacy-pings.patch index f09ce6a8c8..8f09da79a1 100644 --- a/Spigot-Server-Patches/0217-Call-PaperServerListPingEvent-for-legacy-pings.patch +++ b/Spigot-Server-Patches/0217-Call-PaperServerListPingEvent-for-legacy-pings.patch @@ -1,4 +1,4 @@ -From a0496589b3cfd1b90cb738162ae185d812763bf9 Mon Sep 17 00:00:00 2001 +From e1c2af36b6e7069f2abc68317de759fd2da7ea86 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 19:30:51 +0200 Subject: [PATCH] Call PaperServerListPingEvent for legacy pings @@ -6,7 +6,7 @@ Subject: [PATCH] Call PaperServerListPingEvent for legacy pings diff --git a/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java new file mode 100644 -index 000000000..74c012fd4 +index 0000000000..74c012fd40 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/PaperLegacyStatusClient.java @@ -0,0 +1,73 @@ @@ -84,7 +84,7 @@ index 000000000..74c012fd4 + +} diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 9bc1cce3f..e086b4140 100644 +index 06aefcb638..d0bb5496e4 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -1,5 +1,7 @@ @@ -135,7 +135,7 @@ index 9bc1cce3f..e086b4140 100644 default: @@ -169,8 +185,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - a.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress()); + LOGGER.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress()); - String response = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", - Byte.MAX_VALUE, server.getVersion(), server.getMotd(), server.getPlayerCount(), server.getMaxPlayers()); diff --git a/Spigot-Server-Patches/0250-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/0250-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index 2f04eea316..5340ae23c2 100644 --- a/Spigot-Server-Patches/0250-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/0250-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -1,4 +1,4 @@ -From a0e89fc9bdcb2d541f5b95d942149be5eb65e23a Mon Sep 17 00:00:00 2001 +From 49e199461743f603d9ca245880f23cb83c82c839 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 03:39:51 -0400 Subject: [PATCH] Avoid Chunk Lookups for Entity/TileEntity Current Chunk @@ -10,10 +10,10 @@ to the object directly on the Entity/TileEntity object we can directly grab. Use that local value instead to reduce lookups in many hot places. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3737fca817..6bd181565f 100644 +index dd74f38038..2f79f9e947 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -759,7 +759,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -760,7 +760,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose if (!tileentity.isRemoved() && tileentity.hasWorld()) { BlockPosition blockposition = tileentity.getPosition(); @@ -23,7 +23,7 @@ index 3737fca817..6bd181565f 100644 try { gameprofilerfiller.a(() -> { return String.valueOf(TileEntityTypes.a(tileentity.q())); -@@ -793,7 +794,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -794,7 +795,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose this.tileEntityListTick.remove(tileTickPosition--); // Spigot end //this.tileEntityList.remove(tileentity); // Paper - remove unused list @@ -32,7 +32,7 @@ index 3737fca817..6bd181565f 100644 this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition()); } } -@@ -814,8 +815,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -815,8 +816,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose } // CraftBukkit end */ diff --git a/Spigot-Server-Patches/0266-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0266-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 7eed10d0ef..8749415b6b 100644 --- a/Spigot-Server-Patches/0266-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0266-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -1,11 +1,11 @@ -From fb75e9482864768f1f26db3e016ac518ce57e478 Mon Sep 17 00:00:00 2001 +From 932521b41119d68d1fb10b377dc4431c358fdc2f Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Mon, 23 Jul 2018 12:57:39 +0200 Subject: [PATCH] Option to prevent armor stands from doing entity lookups diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 83e54cb90..f06bb3ae1 100644 +index 83e54cb904..f06bb3ae19 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -326,6 +326,11 @@ public class PaperWorldConfig { @@ -21,10 +21,10 @@ index 83e54cb90..f06bb3ae1 100644 private void maxEntityCollision() { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f9f0a94e9..79ded224c 100644 +index f8c382cb69..3f9ad25cbb 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -866,6 +866,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -867,6 +867,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose // Spigot end } diff --git a/Spigot-Server-Patches/0295-Optimize-CraftBlockData-Creation.patch b/Spigot-Server-Patches/0295-Optimize-CraftBlockData-Creation.patch index 64190f4900..c19aff5ed7 100644 --- a/Spigot-Server-Patches/0295-Optimize-CraftBlockData-Creation.patch +++ b/Spigot-Server-Patches/0295-Optimize-CraftBlockData-Creation.patch @@ -1,4 +1,4 @@ -From 9c821668fb448e021731f6a8975fc7aa7ba0d6b3 Mon Sep 17 00:00:00 2001 +From 4c59a577a70461ba86d4efef66915cee52fe4e7c Mon Sep 17 00:00:00 2001 From: miclebrick Date: Thu, 23 Aug 2018 11:45:32 -0400 Subject: [PATCH] Optimize CraftBlockData Creation @@ -6,39 +6,8 @@ Subject: [PATCH] Optimize CraftBlockData Creation Avoids a hashmap lookup by cacheing a reference to the CraftBlockData and cloning it when one is needed. -diff --git a/src/main/java/net/minecraft/server/BlockData.java b/src/main/java/net/minecraft/server/BlockData.java -new file mode 100644 -index 000000000..1b226a77e ---- /dev/null -+++ b/src/main/java/net/minecraft/server/BlockData.java -@@ -0,0 +1,25 @@ -+package net.minecraft.server; -+ -+import com.google.common.collect.ImmutableMap; -+import org.bukkit.craftbukkit.block.data.CraftBlockData; -+ -+public class BlockData extends BlockDataAbstract implements IBlockData { -+ -+ public BlockData(Block block, ImmutableMap, Comparable> immutablemap) { -+ super(block, immutablemap); -+ } -+ -+ public Block getBlock() { -+ return (Block) this.e_; -+ } -+ -+ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time -+ private CraftBlockData cachedCraftBlockData; -+ -+ @Override -+ public CraftBlockData createCraftBlockData() { -+ if(cachedCraftBlockData == null) cachedCraftBlockData = CraftBlockData.createData(this); -+ return (CraftBlockData) cachedCraftBlockData.clone(); -+ } -+ // Paper end -+} diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index e8ae4b5e4..5413fe5b1 100644 +index 0f4aa698aa..c66cabe82f 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java @@ -4,6 +4,8 @@ import com.google.common.collect.ImmutableMap; @@ -50,14 +19,13 @@ index e8ae4b5e4..5413fe5b1 100644 import java.util.Arrays; import java.util.Iterator; import java.util.List; -@@ -38,6 +40,16 @@ public class IBlockData extends BlockDataAbstract implements +@@ -38,6 +40,15 @@ public class IBlockData extends BlockDataAbstract implements return (Block) this.a; } + // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time + private CraftBlockData cachedCraftBlockData; + -+ @Override + public CraftBlockData createCraftBlockData() { + if(cachedCraftBlockData == null) cachedCraftBlockData = CraftBlockData.createData(this); + return (CraftBlockData) cachedCraftBlockData.clone(); @@ -68,7 +36,7 @@ index e8ae4b5e4..5413fe5b1 100644 return this.getBlock().l(this); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index c1666a9ba..3c29abd52 100644 +index c1666a9baf..3c29abd525 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -539,7 +539,17 @@ public class CraftBlockData implements BlockData { diff --git a/Spigot-Server-Patches/0304-Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-Server-Patches/0304-Add-ray-tracing-methods-to-LivingEntity.patch index 19d723aecc..96e32be0ab 100644 --- a/Spigot-Server-Patches/0304-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-Server-Patches/0304-Add-ray-tracing-methods-to-LivingEntity.patch @@ -1,22 +1,22 @@ -From b3fc29ee0ac0e56b2a3267a9b3bcd9e7b3e05bb8 Mon Sep 17 00:00:00 2001 +From 943fa216876f05eb896525e1fe18a46f63ae33ad Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 3 Sep 2018 18:20:03 -0500 Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 2ed2960c5..064703afe 100644 +index 8c3be17f7d..f86e7c9d4d 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3170,6 +3170,22 @@ public abstract class EntityLiving extends Entity { +@@ -3170,6 +3170,23 @@ public abstract class EntityLiving extends Entity { this.c(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND); } // Paper start + public MovingObjectPosition getRayTrace(int maxDistance) { -+ return getRayTrace(maxDistance, FluidCollisionOption.NEVER); ++ return getRayTrace(maxDistance, RayTrace.FluidCollisionOption.NONE); + } + -+ public MovingObjectPosition getRayTrace(int maxDistance, FluidCollisionOption fluidCollisionOption) { ++ public MovingObjectPosition getRayTrace(int maxDistance, RayTrace.FluidCollisionOption fluidCollisionOption) { + if (maxDistance < 1 || maxDistance > 120) { + throw new IllegalArgumentException("maxDistance must be between 1-120"); + } @@ -24,15 +24,16 @@ index 2ed2960c5..064703afe 100644 + Vec3D start = new Vec3D(locX, locY + getHeadHeight(), locZ); + org.bukkit.util.Vector dir = getBukkitEntity().getLocation().getDirection().multiply(maxDistance); + Vec3D end = new Vec3D(start.x + dir.getX(), start.y + dir.getY(), start.z + dir.getZ()); ++ RayTrace raytrace = new RayTrace(start, end, RayTrace.BlockCollisionOption.OUTLINE, fluidCollisionOption, this); // TODO review these options + -+ return world.rayTrace(start, end, fluidCollisionOption); ++ return world.rayTrace(raytrace); + } + public int shieldBlockingDelay = world.paperConfig.shieldBlockingDelay; public int getShieldBlockingDelay() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 29b23e30f..863802187 100644 +index 29b23e30fa..8638021879 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -170,6 +170,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/Spigot-Server-Patches/0306-Improve-death-events.patch b/Spigot-Server-Patches/0306-Improve-death-events.patch index 0ead4f9cff..cac5733e00 100644 --- a/Spigot-Server-Patches/0306-Improve-death-events.patch +++ b/Spigot-Server-Patches/0306-Improve-death-events.patch @@ -1,4 +1,4 @@ -From cbdfe763326cfd3b4cf02eedd82e10ffa0f841d4 Mon Sep 17 00:00:00 2001 +From 4d2ec687e93a4142a82ac66a97e2f90fee5604d8 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 21 Aug 2018 01:39:35 +0100 Subject: [PATCH] Improve death events @@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java -index 20db76abd..a148cd437 100644 +index 20db76abd7..a148cd437c 100644 --- a/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java @@ -175,6 +175,7 @@ public class CombatTracker { @@ -27,7 +27,7 @@ index 20db76abd..a148cd437 100644 int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 784520342..ef7f0213b 100644 +index 784520342e..ef7f0213b6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1460,6 +1460,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -47,7 +47,7 @@ index 784520342..ef7f0213b 100644 protected void i(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 7031dd0e4..f6dc96434 100644 +index 7031dd0e4c..f6dc96434b 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -675,7 +675,8 @@ public class EntityArmorStand extends EntityLiving { @@ -61,7 +61,7 @@ index 7031dd0e4..f6dc96434 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 064703afe..bd8385cd5 100644 +index f86e7c9d4d..2ca490eedc 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -77,7 +77,7 @@ public abstract class EntityLiving extends Entity { @@ -203,7 +203,20 @@ index 064703afe..bd8385cd5 100644 } protected void cE() {} -@@ -1895,6 +1920,7 @@ public abstract class EntityLiving extends Entity { +@@ -1442,6 +1467,7 @@ public abstract class EntityLiving extends Entity { + return SoundEffects.ENTITY_GENERIC_HURT; + } + ++ public final SoundEffect getDeathSoundEffect() { return this.getSoundDeath(); } // Paper - OBFHELPER + @Nullable + protected SoundEffect getSoundDeath() { + return SoundEffects.ENTITY_GENERIC_DEATH; +@@ -1891,10 +1917,12 @@ public abstract class EntityLiving extends Entity { + + } + ++ public final float getDeathSoundVolume() { return this.getSoundVolume(); } // Paper - OBFHELPER + protected float getSoundVolume() { return 1.0F; } @@ -212,7 +225,7 @@ index 064703afe..bd8385cd5 100644 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 634c30d93..332515128 100644 +index 634c30d93e..3325151284 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -74,6 +74,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -263,7 +276,7 @@ index 634c30d93..332515128 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 73cb64e09..9f317ff2e 100644 +index 73cb64e09d..9f317ff2e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java @@ -806,6 +806,22 @@ public enum CraftSound { @@ -290,7 +303,7 @@ index 73cb64e09..9f317ff2e 100644 this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d505af188..5f752784d 100644 +index d505af1883..5f752784d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1711,7 +1711,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -311,7 +324,7 @@ index d505af188..5f752784d 100644 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 50444ed94..46c05c398 100644 +index 50444ed94d..55642b6bd6 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -706,9 +706,16 @@ public class CraftEventFactory { @@ -356,11 +369,11 @@ index 50444ed94..46c05c398 100644 + private static void populateFields(EntityLiving victim, EntityDeathEvent event) { + event.setReviveHealth(event.getEntity().getAttribute(org.bukkit.attribute.Attribute.GENERIC_MAX_HEALTH).getValue()); + event.setShouldPlayDeathSound(!victim.silentDeath && !victim.isSilent()); -+ SoundEffect soundEffect = victim.getDeathSoundEffect(); ++ net.minecraft.server.SoundEffect soundEffect = victim.getDeathSoundEffect(); + event.setDeathSound(soundEffect != null ? org.bukkit.craftbukkit.CraftSound.getSoundByEffect(soundEffect) : null); -+ event.setDeathSoundCategory(org.bukkit.SoundCategory.valueOf(victim.getDeathSoundCategory().name())); ++ event.setDeathSoundCategory(org.bukkit.SoundCategory.valueOf(victim.getSoundCategory().name())); + event.setDeathSoundVolume(victim.getDeathSoundVolume()); -+ event.setDeathSoundPitch(victim.getDeathSoundPitch()); ++ event.setDeathSoundPitch(victim.getSoundPitch()); + } + + // Play death sound manually @@ -370,8 +383,8 @@ index 50444ed94..46c05c398 100644 + double x = event.getEntity().getLocation().getX(); + double y = event.getEntity().getLocation().getY(); + double z = event.getEntity().getLocation().getZ(); -+ SoundEffect soundEffect = org.bukkit.craftbukkit.CraftSound.getSoundEffect(event.getDeathSound()); -+ SoundCategory soundCategory = SoundCategory.valueOf(event.getDeathSoundCategory().name()); ++ net.minecraft.server.SoundEffect soundEffect = org.bukkit.craftbukkit.CraftSound.getSoundEffect(event.getDeathSound()); ++ net.minecraft.server.SoundCategory soundCategory = net.minecraft.server.SoundCategory.valueOf(event.getDeathSoundCategory().name()); + victim.world.sendSoundEffect(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch()); + } + } diff --git a/Spigot-Server-Patches/0311-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/Spigot-Server-Patches/0311-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch index 214fd8ed8b..2ae2bab676 100644 --- a/Spigot-Server-Patches/0311-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch +++ b/Spigot-Server-Patches/0311-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch @@ -1,11 +1,11 @@ -From 9d479f6c4d19fba75d8c7bf48654a9a6b612ccb5 Mon Sep 17 00:00:00 2001 +From 7f681a45cc0fadfba6ffc57b3130fd4bd4d11475 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 10 Sep 2018 23:56:36 -0400 Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java -index ce9318c57..541d97344 100644 +index ce9318c575..541d97344e 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java @@ -12,11 +12,13 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { @@ -53,7 +53,7 @@ index ce9318c57..541d97344 100644 return block == this.g && iworldreader.getType(blockposition.up()).isAir() && iworldreader.getType(blockposition.up(2)).isAir(); } diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java -index 8340d6d25..78eb1b39c 100644 +index 8340d6d25b..78eb1b39cf 100644 --- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java +++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java @@ -93,6 +93,7 @@ public class RandomPositionGenerator { @@ -74,10 +74,10 @@ index 8340d6d25..78eb1b39c 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 79ded224c..cfab578df 100644 +index 3f9ad25cbb..bebf5a6e19 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -644,6 +644,16 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -645,6 +645,16 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose return chunk.getType(blockposition); } } diff --git a/Spigot-Server-Patches/0326-Add-sun-related-API.patch b/Spigot-Server-Patches/0326-Add-sun-related-API.patch index 25350c0ca8..4651205532 100644 --- a/Spigot-Server-Patches/0326-Add-sun-related-API.patch +++ b/Spigot-Server-Patches/0326-Add-sun-related-API.patch @@ -1,11 +1,11 @@ -From 3e91502baf7be5a076bd88cd31eb942dff11f9cc Mon Sep 17 00:00:00 2001 +From ee3e637cb9b74bef591aa8a4f237b3d4ba070bc2 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 Oct 2018 00:54:21 -0500 Subject: [PATCH] Add sun related API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index f1621a9e9..a8318c88a 100644 +index f1621a9e9d..a8318c88af 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -1330,6 +1330,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -17,10 +17,10 @@ index f1621a9e9..a8318c88a 100644 if (this.world.J() && !this.world.isClientSide) { float f = this.aE(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cfab578df..c917c39b9 100644 +index bebf5a6e19..136727c280 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -666,6 +666,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -667,6 +667,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose } } @@ -29,7 +29,7 @@ index cfab578df..c917c39b9 100644 return this.d < 4; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a6f6046c6..5e672ae2e 100644 +index a6f6046c6e..5e672ae2e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -699,6 +699,12 @@ public class CraftWorld implements World { @@ -46,7 +46,7 @@ index a6f6046c6..5e672ae2e 100644 return createExplosion(x, y, z, power, false, true); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 53c2d154e..40a429942 100644 +index 53c2d154ed..40a429942e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -68,4 +68,10 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/Spigot-Server-Patches/0347-Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/0347-Optimize-redstone-algorithm.patch index 0637241bf8..c0da0f5d3b 100644 --- a/Spigot-Server-Patches/0347-Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/0347-Optimize-redstone-algorithm.patch @@ -1,4 +1,4 @@ -From b383c6d226402d5912e2f496b284530bc78d8a34 Mon Sep 17 00:00:00 2001 +From c688f13edec69f837b574ebf99ca0531222cbe93 Mon Sep 17 00:00:00 2001 From: theosib Date: Thu, 27 Sep 2018 01:43:35 -0600 Subject: [PATCH] Optimize redstone algorithm @@ -19,7 +19,7 @@ Aside from making the obvious class/function renames and obfhelpers I didn't nee Just added Bukkit's event system and took a few liberties with dead code and comment misspellings. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index ad793ffa3..ef882b897 100644 +index ad793ffa38..ef882b897f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -439,4 +439,14 @@ public class PaperWorldConfig { @@ -39,7 +39,7 @@ index ad793ffa3..ef882b897 100644 } diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java new file mode 100644 -index 000000000..21d9d6d7e +index 0000000000..21d9d6d7ed --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java @@ -0,0 +1,910 @@ @@ -954,7 +954,7 @@ index 000000000..21d9d6d7e + } +} diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java -index da903f74b..f8dfc91f2 100644 +index da903f74b6..f8dfc91f28 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java @@ -1,5 +1,7 @@ @@ -1122,10 +1122,10 @@ index da903f74b..f8dfc91f2 100644 c(iblockdata, world, blockposition); world.a(blockposition, false); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c917c39b9..17401ea28 100644 +index 136727c280..326165468c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -545,6 +545,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -546,6 +546,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose } @@ -1133,7 +1133,7 @@ index c917c39b9..17401ea28 100644 public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (!this.isClientSide) { IBlockData iblockdata = this.getType(blockposition); -@@ -1306,6 +1307,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -1307,6 +1308,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose return this.getBlockFacePower(blockposition.down(), EnumDirection.DOWN) > 0 ? true : (this.getBlockFacePower(blockposition.up(), EnumDirection.UP) > 0 ? true : (this.getBlockFacePower(blockposition.north(), EnumDirection.NORTH) > 0 ? true : (this.getBlockFacePower(blockposition.south(), EnumDirection.SOUTH) > 0 ? true : (this.getBlockFacePower(blockposition.west(), EnumDirection.WEST) > 0 ? true : this.getBlockFacePower(blockposition.east(), EnumDirection.EAST) > 0)))); } diff --git a/Spigot-Server-Patches/0348-force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/0348-force-entity-dismount-during-teleportation.patch index e13e412c4f..c674018af0 100644 --- a/Spigot-Server-Patches/0348-force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/0348-force-entity-dismount-during-teleportation.patch @@ -1,4 +1,4 @@ -From 7573ce9b6d709ce865081c767fc853299f3b4c91 Mon Sep 17 00:00:00 2001 +From ac2af12b9a299eac6e3756f2f31491d538da2be8 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 15 Nov 2018 13:38:37 +0000 Subject: [PATCH] force entity dismount during teleportation @@ -20,7 +20,7 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 0871e185e..f945a2df4 100644 +index 0871e185e4..f945a2df48 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1982,12 +1982,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -72,7 +72,7 @@ index 0871e185e..f945a2df4 100644 if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index f17c1c54b..e811a2917 100644 +index f17c1c54bf..e811a29175 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -937,9 +937,11 @@ public abstract class EntityHuman extends EntityLiving { @@ -91,10 +91,10 @@ index f17c1c54b..e811a2917 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index bd8385cd5..868b44a4b 100644 +index 2ca490eedc..637141d760 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2659,11 +2659,13 @@ public abstract class EntityLiving extends Entity { +@@ -2661,11 +2661,13 @@ public abstract class EntityLiving extends Entity { return ((Byte) this.datawatcher.get(EntityLiving.ar) & 4) != 0; } @@ -112,7 +112,7 @@ index bd8385cd5..868b44a4b 100644 this.B(entity); } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index c71e4dfbe..71ad35f71 100644 +index c71e4dfbea..71ad35f710 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -981,11 +981,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/0363-BlockDestroyEvent.patch b/Spigot-Server-Patches/0363-BlockDestroyEvent.patch index f2e053f106..16855cdb2e 100644 --- a/Spigot-Server-Patches/0363-BlockDestroyEvent.patch +++ b/Spigot-Server-Patches/0363-BlockDestroyEvent.patch @@ -1,4 +1,4 @@ -From f20c19300456b716f786f8c00c9693b430faaf42 Mon Sep 17 00:00:00 2001 +From 33d45dbc5bc35444a78c4e5935eefd193418f8d0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 6 Feb 2019 00:20:33 -0500 Subject: [PATCH] BlockDestroyEvent @@ -11,10 +11,10 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 17401ea28a..de0ed95083 100644 +index 326165468c..9c26b8d676 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -475,8 +475,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -476,8 +476,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose return false; } else { Fluid fluid = this.getFluid(blockposition); @@ -23,7 +23,7 @@ index 17401ea28a..de0ed95083 100644 + // it doesn't imply destruction of a block that plays a sound effect / drops an item. + boolean playEffect = true; + if (com.destroystokyo.paper.event.block.BlockDestroyEvent.getHandlerList().getRegisteredListeners().length > 0) { -+ com.destroystokyo.paper.event.block.BlockDestroyEvent event = new com.destroystokyo.paper.event.block.BlockDestroyEvent(MCUtil.toBukkitBlock(this, blockposition), fluid.i().createCraftBlockData(), flag); ++ com.destroystokyo.paper.event.block.BlockDestroyEvent event = new com.destroystokyo.paper.event.block.BlockDestroyEvent(MCUtil.toBukkitBlock(this, blockposition), fluid.getBlockData().createCraftBlockData(), flag); + if (!event.callEvent()) { + return false; + } diff --git a/Spigot-Server-Patches/0384-Optimize-Captured-TileEntity-Lookup.patch b/Spigot-Server-Patches/0384-Optimize-Captured-TileEntity-Lookup.patch index 9d9cb71c78..972c450477 100644 --- a/Spigot-Server-Patches/0384-Optimize-Captured-TileEntity-Lookup.patch +++ b/Spigot-Server-Patches/0384-Optimize-Captured-TileEntity-Lookup.patch @@ -1,4 +1,4 @@ -From fa5e4953123bf162b1fe07630bd8ef94ff94676b Mon Sep 17 00:00:00 2001 +From 5245dca65c8041ba7ca720267f06f1a707443255 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 6 Apr 2019 10:16:48 -0400 Subject: [PATCH] Optimize Captured TileEntity Lookup @@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to just do a get call since the value can never be null. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index de0ed95083..a038945b36 100644 +index 9c26b8d676..1bec5beab4 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1048,12 +1048,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -1049,12 +1049,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose return null; } else { // CraftBukkit start diff --git a/Spigot-Server-Patches/0385-Add-Heightmap-API.patch b/Spigot-Server-Patches/0385-Add-Heightmap-API.patch index 76c1f74167..dd0aeed8f6 100644 --- a/Spigot-Server-Patches/0385-Add-Heightmap-API.patch +++ b/Spigot-Server-Patches/0385-Add-Heightmap-API.patch @@ -1,14 +1,14 @@ -From 5a74b48ec46c0aebbd6c846fa9e9931e7cec4f49 Mon Sep 17 00:00:00 2001 +From 5ed504e3139da5671c3f602564391ff9776f6a80 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 1 Jan 2019 02:22:01 -0800 Subject: [PATCH] Add Heightmap API diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a038945b36..54a03fb102 100644 +index 1bec5beab4..9f4cf3f1b3 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -614,8 +614,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose +@@ -615,8 +615,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose } }