diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java index 920b1af9d..69a6891d4 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/Clans.java @@ -53,7 +53,7 @@ import net.minecraft.server.v1_8_R3.MinecraftServer; public class Clans extends JavaPlugin { - public static final String VERSION = "0.18b"; + public static final String VERSION = "0.19"; private String WEB_CONFIG = "webServer"; // Modules diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java index 8442d37b2..55e575561 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ban/commands/ClansBanCommand.java @@ -1,6 +1,5 @@ package mineplex.game.clans.clans.ban.commands; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; import mineplex.core.command.CommandBase; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java index 3de03eadd..bb80a711e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/regions/ClansRegions.java @@ -211,7 +211,7 @@ public class ClansRegions extends MiniPlugin if (_manager.getClaimMap().containsKey(chunkStr)) { - System.out.println("get claim map contains " + chunkStr); // this is really really slowing server startup down. just saying. +// System.out.println("get claim map contains " + chunkStr); // this is really really slowing server startup down. just saying. continue; } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java index 797ec5e35..c591c1aab 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/Gameplay.java @@ -6,6 +6,7 @@ import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.DyeColor; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; @@ -41,6 +42,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.weather.WeatherChangeEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.material.Dye; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; @@ -485,12 +487,32 @@ public class Gameplay extends MiniPlugin } } - if (!Recharge.Instance.use(event.getPlayer(), "Place Sapling", 1000, true, false)) + if (!Recharge.Instance.use(event.getPlayer(), "Place Sapling", 20 * 60 * 1000, true, false)) { event.setCancelled(true); return; } + } + + @EventHandler + public void blockDispenser(BlockDispenseEvent event) + { + // Block bonemeal + if (event.getItem().getType() == Material.INK_SACK && ((Dye) event.getItem().getData()).getColor() == DyeColor.WHITE) + { + event.setCancelled(true); + } + // Block flint-and-steal + if (event.getItem().getType() == Material.FLINT_AND_STEEL) + { + event.setCancelled(true); + } + + if (event.getItem().getType() == Material.FIREWORK_CHARGE) + { + event.setCancelled(true); + } } // @EventHandler(priority = EventPriority.LOWEST) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java index 2286d020f..f07a24ea6 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/SafeLog.java @@ -1,6 +1,8 @@ package mineplex.game.clans.gameplay.safelog; import java.io.File; +import java.util.ArrayList; +import java.util.List; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -49,6 +51,12 @@ public class SafeLog extends MiniPlugin isSafeLog = true; } + if (_flying.contains(player.getName())) + { + _flying.remove(player.getName()); + return; + } + if (!isSafeLog) { NPCManager.getInstance().spawnLogoutNpc(player); @@ -93,6 +101,8 @@ public class SafeLog extends MiniPlugin } } } + + private List _flying = new ArrayList<>(); @EventHandler(priority = EventPriority.LOWEST) public void onPlayerQuit(PlayerQuitEvent event) @@ -101,6 +111,16 @@ public class SafeLog extends MiniPlugin onPlayerQuit(event.getPlayer()); } + + @EventHandler(priority = EventPriority.HIGHEST) + public void flyCheck(PlayerKickEvent event) + { + if (event.getPlayer().getItemInHand() != null && event.getPlayer().getItemInHand().getItemMeta() != null && (C.cGold + "Wind Blade").equals(event.getPlayer().getItemInHand().getItemMeta().getDisplayName())) + if (event.getReason().contains("flying is not enabled")) + return; + + _flying.add(event.getPlayer().getName()); + } @EventHandler(priority = EventPriority.LOWEST) public void onPlayerKicked(PlayerKickEvent event) diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java index f081d1450..451149aad 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/gameplay/safelog/npc/NPCManager.java @@ -211,15 +211,22 @@ public class NPCManager extends MiniPlugin { CombatLogNPC npc = iterator.next(); + if (Bukkit.getPlayer(npc.getPlayerInfo().getPlayerName()) != null) + { + System.out.println("{NPCMANAGER} ORIGINAL PLAYER ALIVE AND DESPAWNING"); + npc.despawn(); + iterator.remove(); + } + if (!npc.isAlive()) { - System.out.println("NOT ALIVE AND REMOVING"); + System.out.println("{NPCMANAGER} NOT ALIVE AND REMOVING"); npc.remove(); iterator.remove(); } else if (npc.getAliveDuation() > COMBAT_LOG_DURATION) { - System.out.println("DESPAWNING"); + System.out.println("{NPCMANAGER} DESPAWNING"); npc.despawn(); iterator.remove(); }