diff options
author | md_5 <git@md-5.net> | 2017-03-10 20:01:31 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-03-10 20:01:31 +1100 |
commit | d6aa73d16c98116305dbd7d639a07d57f1c55a08 (patch) | |
tree | 7625240d856878b5deeeb356043dc9fa2184dfdd /src | |
parent | 4316a8c246428aa7cf154198efe18d2252971651 (diff) | |
download | craftbukkit-d6aa73d16c98116305dbd7d639a07d57f1c55a08.tar craftbukkit-d6aa73d16c98116305dbd7d639a07d57f1c55a08.tar.gz craftbukkit-d6aa73d16c98116305dbd7d639a07d57f1c55a08.tar.lz craftbukkit-d6aa73d16c98116305dbd7d639a07d57f1c55a08.tar.xz craftbukkit-d6aa73d16c98116305dbd7d639a07d57f1c55a08.zip |
SPIGOT-3114: Initialize custom SHULKER_BOX slots
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java index 3f5ffb80..226fa0c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -12,6 +12,7 @@ import net.minecraft.server.EntityHuman; import net.minecraft.server.IInventory; import net.minecraft.server.PacketPlayOutOpenWindow; import net.minecraft.server.Slot; +import net.minecraft.server.SlotShulkerBox; public class CraftContainer extends Container { @@ -150,6 +151,9 @@ public class CraftContainer extends Container { case BEACON: setupBeacon(top, bottom); break; + case SHULKER_BOX: + setupShulkerBox(top, bottom); + break; } } @@ -346,6 +350,29 @@ public class CraftContainer extends Container { // End copy from ContainerBeacon } + private void setupShulkerBox(IInventory top, IInventory bottom) { + // This code is copied from ContainerShulkerBox + int i; + int j; + + for (i = 0; i < 3; ++i) { + for (j = 0; j < 9; ++j) { + this.a((Slot) (new SlotShulkerBox(top, j + i * 9, 8 + j * 18, 18 + i * 18))); + } + } + + for (i = 0; i < 3; ++i) { + for (j = 0; j < 9; ++j) { + this.a(new Slot(bottom, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) { + this.a(new Slot(bottom, i, 8 + i * 18, 142)); + } + // End copy from ContainerShulkerBox + } + public boolean a(EntityHuman entity) { return true; } |