Check property exists before playing chest close sound

There is an artificial delay added to chest close sounds (of 10 ticks)
to make them "feel" more true to vanilla. The problem is that because of
this delay it is possible for the block to be removed by the time the
sound plays.

With 1.14 in the state it is the timing necessary to encounter this
issue has increased.

The correct fix is to just return early if the property checked for in
the TileEntityChest sound method does not exist for the block at the
current location.

Fixes GH-2074
This commit is contained in:
Zach Brown 2019-05-26 23:36:37 -05:00
parent e9c7232267
commit 7fe6e643d1
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76
4 changed files with 122 additions and 57 deletions

View file

@ -1,11 +1,11 @@
From 921ea44be515f7dd627904bfa4d047ba879b981c Mon Sep 17 00:00:00 2001
From e7ae9977cb612b6047302839a803792f2a8a20b5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
index 26fa6e7b64..9a839d6540 100644
index 26fa6e7b6..9a839d654 100644
--- a/src/main/java/net/minecraft/server/BiomeBase.java
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
@@ -42,7 +42,7 @@ public abstract class BiomeBase {
@ -26,8 +26,53 @@ index 26fa6e7b64..9a839d6540 100644
}
public List<WorldGenFeatureConfigured<?>> e() {
diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java
index adc998186..c385c7b0b 100644
--- a/src/main/java/net/minecraft/server/BlockDataAbstract.java
+++ b/src/main/java/net/minecraft/server/BlockDataAbstract.java
@@ -29,7 +29,7 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
}
private <T extends Comparable<T>> String a(IBlockState<T> iblockstate, Comparable<?> comparable) {
- return iblockstate.a(comparable);
+ return iblockstate.a((T) comparable); // Paper - decompiler fix
}
};
protected final O a;
@@ -44,11 +44,11 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
}
public <T extends Comparable<T>> S a(IBlockState<T> iblockstate) {
- return this.set(iblockstate, (Comparable) a(iblockstate.d(), this.get(iblockstate)));
+ return this.set(iblockstate, a(iblockstate.d(), this.get(iblockstate))); // Paper - decompiler fix
}
protected static <T> T a(Collection<T> collection, T t0) {
- Iterator iterator = collection.iterator();
+ Iterator<T> iterator = collection.iterator(); // Paper - decompiler fix
do {
if (!iterator.hasNext()) {
@@ -91,7 +91,7 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
if (comparable == null) {
throw new IllegalArgumentException("Cannot get property " + iblockstate + " as it does not exist in " + this.a);
} else {
- return (Comparable) iblockstate.b().cast(comparable);
+ return iblockstate.b().cast(comparable); // Paper - decompiler fix
}
}
@@ -102,7 +102,7 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
if (comparable == null) {
throw new IllegalArgumentException("Cannot set property " + iblockstate + " as it does not exist in " + this.a);
} else if (comparable == v0) {
- return this;
+ return (S) this; // Paper - decompiler fix
} else {
S s0 = this.f.get(iblockstate, v0);
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index f0ff70980d..dd47e9cbe4 100644
index f0ff70980..dd47e9cbe 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -57,12 +57,12 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@ -47,7 +92,7 @@ index f0ff70980d..dd47e9cbe4 100644
});
}
diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java
index b4c8722f04..59d86fc66e 100644
index b4c8722f0..59d86fc66 100644
--- a/src/main/java/net/minecraft/server/BlockStateEnum.java
+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java
@@ -20,10 +20,10 @@ public class BlockStateEnum<T extends Enum<T> & INamable> extends BlockState<T>
@ -64,7 +109,7 @@ index b4c8722f04..59d86fc66e 100644
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
index c973ab607..30701fd7f 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 {
@ -76,7 +121,7 @@ index c973ab6076..30701fd7f3 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
index 199f674905..c7a744355a 100644
index 199f67490..c7a744355 100644
--- a/src/main/java/net/minecraft/server/EntityFox.java
+++ b/src/main/java/net/minecraft/server/EntityFox.java
@@ -97,7 +97,7 @@ public class EntityFox extends EntityAnimal {
@ -89,7 +134,7 @@ index 199f674905..c7a744355a 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java
index 1692e6b47e..dbd189afe6 100644
index 1692e6b47..dbd189afe 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 {
@ -102,7 +147,7 @@ index 1692e6b47e..dbd189afe6 100644
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
index d8d226708..3de9d264d 100644
--- a/src/main/java/net/minecraft/server/GameRules.java
+++ b/src/main/java/net/minecraft/server/GameRules.java
@@ -17,7 +17,7 @@ import javax.annotation.Nullable;
@ -124,7 +169,7 @@ index d8d2267084..3de9d264db 100644
this.e = bifunction;
}
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
index 053d408d36..4510018d6f 100644
index 053d408d3..4510018d6 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -51,7 +51,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
@ -154,7 +199,7 @@ index 053d408d36..4510018d6f 100644
}
}
diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java
index 2ed6119804..6e365f402c 100644
index 2ed611980..6e365f402 100644
--- a/src/main/java/net/minecraft/server/IBlockAccess.java
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java
@@ -96,7 +96,7 @@ public interface IBlockAccess {
@ -167,7 +212,7 @@ index 2ed6119804..6e365f402c 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
index e8ae4b5e4..0f4aa698a 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<Block, IBlockData> implements
@ -209,7 +254,7 @@ index e8ae4b5e44..0f4aa698aa 100644
}
}
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index bf7e0d17ef..ee22bb0387 100644
index bf7e0d17e..ee22bb038 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -147,17 +147,17 @@ public interface IEntityAccess {
@ -247,7 +292,7 @@ index bf7e0d17ef..ee22bb0387 100644
if (pathfindertargetcondition.a(entityliving, t0)) {
list1.add(t0);
diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java
index 9290534917..1016325bd7 100644
index 929053491..1016325bd 100644
--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java
+++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java
@@ -127,7 +127,7 @@ public abstract class LootSelectorEntry extends LootEntryAbstract {
@ -275,7 +320,7 @@ index 9290534917..1016325bd7 100644
}
diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java
index cb0c08a144..9aabcb630f 100644
index cb0c08a14..9aabcb630 100644
--- a/src/main/java/net/minecraft/server/NBTBase.java
+++ b/src/main/java/net/minecraft/server/NBTBase.java
@@ -88,7 +88,7 @@ public interface NBTBase {
@ -288,7 +333,7 @@ index cb0c08a144..9aabcb630f 100644
default String asString() {
return this.toString();
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 0dda7aaf69..4e20cfba41 100644
index 0dda7aaf6..4e20cfba4 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -134,7 +134,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@ -301,7 +346,7 @@ index 0dda7aaf69..4e20cfba41 100644
}
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 7f89562e90..4efcb8b595 100644
index 7f89562e9..4efcb8b59 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -27,7 +27,7 @@ public class RegistryBlockID<T> implements Registry<T> {
@ -314,7 +359,7 @@ index 7f89562e90..4efcb8b595 100644
this.c.set(i, t0);
diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java
index 4cb78c6a3f..e15d286710 100644
index 4cb78c6a3..e15d28671 100644
--- a/src/main/java/net/minecraft/server/RegistryID.java
+++ b/src/main/java/net/minecraft/server/RegistryID.java
@@ -17,9 +17,9 @@ public class RegistryID<K> implements Registry<K> {
@ -342,7 +387,7 @@ index 4cb78c6a3f..e15d286710 100644
this.f = 0;
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
index 41a5d1dc29..b3799ab564 100644
index 41a5d1dc2..b3799ab56 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -45,8 +45,8 @@ public class SystemUtils {
@ -386,7 +431,7 @@ index 41a5d1dc29..b3799ab564 100644
if (throwable != null) {
completablefuture.completeExceptionally(throwable);
diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java
index b0d44e3778..ff3f15eac0 100644
index b0d44e377..ff3f15eac 100644
--- a/src/main/java/net/minecraft/server/VillagerTrades.java
+++ b/src/main/java/net/minecraft/server/VillagerTrades.java
@@ -15,12 +15,12 @@ import javax.annotation.Nullable;
@ -406,7 +451,7 @@ index b0d44e3778..ff3f15eac0 100644
hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 8, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.GOLD_INGOT, 3, 6, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.RABBIT_FOOT, 2, 6, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SCUTE, 4, 6, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 6, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.NETHER_WART, 22, 6, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)})));
hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COAL, 15, 8, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 6, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.IRON_INGOT, 4, 6, 10), new VillagerTrades.h(new ItemStack(Items.pP), 36, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 6, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.LAVA_BUCKET, 1, 6, 20), new VillagerTrades.b(Items.DIAMOND, 1, 6, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 6, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 2, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 2, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 2, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 2, 30, 0.2F)})));
diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java
index b251a1d7d9..3c5b3fe101 100644
index b251a1d7d..3c5b3fe10 100644
--- a/src/main/java/net/minecraft/server/WorldPersistentData.java
+++ b/src/main/java/net/minecraft/server/WorldPersistentData.java
@@ -37,7 +37,7 @@ public class WorldPersistentData {

View file

@ -1,11 +1,11 @@
From 9efde2e55404cac29d18d2b973d0d7f86d26c018 Mon Sep 17 00:00:00 2001
From f54c84e030a4d3956c07c3a3dfa22535b14becde Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:55:47 -0400
Subject: [PATCH] MC Utils
diff --git a/src/main/java/net/minecraft/server/AttributeInstance.java b/src/main/java/net/minecraft/server/AttributeInstance.java
index 2f2b103641..b1900ba364 100644
index 2f2b10364..b1900ba36 100644
--- a/src/main/java/net/minecraft/server/AttributeInstance.java
+++ b/src/main/java/net/minecraft/server/AttributeInstance.java
@@ -21,8 +21,10 @@ public interface AttributeInstance {
@ -19,8 +19,20 @@ index 2f2b103641..b1900ba364 100644
void c(AttributeModifier attributemodifier);
void b(UUID uuid);
diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java
index c385c7b0b..984857479 100644
--- a/src/main/java/net/minecraft/server/BlockDataAbstract.java
+++ b/src/main/java/net/minecraft/server/BlockDataAbstract.java
@@ -80,6 +80,7 @@ public abstract class BlockDataAbstract<O, S> implements IBlockDataHolder<S> {
return Collections.unmodifiableCollection(this.d.keySet());
}
+ public final <T extends Comparable<T>> boolean hasProperty(IBlockState<T> iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER
public <T extends Comparable<T>> boolean b(IBlockState<T> iblockstate) {
return this.d.containsKey(iblockstate);
}
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index dd47e9cbe4..c927d524a8 100644
index dd47e9cbe..c927d524a 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -120,6 +120,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali
@ -57,7 +69,7 @@ index dd47e9cbe4..c927d524a8 100644
return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index ca73bfbd83..26414a07a2 100644
index ca73bfbd8..26414a07a 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
@ -78,7 +90,7 @@ index ca73bfbd83..26414a07a2 100644
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
index 857b2f8868..bbf136614c 100644
index 857b2f886..bbf136614 100644
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
@@ -31,7 +31,9 @@ public class ChunkCoordIntPair {
@ -93,7 +105,7 @@ index 857b2f8868..bbf136614c 100644
}
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
index 8bda055159..409dc837c6 100644
index 8bda05515..409dc837c 100644
--- a/src/main/java/net/minecraft/server/DataBits.java
+++ b/src/main/java/net/minecraft/server/DataBits.java
@@ -82,6 +82,7 @@ public class DataBits {
@ -105,7 +117,7 @@ index 8bda055159..409dc837c6 100644
return this.a;
}
diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java
index 75ba698868..45403fbe30 100644
index 75ba69886..45403fbe3 100644
--- a/src/main/java/net/minecraft/server/DataPalette.java
+++ b/src/main/java/net/minecraft/server/DataPalette.java
@@ -4,10 +4,12 @@ import javax.annotation.Nullable;
@ -122,7 +134,7 @@ index 75ba698868..45403fbe30 100644
T a(int i);
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
index 4411d5640a..28a6be7ab0 100644
index 4411d5640..28a6be7ab 100644
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
@@ -8,7 +8,7 @@ import java.util.stream.Collectors;
@ -164,7 +176,7 @@ index 4411d5640a..28a6be7ab0 100644
this.a();
packetdataserializer.writeByte(this.i);
diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java
index 4f69e23271..8f5f61f602 100644
index 4f69e2327..8f5f61f60 100644
--- a/src/main/java/net/minecraft/server/EntityCreature.java
+++ b/src/main/java/net/minecraft/server/EntityCreature.java
@@ -6,6 +6,8 @@ import org.bukkit.event.entity.EntityUnleashEvent;
@ -177,7 +189,7 @@ index 4f69e23271..8f5f61f602 100644
super(entitytypes, world);
}
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 0ca7cd31f4..113532a97b 100644
index 0ca7cd31f..113532a97 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -143,6 +143,7 @@ public abstract class EntityInsentient extends EntityLiving {
@ -189,7 +201,7 @@ index 0ca7cd31f4..113532a97b 100644
// CraftBukkit start - fire event
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index bd515c6264..d5ffa9f0f7 100644
index bd515c626..d5ffa9f0f 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -126,6 +126,7 @@ public abstract class EntityLiving extends Entity {
@ -201,7 +213,7 @@ index bd515c6264..d5ffa9f0f7 100644
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java
index 6ab4c78b35..76142d5dc2 100644
index 6ab4c78b3..76142d5dc 100644
--- a/src/main/java/net/minecraft/server/EntityMonster.java
+++ b/src/main/java/net/minecraft/server/EntityMonster.java
@@ -4,6 +4,7 @@ import java.util.function.Predicate;
@ -213,7 +225,7 @@ index 6ab4c78b35..76142d5dc2 100644
super(entitytypes, world);
this.f = 5;
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 8c918d0d68..56a2d7df5e 100644
index 8c918d0d6..56a2d7df5 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -5,6 +5,7 @@ import com.mojang.datafixers.types.Type;
@ -236,7 +248,7 @@ index 8c918d0d68..56a2d7df5e 100644
}
diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
index 4510018d6f..c0d5112444 100644
index 4510018d6..c0d511244 100644
--- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java
@@ -64,6 +64,15 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R
@ -256,7 +268,7 @@ index 4510018d6f..c0d5112444 100644
this.d.add(r0);
LockSupport.unpark(this.getThread());
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index e975265a28..aa6a58dd88 100644
index e975265a2..aa6a58dd8 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -37,10 +37,19 @@ import org.bukkit.event.world.StructureGrowEvent;
@ -316,7 +328,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..c96f3ed176
index 000000000..c96f3ed17
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +1,316 @@
@ -637,7 +649,7 @@ index 0000000000..c96f3ed176
+ }
+}
diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java
index e16a579b55..3f6d2676e7 100644
index e16a579b5..3f6d2676e 100644
--- a/src/main/java/net/minecraft/server/NBTTagCompound.java
+++ b/src/main/java/net/minecraft/server/NBTTagCompound.java
@@ -23,7 +23,7 @@ public class NBTTagCompound implements NBTBase {
@ -666,7 +678,7 @@ index e16a579b55..3f6d2676e7 100644
return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least"));
}
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index fe6854d0e4..2db7229e91 100644
index fe6854d0e..2db7229e9 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -43,7 +43,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
@ -707,7 +719,7 @@ index fe6854d0e4..2db7229e91 100644
public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) {
this.a = packet;
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
index db2fe836c2..0d67676f7d 100644
index db2fe836c..0d67676f7 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
@@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf {
@ -719,7 +731,7 @@ index db2fe836c2..0d67676f7d 100644
for (int j = 1; j < 5; ++j) {
if ((i & -1 << j * 7) == 0) {
diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java
index 90223deae3..63c4dbd327 100644
index 90223deae..63c4dbd32 100644
--- a/src/main/java/net/minecraft/server/PacketEncoder.java
+++ b/src/main/java/net/minecraft/server/PacketEncoder.java
@@ -42,6 +42,7 @@ public class PacketEncoder extends MessageToByteEncoder<Packet<?>> {
@ -731,7 +743,7 @@ index 90223deae3..63c4dbd327 100644
throw new SkipEncodeException(throwable);
} else {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 4e20cfba41..363ab5da12 100644
index 4e20cfba4..363ab5da1 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -14,7 +14,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
@ -752,7 +764,7 @@ index 4e20cfba41..363ab5da12 100644
int j = 0;
ChunkSection[] achunksection = chunk.getSections();
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 68926d0de6..5757dd6fb3 100644
index 68926d0de..5757dd6fb 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn {
@ -769,7 +781,7 @@ index 68926d0de6..5757dd6fb3 100644
private volatile int chatThrottle;
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java
index a5dba62caf..a088658ae0 100644
index a5dba62ca..a088658ae 100644
--- a/src/main/java/net/minecraft/server/PlayerInventory.java
+++ b/src/main/java/net/minecraft/server/PlayerInventory.java
@@ -17,7 +17,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity {
@ -782,7 +794,7 @@ index a5dba62caf..a088658ae0 100644
public final EntityHuman player;
private ItemStack carried;
diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java
index b3824898da..bf4172be52 100644
index b3824898d..bf4172be5 100644
--- a/src/main/java/net/minecraft/server/PotionUtil.java
+++ b/src/main/java/net/minecraft/server/PotionUtil.java
@@ -110,6 +110,7 @@ public class PotionUtil {
@ -794,7 +806,7 @@ index b3824898da..bf4172be52 100644
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 4efcb8b595..60948afa4e 100644
index 4efcb8b59..60948afa4 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java
@@ -57,6 +57,7 @@ public class RegistryBlockID<T> implements Registry<T> {
@ -806,7 +818,7 @@ index 4efcb8b595..60948afa4e 100644
return this.b.size();
}
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
index b3799ab564..5fae5a1233 100644
index b3799ab56..5fae5a123 100644
--- a/src/main/java/net/minecraft/server/SystemUtils.java
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
@@ -58,7 +58,7 @@ public class SystemUtils {
@ -819,7 +831,7 @@ index b3799ab564..5fae5a1233 100644
public static long getTimeMillis() {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 923d8e28e7..404d3d8c82 100644
index 923d8e28e..404d3d8c8 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -371,8 +371,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@ -835,7 +847,7 @@ index 923d8e28e7..404d3d8c82 100644
return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0));
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 42f7bb0f7d..5d71addb0c 100644
index 42f7bb0f7..5d71addb0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -85,6 +85,7 @@ public final class CraftItemStack extends ItemStack {

View file

@ -1,11 +1,11 @@
From 902b97c38b3a8621321d4d2e0eaf73efb88b4128 Mon Sep 17 00:00:00 2001
From ca6926b3098bec053cba3fe0eb76e9ab125c53bf Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 8 Mar 2015 22:55:25 -0600
Subject: [PATCH] Optimize TileEntity Ticking
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
index 271406f8bb..d606e2e4fd 100644
index 271406f8b..85b450c05 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;
@ -65,7 +65,15 @@ index 271406f8bb..d606e2e4fd 100644
if (this.a < 0.0F) {
this.a = 0.0F;
@@ -210,6 +222,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -172,6 +184,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
}
private void a(SoundEffect soundeffect) {
+ if (!this.getBlock().hasProperty(BlockChest.b)) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074
BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.b);
if (blockpropertychesttype != BlockPropertyChestType.LEFT) {
@@ -210,6 +223,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
++this.viewingCount;
if (this.world == null) return; // CraftBukkit
@ -73,7 +81,7 @@ index 271406f8bb..d606e2e4fd 100644
// CraftBukkit start - Call redstone event
if (this.getBlock().getBlock() == Blocks.TRAPPED_CHEST) {
@@ -232,6 +245,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
@@ -232,6 +246,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable {
--this.viewingCount;
// CraftBukkit start - Call redstone event
@ -82,7 +90,7 @@ index 271406f8bb..d606e2e4fd 100644
int newPower = Math.max(0, Math.min(15, this.viewingCount));
diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
index 6908f50031..ed5cdf177f 100644
index 6908f5003..ed5cdf177 100644
--- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityEnderChest.java
@@ -1,6 +1,6 @@

View file

@ -1,11 +1,11 @@
From 76e46a384be86466049b90d85aeff048a6b91794 Mon Sep 17 00:00:00 2001
From 3a94f239a03b331998136ad340f44e43edfeeda0 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 8 Sep 2018 18:43:31 -0500
Subject: [PATCH] Allow chests to be placed with NBT data
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 2d83c9e79c..dec5894637 100644
index 2d83c9e79..dec589463 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -235,6 +235,7 @@ public final class ItemStack {
@ -17,10 +17,10 @@ index 2d83c9e79c..dec5894637 100644
for (BlockState blockstate : blocks) {
blockstate.update(true, false);
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
index d606e2e4fd..f9f9183daa 100644
index 85b450c05..efc153de5 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -308,7 +308,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
@@ -309,7 +309,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
// CraftBukkit start
@Override
public boolean isFilteredNBT() {