fixed some stuff
This commit is contained in:
parent
090c1f135d
commit
33c96f51ae
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user