diff --git a/.gitignore b/.gitignore index 10fb46bc4..4690eedc0 100644 --- a/.gitignore +++ b/.gitignore @@ -136,3 +136,4 @@ hs_err_pid* *.java target/PlotSquared-Null.jar target/PlotSquared-Uber.jar +/target/ diff --git a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 94ae1c756..2f5231e1b 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -157,55 +157,6 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen } }, 3); } - - @EventHandler - public void onInventoryPickup(InventoryPickupItemEvent event) { - Inventory inv = event.getInventory(); - System.out.print(inv.getTitle() + " | " + inv.getHolder() + " | " + inv + " | " + inv.getType()); - Location loc = BukkitUtil.getLocation(event.getItem().getLocation()); - if (!PS.get().isPlotWorld(loc.getWorld())) { - return; - } - Plot plot = MainUtil.getPlot(loc); - if (plot == null || !plot.hasOwner()) { - return; - } - Flag redstone = FlagManager.getPlotFlag(plot, "redstone"); - if (redstone != null) { - if ((Boolean) redstone.getValue()) { - return; - } - else { - event.setCancelled(true); - return; - } - } - if (Settings.REDSTONE_DISABLER) { - if (UUIDHandler.getPlayer(plot.owner) == null) { - boolean disable = true; - for (UUID trusted : plot.getTrusted()) { - if (UUIDHandler.getPlayer(trusted) != null) { - disable = false; - break; - } - } - if (disable) { - event.setCancelled(true); - - return; - } - } - } - if (Settings.REDSTONE_DISABLER_UNOCCUPIED) { - for (PlotPlayer pp : UUIDHandler.getPlayers().values()) { - if (plot.equals(pp.getCurrentPlot())) { - return; - } - } - event.setCancelled(true); - return; - } - } @EventHandler public void onRedstoneEvent(BlockRedstoneEvent event) { diff --git a/src/main/java/com/plotsquared/bukkit/util/SendChunk.java b/src/main/java/com/plotsquared/bukkit/util/SendChunk.java index 160c1fcb2..df62eb10b 100644 --- a/src/main/java/com/plotsquared/bukkit/util/SendChunk.java +++ b/src/main/java/com/plotsquared/bukkit/util/SendChunk.java @@ -22,6 +22,7 @@ import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod; import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.bukkit.object.BukkitPlayer; + import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.Bukkit; @@ -37,10 +38,10 @@ public class SendChunk { // // Ref Class private final RefClass classEntityPlayer = getRefClass("{nms}.EntityPlayer"); private final RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk"); - private final RefClass classConnection = getRefClass("{nms}.EntityPlayer.playerConnection"); - private final RefClass classCraftChunk = getRefClass("{cb}.CraftChunk"); - private final RefClass classCraftPlayer = getRefClass("{cb}.CraftPlayer"); - private RefMethod methodGetHandleChunk; + private final RefClass classPacket = getRefClass("{nms}.Packet"); + private final RefClass classConnection = getRefClass("{nms}.PlayerConnection"); + private final RefClass classChunk = getRefClass("{nms}.Chunk"); + private final RefClass classCraftPlayer = getRefClass("{cb}.entity.CraftPlayer"); private RefMethod methodGetHandlePlayer; private RefConstructor MapChunk; private RefField connection; @@ -52,11 +53,10 @@ public class SendChunk { * @throws NoSuchMethodException */ public SendChunk() throws NoSuchMethodException { - methodGetHandleChunk = classCraftChunk.getMethod("getHandle"); methodGetHandlePlayer = classCraftPlayer.getMethod("getHandle"); - MapChunk = classMapChunk.getConstructor(Chunk.class, boolean.class, int.class); - connection = classCraftPlayer.getField("playerConnection"); - send = classConnection.getMethod("sendPacket", classMapChunk.getRealClass()); + MapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class); + connection = classEntityPlayer.getField("playerConnection"); + send = classConnection.getMethod("sendPacket", classPacket.getRealClass()); } public void sendChunk(final Collection input) { diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index 8e5f1ca94..c4a8f0726 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ diff --git a/target/PlotSquared-Sponge.jar b/target/PlotSquared-Sponge.jar index 7d45b74e3..eba5aaf4d 100644 Binary files a/target/PlotSquared-Sponge.jar and b/target/PlotSquared-Sponge.jar differ