From 7e6d4b54e14075ad07ee5eea63c245ca0a8bd6ca Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 2 Dec 2016 21:04:24 -0600 Subject: [PATCH] Don't remove random diffs in update --- ...ata-Conversion-post-ItemMeta-on-Copy.patch | 21 +++++++++++++---- ...imize-World.isLoaded-BlockPosition-Z.patch | 23 +++++++++++++++++++ work/CraftBukkit | 2 +- 3 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch diff --git a/Spigot-Server-Patches/0167-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch b/Spigot-Server-Patches/0167-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch index fc6dfcd7fc..3667e504c0 100644 --- a/Spigot-Server-Patches/0167-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch +++ b/Spigot-Server-Patches/0167-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch @@ -1,4 +1,4 @@ -From a4bbaeed9543205cae74962e91ad5472309a2054 Mon Sep 17 00:00:00 2001 +From ba3e15745ed9c595c8b787eff25b4092ab524e97 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 22:31:18 -0400 Subject: [PATCH] Process NMS Data Conversion post ItemMeta on Copy @@ -14,8 +14,21 @@ erasing the NBT Tag. On copy, run conversion post ItemMeta apply. +diff --git a/src/main/java/net/minecraft/server/DataInspectorBlockEntity.java b/src/main/java/net/minecraft/server/DataInspectorBlockEntity.java +index 4a8820e68..27fb802bf 100644 +--- a/src/main/java/net/minecraft/server/DataInspectorBlockEntity.java ++++ b/src/main/java/net/minecraft/server/DataInspectorBlockEntity.java +@@ -32,7 +32,7 @@ public class DataInspectorBlockEntity implements DataInspector { + boolean flag; + + if (s1 == null) { +- DataInspectorBlockEntity.a.warn("Unable to resolve BlockEntity for ItemInstance: {}", new Object[] { s}); ++ //DataInspectorBlockEntity.a.warn("Unable to resolve BlockEntity for ItemInstance: {}", new Object[] { s}); // Paper - no need to nag about an ok condition + flag = false; + } else { + flag = !nbttagcompound2.hasKey("id"); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 6697305..1218c00 100644 +index 66973051a..1218c005e 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -55,13 +55,24 @@ public final class ItemStack { @@ -45,7 +58,7 @@ index 6697305..1218c00 100644 this.save(savedStack); MinecraftServer.getServer().getDataConverterManager().a(DataConverterTypes.ITEM_INSTANCE, savedStack); // PAIL: convert diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 4afd3a9..a862e94 100644 +index 4afd3a99a..a862e946c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -41,10 +41,11 @@ public final class CraftItemStack extends ItemStack { @@ -62,5 +75,5 @@ index 4afd3a9..a862e94 100644 } -- -2.10.2 +2.11.0 diff --git a/Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch new file mode 100644 index 0000000000..39b7ce63f0 --- /dev/null +++ b/Spigot-Server-Patches/0185-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -0,0 +1,23 @@ +From 3fd7a8e63220cb6fe7d57df374d54cfc327b4354 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Fri, 2 Dec 2016 00:11:43 -0500 +Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z + +Reduce method invocations for World.isLoaded(BlockPosition)Z + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index e7ae4c706..51e05f414 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -286,7 +286,7 @@ public abstract class World implements IBlockAccess { + } + + public boolean isLoaded(BlockPosition blockposition) { +- return this.a(blockposition, true); ++ return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null; // Paper + } + + public boolean a(BlockPosition blockposition, boolean flag) { +-- +2.11.0 + diff --git a/work/CraftBukkit b/work/CraftBukkit index 9beb0c9968..b64d852496 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 9beb0c9968c228788c7bbc446316ccd20e6a0c15 +Subproject commit b64d8524968ef0984bb78dd026192e83b56149d8