diff --git a/Plugins/Mineplex.Core/src/mineplex/core/NCPDataManFix.java b/Plugins/Mineplex.Core/src/mineplex/core/NCPDataManFix.java index 3ddbb0f50..c531ad097 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/NCPDataManFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/NCPDataManFix.java @@ -5,6 +5,6 @@ import fr.neatmonster.nocheatplus.config.ConfigManager; public class NCPDataManFix { public NCPDataManFix() { - ConfigManager.getConfigFile().set("data.consistencychecks.suppresswarnings", true); + //ConfigManager.getConfigFile().set("data.consistencychecks.suppresswarnings", true); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintbrush.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintbrush.java index 92c03c83c..e48eba5f7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintbrush.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintbrush.java @@ -9,7 +9,10 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.entity.Player; +import org.bukkit.entity.Villager; import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityInteractEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; @@ -37,6 +40,8 @@ public class ItemPaintbrush extends ItemGadget super(manager, "Paintbrush", new String[] { C.cWhite + "Unleash your inner creativity!", + C.cWhite + "", + C.cWhite + "Click a Painter NPC to equip this.", }, -2, Material.WOOD_SWORD, (byte)0, @@ -157,23 +162,20 @@ public class ItemPaintbrush extends ItemGadget } } - //XXX TODO ENABLE - @EventHandler - public void enableInteract(PlayerInteractEvent event) + public void enableInteract(PlayerInteractEntityEvent event) { if (IsActive(event.getPlayer())) return; - - if (!UtilEvent.isAction(event, ActionType.L)) - return; - - Player player = event.getPlayer(); - - Block block = player.getTargetBlock(null, 100); - if (block == null || block.getType() != Material.STAINED_CLAY) + + if (!(event.getRightClicked() instanceof Villager)) return; - Enable(event.getPlayer()); + Villager villager = (Villager)event.getRightClicked(); + + if (villager.getCustomName() != null && villager.getCustomName().contains("Painter")) + { + Enable(event.getPlayer()); + } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitTeam.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitTeam.java index 10102b0e9..ce734cd57 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitTeam.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitTeam.java @@ -14,7 +14,9 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.LeatherArmorMeta; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.OutfitGadget; @@ -58,16 +60,29 @@ public class OutfitTeam extends OutfitGadget //Color if (args[1].equals("red")) + { _colorSetting.put(player.getName(), Color.RED); + + UtilPlayer.message(player, F.main("Gadget", "You equipped " + F.elem(C.cRed + "Red Team Outfit") + "!")); + } else if (args[1].equals("yellow")) + { _colorSetting.put(player.getName(), Color.YELLOW); + UtilPlayer.message(player, F.main("Gadget", "You equipped " + F.elem(C.cRed + "Yellow Team Outfit") + "!")); + } else if (args[1].equals("green")) - _colorSetting.put(player.getName(), Color.GREEN); + { + _colorSetting.put(player.getName(), Color.LIME); + UtilPlayer.message(player, F.main("Gadget", "You equipped " + F.elem(C.cGreen + "Green Team Outfit") + "!")); + } else if (args[1].equals("blue")) + { _colorSetting.put(player.getName(), Color.AQUA); + UtilPlayer.message(player, F.main("Gadget", "You equipped " + F.elem(C.cRed + "Blue Team Outfit") + "!")); + } colorArmor(player); - + Enable(player); } @@ -75,7 +90,7 @@ public class OutfitTeam extends OutfitGadget { if (!_colorSetting.containsKey(player.getName())) return; - + //Get Item ItemStack stack; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java index 9af84b8fa..8ab5599c1 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java @@ -22,6 +22,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.inventory.InventoryOpenEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; @@ -182,8 +183,8 @@ public class SoccerManager extends MiniPlugin //Kick for (Player player : _active) { - if (UtilMath.offset(player, _ball) < 1.25 || - UtilMath.offset(player.getEyeLocation(), _ball.getLocation()) < 1) + if (UtilMath.offset(player, _ball) < 1.5 || + UtilMath.offset(player.getEyeLocation(), _ball.getLocation()) < 1.25) { if (Recharge.Instance.use(player, "Football Kick", 600, false, false)) { @@ -388,9 +389,9 @@ public class SoccerManager extends MiniPlugin if (inPlayerArena(player)) { Color color = getTeamColor(player); - + //Join - if (color != null && (color == Color.RED || color == Color.AQUA)) + if (color != null && (color == Color.RED || color == Color.AQUA) && _active.size() < 8) { setSoccerMode(player, true, color); } @@ -408,8 +409,16 @@ public class SoccerManager extends MiniPlugin if (Recharge.Instance.use(player, "Soccer Eject", 5000, false, false)) { - UtilPlayer.message(player, F.main("Football", "You must be wearing Red/Blue Team Outfit.")); - UtilPlayer.message(player, F.main("Football", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!")); + if (_active.size() >= 8) + { + UtilPlayer.message(player, F.main("Football", "You must be wearing Red/Blue Team Outfit.")); + UtilPlayer.message(player, F.main("Football", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!")); + } + else + { + UtilPlayer.message(player, F.main("Football", "You must be wearing Red/Blue Team Outfit.")); + UtilPlayer.message(player, F.main("Football", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!")); + } } } } @@ -463,6 +472,13 @@ public class SoccerManager extends MiniPlugin if (isSoccerMode(event.getPlayer())) event.setCancelled(true); } + + @EventHandler(priority = EventPriority.LOWEST) + public void playerGrabSlime(PlayerInteractEntityEvent event) + { + if (_active.contains(event.getPlayer())) + event.setCancelled(true); + } @EventHandler public void playerQuit(PlayerQuitEvent event) diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java index ed767a133..8e9b39b59 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/MapParser.java @@ -719,4 +719,17 @@ public class MapParser extends JavaPlugin implements Listener return blocks; } + + @EventHandler(priority = EventPriority.LOWEST) + public void leaptest(PlayerInteractEvent event) + { + + if (event.getPlayer().getItemInHand() == null) + return; + + if (event.getPlayer().getItemInHand().getType() != Material.FEATHER) + return; + + event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().multiply(1.2)); + } }