titan stuff almost done
This commit is contained in:
parent
963caae719
commit
700cf51206
@ -94,7 +94,7 @@ public class ParticleBlizzard extends ParticleGadget
|
|||||||
if (!event.getPlayer().isFlying())
|
if (!event.getPlayer().isFlying())
|
||||||
if (IsActive(event.getPlayer()))
|
if (IsActive(event.getPlayer()))
|
||||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.6f, 100,
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.6f, 100,
|
||||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
ViewDist.LONGER, UtilServer.getPlayers());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -122,7 +122,7 @@ public class ParticleBlizzard extends ParticleGadget
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getEntity().getLocation(), 0f, 0f, 0f, 0.4f, 12,
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getEntity().getLocation(), 0f, 0f, 0f, 0.4f, 12,
|
||||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
ViewDist.LONGER, UtilServer.getPlayers());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -142,7 +142,7 @@ public class ParticleBlizzard extends ParticleGadget
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0f, 1,
|
UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0f, 1,
|
||||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
ViewDist.LONGER, UtilServer.getPlayers());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,24 @@
|
|||||||
package mineplex.core.gadget.gadgets;
|
package mineplex.core.gadget.gadgets;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
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 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.C;
|
||||||
import mineplex.core.common.util.UtilParticle;
|
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.ParticleType;
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
@ -17,35 +28,38 @@ import mineplex.core.updater.event.UpdateEvent;
|
|||||||
|
|
||||||
public class ParticleTitan extends ParticleGadget
|
public class ParticleTitan extends ParticleGadget
|
||||||
{
|
{
|
||||||
|
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
|
||||||
|
|
||||||
private int _tick;
|
private int _tick;
|
||||||
|
|
||||||
public ParticleTitan(GadgetManager manager)
|
public ParticleTitan(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Titanic Particle", new String[]
|
super(manager, "Flame of the Titans", new String[]
|
||||||
{
|
{
|
||||||
C.cWhite + "Coming Soon...",
|
C.cWhite + "These flames are said to be the",
|
||||||
|
C.cWhite + "souls of an lost civilisation of",
|
||||||
|
C.cWhite + "Titans, forgotten by time.",
|
||||||
" ",
|
" ",
|
||||||
C.cRed + "Unlocked with Titan Rank",
|
C.cRed + "Unlocked with Titan Rank",
|
||||||
},
|
},
|
||||||
// Price for debuging purposes
|
-2,
|
||||||
10,
|
Material.FIREBALL, (byte)0);
|
||||||
Material.INK_SACK, (byte)8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onUpdate(UpdateEvent event)
|
public void onUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.TICK)
|
if (event.getType() != UpdateType.TICK)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
_tick++;
|
_tick++;
|
||||||
_tick = _tick%620;
|
_tick = _tick%620;
|
||||||
|
|
||||||
for(Player player : GetActive())
|
for(Player player : GetActive())
|
||||||
{
|
{
|
||||||
if (!shouldDisplay(player)) continue;
|
if (!shouldDisplay(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
double total = 3;
|
double total = 3;
|
||||||
double step = (1/total)*Math.PI*2;
|
double step = (1/total)*Math.PI*2;
|
||||||
@ -55,7 +69,8 @@ public class ParticleTitan extends ParticleGadget
|
|||||||
double r = 3;
|
double r = 3;
|
||||||
boolean redstone = false;
|
boolean redstone = false;
|
||||||
|
|
||||||
if(Manager.isMoving(player)) r = 0.5;
|
if(Manager.isMoving(player))
|
||||||
|
r = 0.5;
|
||||||
|
|
||||||
for(int i = 0; i < total; i++)
|
for(int i = 0; i < total; i++)
|
||||||
{
|
{
|
||||||
@ -95,4 +110,93 @@ 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)
|
||||||
|
{
|
||||||
|
if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN))
|
||||||
|
{
|
||||||
|
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,11 +31,11 @@ public class MountTitan extends Mount<MountTitanData>
|
|||||||
{
|
{
|
||||||
public MountTitan(MountManager manager)
|
public MountTitan(MountManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Molten Snake", Material.REDSTONE_BLOCK, (byte)0, new String[]
|
super(manager, "Molten Snake", Material.MAGMA_CREAM, (byte)0, new String[]
|
||||||
{
|
{
|
||||||
C.cWhite + "From the distant ether realm,",
|
C.cWhite + "Deep under the earths surface, there",
|
||||||
C.cWhite + "this prized dragon is said to",
|
C.cWhite + "exists a mythical species of Molten",
|
||||||
C.cWhite + "obey only true Heroes!",
|
C.cWhite + "Snakes. This one will serve you eternally.",
|
||||||
" ",
|
" ",
|
||||||
C.cRed + "Unlocked with Titan Rank",
|
C.cRed + "Unlocked with Titan Rank",
|
||||||
}, -1);
|
}, -1);
|
||||||
|
@ -72,7 +72,7 @@ public class MountTitanData
|
|||||||
{
|
{
|
||||||
//Head
|
//Head
|
||||||
if (_head.getPassenger() != null)
|
if (_head.getPassenger() != null)
|
||||||
_head.setVelocity(_head.getPassenger().getLocation().getDirection().multiply(0.5).add(new Vector(0,0.2,0)));
|
_head.setVelocity(_head.getPassenger().getLocation().getDirection().multiply(0.8).add(new Vector(0,0.2,0)));
|
||||||
|
|
||||||
Location infront = _head.getLocation().add(0, -1.5, 0);
|
Location infront = _head.getLocation().add(0, -1.5, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user