gadget restructure
converted frost lord and titan particles into 4 subcategories.
This commit is contained in:
parent
e01d30b920
commit
4a53667539
@ -19,7 +19,7 @@ import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.OutfitTeam;
|
||||
import mineplex.core.gadget.gadgets.outfit.OutfitTeam;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
|
@ -19,8 +19,8 @@ import mineplex.core.cosmetic.ui.button.ActivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.GadgetButton;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.MorphNotch;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphNotch;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
|
@ -15,44 +15,13 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||
import mineplex.core.gadget.gadgets.ItemBatGun;
|
||||
import mineplex.core.gadget.gadgets.ItemCoinBomb;
|
||||
import mineplex.core.gadget.gadgets.ItemDuelingSword;
|
||||
import mineplex.core.gadget.gadgets.ItemEtherealPearl;
|
||||
import mineplex.core.gadget.gadgets.ItemFirework;
|
||||
import mineplex.core.gadget.gadgets.ItemFleshHook;
|
||||
import mineplex.core.gadget.gadgets.ItemMelonLauncher;
|
||||
import mineplex.core.gadget.gadgets.ItemPaintballGun;
|
||||
import mineplex.core.gadget.gadgets.ItemPaintbrush;
|
||||
import mineplex.core.gadget.gadgets.ItemTNT;
|
||||
import mineplex.core.gadget.gadgets.MorphBat;
|
||||
import mineplex.core.gadget.gadgets.MorphBlaze;
|
||||
import mineplex.core.gadget.gadgets.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.MorphBunny;
|
||||
import mineplex.core.gadget.gadgets.MorphChicken;
|
||||
import mineplex.core.gadget.gadgets.MorphCow;
|
||||
import mineplex.core.gadget.gadgets.MorphCreeper;
|
||||
import mineplex.core.gadget.gadgets.MorphEnderman;
|
||||
import mineplex.core.gadget.gadgets.MorphPig;
|
||||
import mineplex.core.gadget.gadgets.MorphPumpkinKing;
|
||||
import mineplex.core.gadget.gadgets.MorphSlime;
|
||||
import mineplex.core.gadget.gadgets.MorphTitan;
|
||||
import mineplex.core.gadget.gadgets.MorphVillager;
|
||||
import mineplex.core.gadget.gadgets.MorphWither;
|
||||
import mineplex.core.gadget.gadgets.OutfitRaveSuit;
|
||||
import mineplex.core.gadget.gadgets.OutfitSpaceSuit;
|
||||
import mineplex.core.gadget.gadgets.OutfitTeam;
|
||||
import mineplex.core.gadget.gadgets.ParticleBlizzard;
|
||||
import mineplex.core.gadget.gadgets.ParticleEnchant;
|
||||
import mineplex.core.gadget.gadgets.ParticleFairy;
|
||||
import mineplex.core.gadget.gadgets.ParticleFireRings;
|
||||
import mineplex.core.gadget.gadgets.ParticleFoot;
|
||||
import mineplex.core.gadget.gadgets.ParticleGreen;
|
||||
import mineplex.core.gadget.gadgets.ParticleHeart;
|
||||
import mineplex.core.gadget.gadgets.ParticleHelix;
|
||||
import mineplex.core.gadget.gadgets.ParticleLegend;
|
||||
import mineplex.core.gadget.gadgets.ParticleRain;
|
||||
import mineplex.core.gadget.gadgets.ParticleTitan;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.*;
|
||||
import mineplex.core.gadget.gadgets.death.*;
|
||||
import mineplex.core.gadget.gadgets.doublejump.*;
|
||||
import mineplex.core.gadget.gadgets.item.*;
|
||||
import mineplex.core.gadget.gadgets.morph.*;
|
||||
import mineplex.core.gadget.gadgets.outfit.*;
|
||||
import mineplex.core.gadget.gadgets.particle.*;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
@ -177,9 +146,21 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new ParticleHeart(this));
|
||||
addGadget(new ParticleFairy(this));
|
||||
addGadget(new ParticleLegend(this));
|
||||
addGadget(new ParticleBlizzard(this));
|
||||
addGadget(new ParticleFrostLord(this));
|
||||
addGadget(new ParticleTitan(this));
|
||||
//addGadget(new ParticleKronos(this));
|
||||
|
||||
// Arrow Trails
|
||||
addGadget(new ArrowTrailFrostLord(this));
|
||||
addGadget(new ArrowTrailTitan(this));
|
||||
|
||||
// Death Effect
|
||||
addGadget(new DeathFrostLord(this));
|
||||
addGadget(new DeathTitan(this));
|
||||
|
||||
// Double Jump
|
||||
addGadget(new DoubleJumpFrostLord(this));
|
||||
addGadget(new DoubleJumpTitan(this));
|
||||
|
||||
|
||||
// Music
|
||||
addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000));
|
||||
|
@ -1,5 +0,0 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
|
||||
public class ItemKothSword {
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package mineplex.core.gadget.gadgets.arrowtrail;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Arrow;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.types.ArrowEffectGadget;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public class ArrowTrailFrostLord extends ArrowEffectGadget
|
||||
{
|
||||
public ArrowTrailFrostLord(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Frost Lord", new String[]
|
||||
{
|
||||
C.cWhite + "You are a mighty frost lord.",
|
||||
C.cWhite + "Your double jumps and arrows",
|
||||
C.cWhite + "are enchanted with snow powers.",
|
||||
" ",
|
||||
C.cPurple + "No longer available",
|
||||
},
|
||||
-1,
|
||||
Material.SNOW_BALL, (byte)0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTrail(Arrow arrow)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0f, 1,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doHitEffect(Arrow arrow)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0.4f, 12,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package mineplex.core.gadget.gadgets.arrowtrail;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.ArrowEffectGadget;
|
||||
|
||||
public class ArrowTrailTitan extends ArrowEffectGadget
|
||||
{
|
||||
public ArrowTrailTitan(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Arrows of the Titans", new String[]
|
||||
{
|
||||
C.cWhite + "These flames are said to be the",
|
||||
C.cWhite + "souls of a lost civilisation of",
|
||||
C.cWhite + "Titans, forgotten by time.",
|
||||
" ",
|
||||
C.cRed + "Unlocked with Titan Rank",
|
||||
},
|
||||
-3,
|
||||
Material.FIREBALL, (byte)0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTrail(Arrow arrow)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.FLAME, arrow.getLocation(), 0f, 0f, 0f, 0f, 1,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doHitEffect(Arrow arrow)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.LAVA, arrow.getLocation(), 0f, 0f, 0f, 0f, 24,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void titanOwner(PlayerJoinEvent event)
|
||||
{
|
||||
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN))
|
||||
{
|
||||
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package mineplex.core.gadget.gadgets.death;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
import mineplex.core.blood.BloodEvent;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gadget.types.DeathEffectGadget;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public class DeathFrostLord extends DeathEffectGadget
|
||||
{
|
||||
public DeathFrostLord(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Frost Lord", new String[]
|
||||
{
|
||||
C.cWhite + "You are a mighty frost lord.",
|
||||
C.cWhite + "Your double jumps and arrows",
|
||||
C.cWhite + "are enchanted with snow powers.",
|
||||
" ",
|
||||
C.cPurple + "No longer available",
|
||||
},
|
||||
-1,
|
||||
Material.SNOW_BALL, (byte)0);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void death(BloodEvent event)
|
||||
{
|
||||
if (event.getPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!IsActive(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
event.setItem(Material.SNOW_BALL, (byte)0);
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package mineplex.core.gadget.gadgets.death;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import mineplex.core.blood.BloodEvent;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.DeathEffectGadget;
|
||||
|
||||
public class DeathTitan extends DeathEffectGadget
|
||||
{
|
||||
public DeathTitan(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Ashes of the Titans", new String[]
|
||||
{
|
||||
C.cWhite + "These flames are said to be the",
|
||||
C.cWhite + "souls of a lost civilisation of",
|
||||
C.cWhite + "Titans, forgotten by time.",
|
||||
" ",
|
||||
C.cRed + "Unlocked with Titan Rank",
|
||||
},
|
||||
-3,
|
||||
Material.FIREBALL, (byte)0);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void death(BloodEvent event)
|
||||
{
|
||||
if (event.getPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!IsActive(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
event.setItem(Material.FIREBALL, (byte)0);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void titanOwner(PlayerJoinEvent event)
|
||||
{
|
||||
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN))
|
||||
{
|
||||
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package mineplex.core.gadget.gadgets.doublejump;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public class DoubleJumpFrostLord extends DoubleJumpEffectGadget
|
||||
{
|
||||
public DoubleJumpFrostLord(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Frost Lord", new String[]
|
||||
{
|
||||
C.cWhite + "You are a mighty frost lord.",
|
||||
C.cWhite + "Your double jumps and arrows",
|
||||
C.cWhite + "are enchanted with snow powers.",
|
||||
" ",
|
||||
C.cPurple + "No longer available",
|
||||
},
|
||||
-1,
|
||||
Material.SNOW_BALL, (byte)0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doEffect(Player player)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation(), 0f, 0f, 0f, 0.6f, 100,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package mineplex.core.gadget.gadgets.doublejump;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
||||
|
||||
public class DoubleJumpTitan extends DoubleJumpEffectGadget
|
||||
{
|
||||
public DoubleJumpTitan(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Leap of the Titans", new String[]
|
||||
{
|
||||
C.cWhite + "These flames are said to be the",
|
||||
C.cWhite + "souls of a lost civilisation of",
|
||||
C.cWhite + "Titans, forgotten by time.",
|
||||
" ",
|
||||
C.cRed + "Unlocked with Titan Rank",
|
||||
},
|
||||
-3,
|
||||
Material.FIREBALL, (byte)0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doEffect(Player player)
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.LAVA, player.getLocation(), 0f, 0f, 0f, 0.2f, 40,
|
||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void jump(PlayerToggleFlightEvent event)
|
||||
{
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().isFlying())
|
||||
if (IsActive(event.getPlayer()))
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.LAVA, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.2f, 40,
|
||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void titanOwner(PlayerJoinEvent event)
|
||||
{
|
||||
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN))
|
||||
{
|
||||
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -7,6 +7,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@ -24,6 +24,7 @@ import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.Material;
|
||||
@ -16,6 +16,7 @@ import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.projectile.IThrown;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -36,6 +36,7 @@ import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
@ -0,0 +1,5 @@
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
public class ItemKothSword {
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@ -25,6 +25,7 @@ import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.projectile.IThrown;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@ -29,6 +29,7 @@ import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.event.GadgetBlockEvent;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.item;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -20,6 +20,7 @@ import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.gadgets.Ammo;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.GameMode;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.EntityEffect;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.outfit;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.outfit;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.outfit;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilMath;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -24,11 +24,11 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public class ParticleBlizzard extends ParticleGadget
|
||||
public class ParticleFrostLord extends ParticleGadget
|
||||
{
|
||||
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
|
||||
|
||||
public ParticleBlizzard(GadgetManager manager)
|
||||
public ParticleFrostLord(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Frost Lord", new String[]
|
||||
{
|
||||
@ -84,81 +84,4 @@ public class ParticleBlizzard extends ParticleGadget
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void jump(PlayerToggleFlightEvent event)
|
||||
{
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().isFlying())
|
||||
if (IsActive(event.getPlayer()))
|
||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.6f, 100,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrow(ProjectileLaunchEvent event)
|
||||
{
|
||||
if (Manager.hideParticles())
|
||||
return;
|
||||
|
||||
if (event.getEntity() instanceof Arrow)
|
||||
{
|
||||
if (event.getEntity().getShooter() != null)
|
||||
{
|
||||
if (GetActive().contains(event.getEntity().getShooter()))
|
||||
{
|
||||
_arrows.add((Arrow)event.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrow(ProjectileHitEvent event)
|
||||
{
|
||||
if (!_arrows.remove(event.getEntity()))
|
||||
return;
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getEntity().getLocation(), 0f, 0f, 0f, 0.4f, 12,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrowClean(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Iterator<Arrow> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
|
||||
{
|
||||
Arrow arrow = arrowIterator.next();
|
||||
|
||||
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
|
||||
{
|
||||
arrowIterator.remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0f, 1,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void death(BloodEvent event)
|
||||
{
|
||||
if (event.getPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!IsActive(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
event.setItem(Material.SNOW_BALL, (byte)0);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
@ -1,24 +1,15 @@
|
||||
package mineplex.core.gadget.gadgets;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
package mineplex.core.gadget.gadgets.particle;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.blood.BloodEvent;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
@ -28,7 +19,6 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
public class ParticleTitan extends ParticleGadget
|
||||
{
|
||||
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
|
||||
|
||||
private int _tick;
|
||||
|
||||
@ -112,87 +102,7 @@ public class ParticleTitan extends ParticleGadget
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void jump(PlayerToggleFlightEvent event)
|
||||
{
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().isFlying())
|
||||
if (IsActive(event.getPlayer()))
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.LAVA, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.2f, 40,
|
||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrow(ProjectileLaunchEvent event)
|
||||
{
|
||||
if (Manager.hideParticles())
|
||||
return;
|
||||
|
||||
if (event.getEntity() instanceof Arrow)
|
||||
{
|
||||
if (event.getEntity().getShooter() != null)
|
||||
{
|
||||
if (GetActive().contains(event.getEntity().getShooter()))
|
||||
{
|
||||
_arrows.add((Arrow)event.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrow(ProjectileHitEvent event)
|
||||
{
|
||||
if (!_arrows.remove(event.getEntity()))
|
||||
return;
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.LAVA, event.getEntity().getLocation(), 0f, 0f, 0f, 0f, 24,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrowClean(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Iterator<Arrow> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
|
||||
{
|
||||
Arrow arrow = arrowIterator.next();
|
||||
|
||||
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
|
||||
{
|
||||
arrowIterator.remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilParticle.PlayParticle(ParticleType.FLAME, arrow.getLocation(), 0f, 0f, 0f, 0f, 1,
|
||||
ViewDist.LONGER, UtilServer.getPlayers());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void death(BloodEvent event)
|
||||
{
|
||||
if (event.getPlayer() == null)
|
||||
return;
|
||||
|
||||
if (!IsActive(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
event.setItem(Material.FIREBALL, (byte)0);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void legendOwner(PlayerJoinEvent event)
|
||||
public void titanOwner(PlayerJoinEvent event)
|
||||
{
|
||||
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN))
|
||||
{
|
@ -0,0 +1,110 @@
|
||||
package mineplex.core.gadget.types;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
public abstract class ArrowEffectGadget extends Gadget
|
||||
{
|
||||
protected HashSet<Arrow> _arrows = new HashSet<Arrow>();
|
||||
|
||||
public ArrowEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data)
|
||||
{
|
||||
super(manager, GadgetType.ArrowTrail, name, desc, cost, mat, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EnableCustom(Player player)
|
||||
{
|
||||
Manager.RemoveParticle(player);
|
||||
|
||||
_active.add(player);
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(GetName()) + "."));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisableCustom(Player player)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(GetName()) + "."));
|
||||
}
|
||||
|
||||
public boolean shouldDisplay(Player player)
|
||||
{
|
||||
if (UtilPlayer.isSpectator(player))
|
||||
return false;
|
||||
|
||||
if (Manager.hideParticles())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrowLaunch(ProjectileLaunchEvent event)
|
||||
{
|
||||
if (Manager.hideParticles())
|
||||
return;
|
||||
|
||||
if (event.getEntity() instanceof Arrow)
|
||||
{
|
||||
if (event.getEntity().getShooter() != null)
|
||||
{
|
||||
if (GetActive().contains(event.getEntity().getShooter()))
|
||||
{
|
||||
_arrows.add((Arrow)event.getEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void clean(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Iterator<Arrow> arrowIterator = _arrows.iterator(); arrowIterator.hasNext();)
|
||||
{
|
||||
Arrow arrow = arrowIterator.next();
|
||||
|
||||
if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround())
|
||||
{
|
||||
arrowIterator.remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
doTrail(arrow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arrowHit(ProjectileHitEvent event)
|
||||
{
|
||||
if (!_arrows.remove(event.getEntity()))
|
||||
return;
|
||||
|
||||
doHitEffect((Arrow)event.getEntity());
|
||||
}
|
||||
|
||||
public abstract void doTrail(Arrow arrow);
|
||||
public abstract void doHitEffect(Arrow arrow);
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package mineplex.core.gadget.types;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public abstract class DeathEffectGadget extends Gadget
|
||||
{
|
||||
public DeathEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data)
|
||||
{
|
||||
super(manager, GadgetType.Death, name, desc, cost, mat, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EnableCustom(Player player)
|
||||
{
|
||||
Manager.RemoveParticle(player);
|
||||
|
||||
_active.add(player);
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(GetName()) + "."));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisableCustom(Player player)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(GetName()) + "."));
|
||||
}
|
||||
|
||||
public boolean shouldDisplay(Player player)
|
||||
{
|
||||
if (UtilPlayer.isSpectator(player))
|
||||
return false;
|
||||
|
||||
if (Manager.hideParticles())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package mineplex.core.gadget.types;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
|
||||
public abstract class DoubleJumpEffectGadget extends Gadget
|
||||
{
|
||||
public DoubleJumpEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data)
|
||||
{
|
||||
super(manager, GadgetType.DoubleJump, name, desc, cost, mat, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EnableCustom(Player player)
|
||||
{
|
||||
Manager.RemoveParticle(player);
|
||||
|
||||
_active.add(player);
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(GetName()) + "."));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void DisableCustom(Player player)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(GetName()) + "."));
|
||||
}
|
||||
|
||||
public boolean shouldDisplay(Player player)
|
||||
{
|
||||
if (UtilPlayer.isSpectator(player))
|
||||
return false;
|
||||
|
||||
if (Manager.hideParticles())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void jump(PlayerToggleFlightEvent event)
|
||||
{
|
||||
if (!shouldDisplay(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().isFlying())
|
||||
if (IsActive(event.getPlayer()))
|
||||
{
|
||||
doEffect(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void doEffect(Player player);
|
||||
}
|
@ -7,4 +7,7 @@ public enum GadgetType
|
||||
Particle,
|
||||
MusicDisc,
|
||||
Costume,
|
||||
DoubleJump,
|
||||
ArrowTrail,
|
||||
Death
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.event.GadgetActivateEvent;
|
||||
import mineplex.core.gadget.gadgets.ItemDuelingSword;
|
||||
import mineplex.core.gadget.gadgets.OutfitTeam;
|
||||
import mineplex.core.gadget.gadgets.item.ItemDuelingSword;
|
||||
import mineplex.core.gadget.gadgets.outfit.OutfitTeam;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.mount.event.MountActivateEvent;
|
||||
|
@ -15,7 +15,7 @@ import mineplex.core.common.util.UtilTextTop;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||
import mineplex.core.gadget.gadgets.MorphWither;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphWither;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.mount.Mount;
|
||||
|
@ -42,7 +42,7 @@ import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.event.GadgetActivateEvent;
|
||||
import mineplex.core.gadget.gadgets.OutfitTeam;
|
||||
import mineplex.core.gadget.gadgets.outfit.OutfitTeam;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.mount.event.MountActivateEvent;
|
||||
|
@ -28,7 +28,7 @@ import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.event.StackerEvent;
|
||||
import mineplex.core.gadget.gadgets.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.projectile.IThrown;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
|
@ -20,7 +20,7 @@ import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.creature.event.CreatureKillEntitiesEvent;
|
||||
import mineplex.core.event.StackerEvent;
|
||||
import mineplex.core.gadget.gadgets.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.give.Give;
|
||||
|
@ -16,7 +16,7 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseLiving;
|
||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||
import mineplex.core.gadget.gadgets.MorphWither;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphWither;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||
|
Loading…
Reference in New Issue
Block a user