From 202ad432146dd7b0ed26983c13ae903ffa965ba5 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 8 Feb 2015 18:34:33 +1100 Subject: [PATCH] + dropper --- .../plot/util/ChunkManager.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java index 914976dd4..5805d764f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java @@ -229,6 +229,15 @@ public class ChunkManager { } else { PlotMain.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate dispenser: "+loc.x+","+loc.y+","+loc.z); } } + for (BlockLoc loc: dropperContents.keySet()) { + Block block = world.getBlockAt(loc.x, loc.y, loc.z); + BlockState state = block.getState(); + if (state instanceof Dropper) { + ((Dropper) (state)).getInventory().setContents(dropperContents.get(loc)); + state.update(true); + } + else { PlotMain.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate dispenser: "+loc.x+","+loc.y+","+loc.z); } + } for (BlockLoc loc: beaconContents.keySet()) { Block block = world.getBlockAt(loc.x, loc.y, loc.z); BlockState state = block.getState(); @@ -397,6 +406,12 @@ public class ChunkManager { ItemStack[] invDis = dispenser.getInventory().getContents().clone(); dispenserContents.put(bl, invDis); break; + case 158: + bl = new BlockLoc(x, y, z); + Dropper dropper = (Dropper) block.getState(); + ItemStack[] invDro = dropper.getInventory().getContents().clone(); + dropperContents.put(bl, invDro); + break; case 117: bl = new BlockLoc(x, y, z); BrewingStand brewingStand = (BrewingStand) block.getState();