Disabled fireworks for non-gadget enderpearls.

This commit is contained in:
Chiss 2014-08-27 15:24:10 +10:00
parent 9cde497a5c
commit 311711f2f0

View File

@ -1,11 +1,15 @@
package mineplex.core.gadget.gadgets;
import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.EnderPearl;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerTeleportEvent;
@ -50,7 +54,7 @@ public class ItemEtherealPearl extends ItemGadget
EnderPearl pearl = player.launchProjectile(EnderPearl.class);
pearl.setPassenger(player);
//Inform
UtilPlayer.message(player, F.main("Skill", "You threw " + F.skill(GetName()) + "."));
@ -63,6 +67,9 @@ public class ItemEtherealPearl extends ItemGadget
@EventHandler
public void teleportCancel(PlayerTeleportEvent event)
{
if (!IsActive(event.getPlayer()))
return;
if (event.getCause() == TeleportCause.ENDER_PEARL)
{
//Firework