diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemFirework.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemFirework.java index 9e90fa440..203432bad 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemFirework.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemFirework.java @@ -2,13 +2,16 @@ package mineplex.hub.gadget.gadgets; import org.bukkit.Color; import org.bukkit.FireworkEffect; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.FireworkEffect.Type; +import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilPlayer; import mineplex.hub.gadget.GadgetManager; @@ -44,6 +47,18 @@ public class ItemFirework extends ItemGadget @Override public void ActivateCustom(Player player) { + Location loc = player.getEyeLocation().add(player.getLocation().getDirection()); + + //Portal Disallow + for (Block block : UtilBlock.getSurrounding(loc.getBlock(), true)) + { + if (block.getTypeId() == 90) + { + UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " near Portals.")); + return; + } + } + //Inform UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); @@ -66,7 +81,7 @@ public class ItemFirework extends ItemGadget if (r > 0.66) type = Type.BALL; else if (r > 0.33) type = Type.BALL_LARGE; - UtilFirework.launchFirework(player.getEyeLocation().add(player.getLocation().getDirection()), + UtilFirework.launchFirework(loc, FireworkEffect.builder().flicker(Math.random() > 0.5).withColor(color).with(type).trail(Math.random() > 0.5).build(), new Vector(0,0,0), 0 + (int)(Math.random()*3)); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemPaintballGun.java b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemPaintballGun.java index 621363f5a..2db9c5b74 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemPaintballGun.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/gadget/gadgets/ItemPaintballGun.java @@ -36,7 +36,7 @@ public class ItemPaintballGun extends ItemGadget }, -1, Material.GOLD_BARDING, (byte)0, - 500, 2, false); + 200, 2, false); } @Override diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index c0fcc0af2..e207f7190 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -16,6 +16,7 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Sound; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -125,7 +126,9 @@ public class ServerManager extends MiniPlugin { if (!(event.getEntity() instanceof Player)) { - UtilAction.velocity(event.getEntity(), UtilAlg.getTrajectory(event.getEntity().getLocation(), _hubManager.GetSpawn()), 1, true, 0.8, 0, 1, true); + if (event.getEntity() instanceof LivingEntity) + UtilAction.velocity(event.getEntity(), UtilAlg.getTrajectory(event.getEntity().getLocation(), _hubManager.GetSpawn()), 1, true, 0.8, 0, 1, true); + return; }