summaryrefslogtreecommitdiffstats
path: root/nms-patches/TileEntityChest.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-03-01 08:32:46 +1100
committermd_5 <git@md-5.net>2016-03-01 09:32:45 +1100
commitaa008dff0f9bedbe88e1fe79831776b0a52eb90a (patch)
treecb520e0f4cc5d683fb9b7fb95de37480a7443dfb /nms-patches/TileEntityChest.patch
parente1ebe524a78e27f6a2829ed4574fded3779094e1 (diff)
downloadcraftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.gz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.lz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.xz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.zip
Update to Minecraft 1.9
Diffstat (limited to 'nms-patches/TileEntityChest.patch')
-rw-r--r--nms-patches/TileEntityChest.patch37
1 files changed, 18 insertions, 19 deletions
diff --git a/nms-patches/TileEntityChest.patch b/nms-patches/TileEntityChest.patch
index 605ced78..a9d933db 100644
--- a/nms-patches/TileEntityChest.patch
+++ b/nms-patches/TileEntityChest.patch
@@ -9,7 +9,7 @@
+import org.bukkit.entity.HumanEntity;
+// CraftBukkit end
+
- public class TileEntityChest extends TileEntityContainer implements IUpdatePlayerListBox, IInventory {
+ public class TileEntityChest extends TileEntityLootable implements ITickable, IInventory {
private ItemStack[] items = new ItemStack[27];
@@ -20,6 +25,31 @@
@@ -41,10 +41,10 @@
+ }
+ // CraftBukkit end
+
- public int getSize() {
- return 27;
+ public TileEntityChest(BlockChest.Type blockchest_type) {
+ this.q = blockchest_type;
}
-@@ -125,10 +155,11 @@
+@@ -118,10 +148,11 @@
}
public int getMaxStackSize() {
@@ -57,7 +57,7 @@
return this.world.getTileEntity(this.position) != this ? false : entityhuman.e((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D;
}
-@@ -304,9 +335,21 @@
+@@ -297,9 +328,21 @@
if (this.l < 0) {
this.l = 0;
}
@@ -65,10 +65,10 @@
++this.l;
+ if (this.world == null) return; // CraftBukkit
- this.world.playBlockAction(this.position, this.w(), 1, this.l);
+ this.world.playBlockAction(this.position, this.getBlock(), 1, this.l);
+
+ // CraftBukkit start - Call redstone event
-+ if (this.w() == Blocks.TRAPPED_CHEST) {
++ if (this.getBlock() == Blocks.TRAPPED_CHEST) {
+ int newPower = Math.max(0, Math.min(15, this.l));
+
+ if (oldPower != newPower) {
@@ -76,20 +76,20 @@
+ }
+ }
+ // CraftBukkit end
- this.world.applyPhysics(this.position, this.w());
- this.world.applyPhysics(this.position.down(), this.w());
+ this.world.applyPhysics(this.position, this.getBlock());
+ this.world.applyPhysics(this.position.down(), this.getBlock());
}
-@@ -315,8 +358,20 @@
+@@ -308,8 +351,20 @@
public void closeContainer(EntityHuman entityhuman) {
- if (!entityhuman.isSpectator() && this.w() instanceof BlockChest) {
+ if (!entityhuman.isSpectator() && this.getBlock() instanceof BlockChest) {
+ int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
--this.l;
+ if (this.world == null) return; // CraftBukkit
- this.world.playBlockAction(this.position, this.w(), 1, this.l);
+ this.world.playBlockAction(this.position, this.getBlock(), 1, this.l);
+
+ // CraftBukkit start - Call redstone event
-+ if (this.w() == Blocks.TRAPPED_CHEST) {
++ if (this.getBlock() == Blocks.TRAPPED_CHEST) {
+ int newPower = Math.max(0, Math.min(15, this.l));
+
+ if (oldPower != newPower) {
@@ -97,17 +97,16 @@
+ }
+ }
+ // CraftBukkit end
- this.world.applyPhysics(this.position, this.w());
- this.world.applyPhysics(this.position.down(), this.w());
+ this.world.applyPhysics(this.position, this.getBlock());
+ this.world.applyPhysics(this.position.down(), this.getBlock());
}
-@@ -370,6 +425,14 @@
-
+@@ -371,6 +426,13 @@
+ this.n = i;
}
+ // CraftBukkit start
-+ // PAIL
+ @Override
-+ public boolean F() {
++ public boolean isFilteredNBT() {
+ return true;
+ }
+ // CraftBukkit end