Merge branch 'rankdescriptions' of http://184.154.0.242:7990/scm/min/mineplex
This commit is contained in:
commit
e81aa72c7e
BIN
Art/MS SMoke.psd
Normal file
BIN
Art/MS SMoke.psd
Normal file
Binary file not shown.
47
Patches/Bukkit-Patches/0031-EntityDismountEvent.patch
Normal file
47
Patches/Bukkit-Patches/0031-EntityDismountEvent.patch
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
From c6e51ae8ffc31d0fc059d33ca159df31c2b7a83e Mon Sep 17 00:00:00 2001
|
||||||
|
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||||
|
Date: Sun, 22 Nov 2015 14:37:11 +1300
|
||||||
|
Subject: [PATCH] EntityDismountEvent
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
||||||
|
index 24d4942..02943d6 100644
|
||||||
|
--- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
||||||
|
+++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java
|
||||||
|
@@ -2,13 +2,14 @@ package org.spigotmc.event.entity;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
+import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.entity.EntityEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity stops riding another entity.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
-public class EntityDismountEvent extends EntityEvent
|
||||||
|
+public class EntityDismountEvent extends EntityEvent implements Cancellable
|
||||||
|
{
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
@@ -36,4 +37,17 @@ public class EntityDismountEvent extends EntityEvent
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isCancelled()
|
||||||
|
+ {
|
||||||
|
+ return cancelled;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public void setCancelled(boolean cancel)
|
||||||
|
+ {
|
||||||
|
+ this.cancelled = cancel;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.9.5.msysgit.0
|
||||||
|
|
@ -0,0 +1,159 @@
|
|||||||
|
From bc86c3b02f2efa4c1194fc908e8d1ee8723f62c5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||||
|
Date: Sun, 22 Nov 2015 14:41:11 +1300
|
||||||
|
Subject: [PATCH] EntityDismountEvent & teleport crash fix
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
index 81ca499..7165579 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||||
|
@@ -23,6 +23,8 @@ import org.bukkit.event.painting.PaintingBreakByEntityEvent;
|
||||||
|
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
|
||||||
|
import org.bukkit.event.vehicle.VehicleEnterEvent;
|
||||||
|
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||||
|
+import org.spigotmc.event.entity.EntityDismountEvent;
|
||||||
|
+import org.spigotmc.event.entity.EntityMountEvent;
|
||||||
|
import org.bukkit.craftbukkit.CraftWorld;
|
||||||
|
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||||
|
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||||
|
@@ -1591,7 +1593,12 @@ public abstract class Entity implements ICommandListener {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
- pluginManager.callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot
|
||||||
|
+ EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(this.getBukkitEntity(), this.vehicle.getBukkitEntity());
|
||||||
|
+ pluginManager.callEvent(event); // Spigot
|
||||||
|
+
|
||||||
|
+ if (event.isCancelled() || vehicle != originalVehicle) {
|
||||||
|
+ return;
|
||||||
|
+ } // Spigot
|
||||||
|
this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
||||||
|
this.vehicle.passenger = null;
|
||||||
|
}
|
||||||
|
@@ -1599,44 +1606,45 @@ public abstract class Entity implements ICommandListener {
|
||||||
|
this.vehicle = null;
|
||||||
|
} else {
|
||||||
|
// CraftBukkit start
|
||||||
|
- if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle) && entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, true)) {
|
||||||
|
+ if (entity.world.isChunkLoaded((int) entity.locX >> 4, (int) entity.locZ >> 4, true)) {
|
||||||
|
// It's possible to move from one vehicle to another. We need to check if they're already in a vehicle, and fire an exit event if they are.
|
||||||
|
VehicleExitEvent exitEvent = null;
|
||||||
|
+ EntityDismountEvent exitEvent1 = null;
|
||||||
|
if (this.vehicle != null) {
|
||||||
|
- exitEvent = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
|
||||||
|
+ if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle))
|
||||||
|
+ exitEvent = new VehicleExitEvent((Vehicle) this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
|
||||||
|
pluginManager.callEvent(exitEvent);
|
||||||
|
|
||||||
|
if (exitEvent.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ exitEvent1 = new EntityDismountEvent(this.vehicle.getBukkitEntity(), this.bukkitEntity);
|
||||||
|
+
|
||||||
|
+ pluginManager.callEvent(exitEvent1);
|
||||||
|
+
|
||||||
|
+ if (exitEvent1.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
- VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.bukkitEntity);
|
||||||
|
- pluginManager.callEvent(event);
|
||||||
|
+ if ((this.bukkitEntity instanceof LivingEntity) && (entity.getBukkitEntity() instanceof Vehicle)) {
|
||||||
|
+ VehicleEnterEvent event = new VehicleEnterEvent((Vehicle) entity.getBukkitEntity(), this.bukkitEntity);
|
||||||
|
+ pluginManager.callEvent(event);
|
||||||
|
|
||||||
|
- // If a plugin messes with the vehicle or the vehicle's passenger
|
||||||
|
- if (event.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||||
|
- // If we only cancelled the enterevent then we need to put the player in a decent position.
|
||||||
|
- if (exitEvent != null && this.vehicle == originalVehicle && this.vehicle != null && this.vehicle.passenger == originalPassenger) {
|
||||||
|
- this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
||||||
|
- this.vehicle.passenger = null;
|
||||||
|
- this.vehicle = null;
|
||||||
|
+ // If a plugin messes with the vehicle or the vehicle's passenger
|
||||||
|
+ if (event.isCancelled() || this.vehicle != originalVehicle || (this.vehicle != null && this.vehicle.passenger != originalPassenger)) {
|
||||||
|
+ // If we only cancelled the enterevent then we need to put the player in a decent position.
|
||||||
|
+ if (exitEvent != null && this.vehicle == originalVehicle && this.vehicle != null && this.vehicle.passenger == originalPassenger) {
|
||||||
|
+ this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
|
||||||
|
+ this.vehicle.passenger = null;
|
||||||
|
+ this.vehicle = null;
|
||||||
|
+ }
|
||||||
|
+ return;
|
||||||
|
}
|
||||||
|
- return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
- // Spigot Start
|
||||||
|
- if ( entity.world.isChunkLoaded( (int) entity.locX >> 4, (int) entity.locZ >> 4, true ) )
|
||||||
|
- {
|
||||||
|
- org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent( this.getBukkitEntity(), entity.getBukkitEntity() );
|
||||||
|
- pluginManager.callEvent( event );
|
||||||
|
- if ( event.isCancelled() )
|
||||||
|
- {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- // Spigot End
|
||||||
|
|
||||||
|
if (this.vehicle != null) {
|
||||||
|
this.vehicle.passenger = null;
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
index b861dbe..96b3905 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
@@ -21,6 +21,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageModifier;
|
||||||
|
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||||
|
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||||
|
+import org.spigotmc.event.entity.EntityDismountEvent;
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
|
import org.bukkit.craftbukkit.SpigotTimings; // Spigot
|
||||||
|
@@ -1725,8 +1726,15 @@ public abstract class EntityLiving extends Entity {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ EntityDismountEvent event = new EntityDismountEvent(this.vehicle.getBukkitEntity(), (LivingEntity) this.bukkitEntity);
|
||||||
|
+ getBukkitEntity().getServer().getPluginManager().callEvent(event);
|
||||||
|
+
|
||||||
|
+ if (event.isCancelled() || vehicle != originalVehicle) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
// CraftBukkit end
|
||||||
|
-
|
||||||
|
+
|
||||||
|
if (!this.world.isClientSide) {
|
||||||
|
this.q(this.vehicle);
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
|
index efbf1a8..dbc7b54 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
|
@@ -1,6 +1,7 @@
|
||||||
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
|
+import com.google.common.primitives.Doubles;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
@@ -234,6 +235,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
|
// If this entity is riding another entity, we must dismount before teleporting.
|
||||||
|
entity.mount(null);
|
||||||
|
|
||||||
|
+ if (!Doubles.isFinite(location.getX()) || !Doubles.isFinite(location.getY()) || !Doubles.isFinite(location.getZ()))
|
||||||
|
+ {
|
||||||
|
+ Thread.dumpStack();
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
// Spigot start
|
||||||
|
if (!location.getWorld().equals(getWorld())) {
|
||||||
|
entity.teleportTo(location, cause.equals(TeleportCause.NETHER_PORTAL));
|
||||||
|
--
|
||||||
|
1.9.5.msysgit.0
|
||||||
|
|
Binary file not shown.
@ -38,9 +38,8 @@ public class PlayerTracker implements Listener, Runnable
|
|||||||
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
|
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
|
||||||
_plugin.getProxy().getScheduler().schedule(_plugin, this, 1L, 1L, TimeUnit.MINUTES);
|
_plugin.getProxy().getScheduler().schedule(_plugin, this, 1L, 1L, TimeUnit.MINUTES);
|
||||||
|
|
||||||
Region region = !new File("eu.dat").exists() ? Region.US : Region.EU;
|
|
||||||
_repository = new RedisDataRepository<PlayerStatus>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
|
_repository = new RedisDataRepository<PlayerStatus>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
|
||||||
region, PlayerStatus.class, "playerStatus");
|
Region.currentRegion(), PlayerStatus.class, "playerStatus");
|
||||||
|
|
||||||
ServerCommandManager.getInstance().registerCommandType("PlayerJoinCommand", mineplex.serverdata.commands.PlayerJoinCommand.class, new PlayerJoinHandler(this));
|
ServerCommandManager.getInstance().registerCommandType("PlayerJoinCommand", mineplex.serverdata.commands.PlayerJoinCommand.class, new PlayerJoinHandler(this));
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.EulerAngle;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class UtilAlg
|
public class UtilAlg
|
||||||
@ -439,4 +440,9 @@ public class UtilAlg
|
|||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EulerAngle vectorToEuler(Vector vector)
|
||||||
|
{
|
||||||
|
return new EulerAngle(Math.toRadians(GetPitch(vector)), Math.toRadians(GetYaw(vector)), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -624,4 +624,30 @@ public class UtilBlock
|
|||||||
return block.getTypeId();
|
return block.getTypeId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HashSet<Block> findConnectedBlocks(Block block, HashSet<Block> blocks, int limit)
|
||||||
|
{
|
||||||
|
if (blocks == null)
|
||||||
|
blocks = new HashSet<Block>();
|
||||||
|
|
||||||
|
//This is incase you recursively check an entire MC world
|
||||||
|
if (blocks.size() >= limit)
|
||||||
|
return blocks;
|
||||||
|
|
||||||
|
//Mark current node as searched
|
||||||
|
blocks.add(block);
|
||||||
|
|
||||||
|
//Search the node
|
||||||
|
for (Block neighbour : UtilBlock.getSurrounding(block, false))
|
||||||
|
{
|
||||||
|
if (neighbour.getType() == Material.AIR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//If neighbour hasn't been searched, recursively search it!
|
||||||
|
if (!blocks.contains(neighbour))
|
||||||
|
findConnectedBlocks(neighbour, blocks, limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
return blocks;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||||
@ -291,6 +290,8 @@ public class UtilEnt
|
|||||||
creatureMap.put("WitherSkull", EntityType.WITHER_SKULL);
|
creatureMap.put("WitherSkull", EntityType.WITHER_SKULL);
|
||||||
creatureMap.put("Wolf", EntityType.WOLF);
|
creatureMap.put("Wolf", EntityType.WOLF);
|
||||||
creatureMap.put("Zombie", EntityType.ZOMBIE);
|
creatureMap.put("Zombie", EntityType.ZOMBIE);
|
||||||
|
creatureMap.put("Guardian", EntityType.GUARDIAN);
|
||||||
|
creatureMap.put("Rabbit", EntityType.RABBIT);
|
||||||
|
|
||||||
creatureMap.put("Item", EntityType.DROPPED_ITEM);
|
creatureMap.put("Item", EntityType.DROPPED_ITEM);
|
||||||
}
|
}
|
||||||
@ -457,6 +458,28 @@ public class UtilEnt
|
|||||||
return ents;
|
return ents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static HashMap<Entity, Double> getAllInRadius(Location loc, double dR)
|
||||||
|
{
|
||||||
|
HashMap<Entity, Double> ents = new HashMap<Entity, Double>();
|
||||||
|
|
||||||
|
for (Entity cur : loc.getWorld().getEntities())
|
||||||
|
{
|
||||||
|
if (UtilPlayer.isSpectator(cur))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Loc
|
||||||
|
double offset = UtilMath.offset(loc, cur.getLocation());
|
||||||
|
|
||||||
|
if (offset < dR)
|
||||||
|
{
|
||||||
|
ents.put(cur, 1 - (offset/dR));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ents;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean hitBox(Location loc, LivingEntity ent, double mult, EntityType disguise)
|
public static boolean hitBox(Location loc, LivingEntity ent, double mult, EntityType disguise)
|
||||||
{
|
{
|
||||||
if (disguise != null)
|
if (disguise != null)
|
||||||
@ -480,7 +503,7 @@ public class UtilEnt
|
|||||||
}
|
}
|
||||||
else if (UtilMath.offset2d(loc, player.getLocation()) < 0.6 * mult)
|
else if (UtilMath.offset2d(loc, player.getLocation()) < 0.6 * mult)
|
||||||
{
|
{
|
||||||
if (loc.getY() > player.getLocation().getY() && loc.getY() < player.getEyeLocation().getY())
|
if (loc.getY() >= player.getLocation().getY() - 0.2*mult && loc.getY() <= player.getEyeLocation().getY() + 0.2*mult)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -616,6 +639,11 @@ public class UtilEnt
|
|||||||
return CreatureLook(ent, UtilAlg.GetPitch(vec), UtilAlg.GetYaw(vec));
|
return CreatureLook(ent, UtilAlg.GetPitch(vec), UtilAlg.GetYaw(vec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean CreatureLook(Entity ent, Vector target)
|
||||||
|
{
|
||||||
|
return CreatureLook(ent, UtilAlg.GetPitch(target), UtilAlg.GetYaw(target));
|
||||||
|
}
|
||||||
|
|
||||||
public static void setFakeHead(Entity ent, boolean fakeHead)
|
public static void setFakeHead(Entity ent, boolean fakeHead)
|
||||||
{
|
{
|
||||||
net.minecraft.server.v1_8_R3.Entity ec = ((CraftEntity) ent).getHandle();
|
net.minecraft.server.v1_8_R3.Entity ec = ((CraftEntity) ent).getHandle();
|
||||||
|
@ -28,13 +28,6 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
|||||||
@Override
|
@Override
|
||||||
public void Execute(final Player caller, String[] args)
|
public void Execute(final Player caller, String[] args)
|
||||||
{
|
{
|
||||||
if (!Plugin.Get(caller).GetRank(true).has(caller, Rank.ADMIN, true))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean testServer = Plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
|
||||||
|
|
||||||
if (args == null)
|
if (args == null)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
|
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
|
||||||
@ -62,14 +55,6 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
|||||||
|
|
||||||
final Rank rank = tempRank;
|
final Rank rank = tempRank;
|
||||||
|
|
||||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.SUPPORT)
|
|
||||||
{
|
|
||||||
if (!testServer && rank.has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
|
||||||
{
|
|
||||||
UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Insufficient privileges!"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
|
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
|
||||||
{
|
{
|
||||||
public void run(List<String> matches)
|
public void run(List<String> matches)
|
||||||
@ -136,5 +121,4 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
|||||||
}, playerName);
|
}, playerName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -277,7 +277,7 @@ public enum Achievement
|
|||||||
|
|
||||||
//Champions
|
//Champions
|
||||||
CHAMPIONS_WINS("Champion", 600,
|
CHAMPIONS_WINS("Champion", 600,
|
||||||
new String[]{"Champions Domination.Wins", "Champions TDM.Wins", "Champions Capture the Flag.Wins"},
|
new String[]{"Champions Domination.Wins", "Champions TDM.Wins", "Champions CTF.Wins"},
|
||||||
new String[]{"Win 80 games of Dominate, TDM, or CTF"},
|
new String[]{"Win 80 games of Dominate, TDM, or CTF"},
|
||||||
new int[]{80},
|
new int[]{80},
|
||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
@ -295,41 +295,47 @@ public enum Achievement
|
|||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
CHAMPIONS_ASSASSINATION("Assassination", 1000,
|
CHAMPIONS_ASSASSINATION("Assassination", 1000,
|
||||||
new String[]{"Champions Domination.Assassination", "Champions TDM.Assassination", "Champions Capture the Flag.Assassination"},
|
new String[]{"Champions Domination.Assassination", "Champions TDM.Assassination", "Champions CTF.Assassination"},
|
||||||
new String[]{"Kill 40 players with Backstab without", "taking any damage from them"},
|
new String[]{"Kill 40 players with Backstab without", "taking any damage from them"},
|
||||||
new int[]{40},
|
new int[]{40},
|
||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
CHAMPIONS_MASS_ELECTROCUTION("Mass Electrocution", 1200,
|
CHAMPIONS_MASS_ELECTROCUTION("Mass Electrocution", 1200,
|
||||||
new String[]{"Champions Domination.MassElectrocution", "Champions TDM.MassElectrocution", "Champions Capture the Flag.MassElectrocution"},
|
new String[]{"Champions Domination.MassElectrocution", "Champions TDM.MassElectrocution", "Champions CTF.MassElectrocution"},
|
||||||
new String[]{"Hit 4 enemies with a Lightning Orb"},
|
new String[]{"Hit 4 enemies with a Lightning Orb"},
|
||||||
new int[]{1},
|
new int[]{1},
|
||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
CHAMPIONS_THE_LONGEST_SHOT("The Longest Shot", 1200,
|
CHAMPIONS_THE_LONGEST_SHOT("The Longest Shot", 1200,
|
||||||
new String[]{"Champions Domination.TheLongestShot", "Champions TDM.TheLongestShot", "Champions Capture the Flag.TheLongestShot"},
|
new String[]{"Champions Domination.TheLongestShot", "Champions TDM.TheLongestShot", "Champions CTF.TheLongestShot"},
|
||||||
new String[]{"Kill someone using Longshot who", "is over 64 Blocks away from you"},
|
new String[]{"Kill someone using Longshot who", "is over 64 Blocks away from you"},
|
||||||
new int[]{1},
|
new int[]{1},
|
||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
CHAMPIONS_EARTHQUAKE("Earthquake", 1200,
|
CHAMPIONS_EARTHQUAKE("Earthquake", 1200,
|
||||||
new String[]{"Champions Domination.Earthquake", "Champions TDM.Earthquake", "Champions Capture the Flag.Earthquake"},
|
new String[]{"Champions Domination.Earthquake", "Champions TDM.Earthquake", "Champions CTF.Earthquake"},
|
||||||
new String[]{"Launch 5 enemies using Seismic Slam"},
|
new String[]{"Launch 5 enemies using Seismic Slam"},
|
||||||
new int[]{1},
|
new int[]{1},
|
||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
CHAMPIONS_CAPTURES("Sticky Fingers", 2500,
|
CHAMPIONS_CAPTURES("Sticky Fingers", 2500,
|
||||||
new String[]{"Champions Capture the Flag.Captures"},
|
new String[]{"Champions CTF.Captures"},
|
||||||
new String[]{"Capture the Enemy Flag 20 times"},
|
new String[]{"Capture the Enemy Flag 20 times"},
|
||||||
new int[]{20},
|
new int[]{20},
|
||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
CHAMPIONS_CLUTCH("Clutch", 600,
|
CHAMPIONS_CLUTCH("Clutch", 600,
|
||||||
new String[]{"Champions Capture the Flag.Clutch"},
|
new String[]{"Champions CTF.Clutch"},
|
||||||
new String[]{"Kill the Enemy Flag Carrier in Sudden Death"},
|
new String[]{"Kill the Enemy Flag Carrier in Sudden Death"},
|
||||||
new int[]{1},
|
new int[]{1},
|
||||||
AchievementCategory.CHAMPIONS),
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
|
CHAMPIONS_SPECIAL_WIN("Champion of Champions", 3000,
|
||||||
|
new String[]{"Champions CTF.SpecialWin"},
|
||||||
|
new String[]{"Win the game with 5 more captures than the other team"},
|
||||||
|
new int[]{1},
|
||||||
|
AchievementCategory.CHAMPIONS),
|
||||||
|
|
||||||
//Paintball
|
//Paintball
|
||||||
SUPER_PAINTBALL_WINS("Paintball King", 600,
|
SUPER_PAINTBALL_WINS("Paintball King", 600,
|
||||||
new String[]{"Super Paintball.Wins"},
|
new String[]{"Super Paintball.Wins"},
|
||||||
|
@ -78,7 +78,7 @@ public enum AchievementCategory
|
|||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.GEMS_EARNED },
|
||||||
Material.BOOK_AND_QUILL, 0, GameCategory.CLASSICS, "Extra Tools Kit"),
|
Material.BOOK_AND_QUILL, 0, GameCategory.CLASSICS, "Extra Tools Kit"),
|
||||||
|
|
||||||
CHAMPIONS("Champions", new String[] {"Champions Domination", "Champions TDM", "Champions Capture the Flag"},
|
CHAMPIONS("Champions", new String[] {"Champions Domination", "Champions TDM", "Champions CTF"},
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED, new StatDisplay("Flags Captured", "Captures") },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED, new StatDisplay("Flags Captured", "Captures") },
|
||||||
Material.BEACON, 0, GameCategory.CHAMPIONS, "Extra Class Skills"),
|
Material.BEACON, 0, GameCategory.CHAMPIONS, "Extra Class Skills"),
|
||||||
|
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
package mineplex.core.disguise.disguises;
|
||||||
|
|
||||||
|
import org.bukkit.entity.*;
|
||||||
|
|
||||||
|
public class DisguiseGuardian extends DisguiseCreature
|
||||||
|
{
|
||||||
|
public DisguiseGuardian(org.bukkit.entity.Entity entity)
|
||||||
|
{
|
||||||
|
super(EntityType.GUARDIAN, entity);
|
||||||
|
DataWatcher.a(16, 0);
|
||||||
|
DataWatcher.a(17, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTarget(int target)
|
||||||
|
{
|
||||||
|
DataWatcher.watch(17, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElder(boolean elder)
|
||||||
|
{
|
||||||
|
DataWatcher.watch(16, Integer.valueOf(DataWatcher.getInt(16) | 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isElder()
|
||||||
|
{
|
||||||
|
return (this.DataWatcher.getInt(16) & 4) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getHurtSound()
|
||||||
|
{
|
||||||
|
if (isElder())
|
||||||
|
{
|
||||||
|
return "mob.guardian.elder.hit";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "mob.guardian.hit";
|
||||||
|
}
|
||||||
|
}
|
@ -61,7 +61,7 @@ public class ItemTNT extends ItemGadget
|
|||||||
if (!_tnt.remove(event.getEntity()))
|
if (!_tnt.remove(event.getEntity()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HashMap<Player, Double> players = UtilPlayer.getInRadius(event.getLocation(), 10);
|
HashMap<Player, Double> players = UtilPlayer.getInRadius(event.getLocation(), 8);
|
||||||
for (Player player : players.keySet())
|
for (Player player : players.keySet())
|
||||||
{
|
{
|
||||||
if (Manager.collideEvent(this, player))
|
if (Manager.collideEvent(this, player))
|
||||||
|
@ -1,35 +1,216 @@
|
|||||||
package mineplex.core.gadget.gadgets;
|
package mineplex.core.gadget.gadgets;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import java.util.HashMap;
|
||||||
import org.bukkit.entity.Player;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Zombie;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.MapUtil;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilEvent;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.types.MorphGadget;
|
import mineplex.core.gadget.types.MorphGadget;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.recharge.RechargedEvent;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
public class MorphTitan extends MorphGadget
|
public class MorphTitan extends MorphGadget
|
||||||
{
|
{
|
||||||
|
private HashMap<Player, ArmorStand> _targets = new HashMap<Player, ArmorStand>();
|
||||||
|
|
||||||
public MorphTitan(GadgetManager manager)
|
public MorphTitan(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Titanic Morph", new String[]
|
super(manager, "Elder Guardian Morph", new String[]
|
||||||
{
|
{
|
||||||
C.cWhite + "Coming Soon...",
|
C.cWhite + "From deep withinsdngsg",
|
||||||
" ",
|
" ",
|
||||||
C.cRed + "Unlocked with Titan Rank",
|
C.cRed + "Unlocked with Titan Rank",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
Material.INK_SACK, (byte)8);
|
Material.PRISMARINE_SHARD, (byte)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void EnableCustom(Player player)
|
public void EnableCustom(Player player)
|
||||||
{
|
{
|
||||||
|
this.ApplyArmor(player);
|
||||||
|
|
||||||
|
DisguiseGuardian disguise = new DisguiseGuardian(player);
|
||||||
|
disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank());
|
||||||
|
disguise.setCustomNameVisible(true);
|
||||||
|
disguise.setElder(true);
|
||||||
|
Manager.getDisguiseManager().disguise(disguise);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void DisableCustom(Player player)
|
public void DisableCustom(Player player)
|
||||||
{
|
{
|
||||||
|
this.RemoveArmor(player);
|
||||||
|
Manager.getDisguiseManager().undisguise(player);
|
||||||
|
|
||||||
|
player.setAllowFlight(false);
|
||||||
|
player.setFlying(false);
|
||||||
|
|
||||||
|
Entity ent = _targets.remove(player);
|
||||||
|
if (ent != null)
|
||||||
|
ent.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void lazer(PlayerInteractEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (!IsActive(player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!UtilEvent.isAction(event, ActionType.L))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!Recharge.Instance.use(player, "Guardians Laser", 4000, true, false))
|
||||||
|
return;
|
||||||
|
|
||||||
|
DisguiseBase base = Manager.getDisguiseManager().getDisguise(player);
|
||||||
|
if (base == null || !(base instanceof DisguiseGuardian))
|
||||||
|
return;
|
||||||
|
|
||||||
|
DisguiseGuardian disguise = (DisguiseGuardian)base;
|
||||||
|
|
||||||
|
HashSet<Material> ignore = new HashSet<Material>();
|
||||||
|
ignore.add(Material.AIR);
|
||||||
|
|
||||||
|
Location loc = player.getTargetBlock(ignore, 64).getLocation().add(0.5, 0.5, 0.5);
|
||||||
|
|
||||||
|
ArmorStand stand = loc.getWorld().spawn(loc, ArmorStand.class);
|
||||||
|
|
||||||
|
stand.setVisible(false);
|
||||||
|
stand.setGhost(true);
|
||||||
|
stand.setGravity(false);
|
||||||
|
|
||||||
|
_targets.put(player, stand);
|
||||||
|
|
||||||
|
disguise.setTarget(stand.getEntityId());
|
||||||
|
|
||||||
|
Manager.getDisguiseManager().updateDisguise(disguise);
|
||||||
|
|
||||||
|
//Fake Head
|
||||||
|
UtilEnt.setFakeHead(player, true);
|
||||||
|
Recharge.Instance.useForce(player, GetName() + " FakeHead", 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void lazerEnd(RechargedEvent event)
|
||||||
|
{
|
||||||
|
if (event.GetAbility().equals(GetName() + " FakeHead"))
|
||||||
|
{
|
||||||
|
UtilEnt.setFakeHead(event.GetPlayer(), false);
|
||||||
|
|
||||||
|
//Explode
|
||||||
|
ArmorStand stand = _targets.remove(event.GetPlayer());
|
||||||
|
if (stand != null)
|
||||||
|
{
|
||||||
|
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, stand.getLocation(), 3f, 3f, 3f, 0, 32, ViewDist.MAX, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
HashMap<LivingEntity, Double> players = UtilEnt.getInRadius(stand.getLocation(), 12);
|
||||||
|
for (Entity ent : players.keySet())
|
||||||
|
{
|
||||||
|
if (ent instanceof Player)
|
||||||
|
if (Manager.collideEvent(this, (Player)ent))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
double mult = players.get(ent);
|
||||||
|
|
||||||
|
//Knockback
|
||||||
|
UtilAction.velocity(ent, UtilAlg.getTrajectory(stand.getLocation(), ent.getLocation()), 4 * mult, false, 0, 1 + 3 * mult, 10, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Sound
|
||||||
|
stand.getWorld().playSound(stand.getLocation(), Sound.ZOMBIE_REMEDY, 6f, 0.75f);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Disguise
|
||||||
|
DisguiseBase base = Manager.getDisguiseManager().getDisguise(event.GetPlayer());
|
||||||
|
if (base == null || !(base instanceof DisguiseGuardian))
|
||||||
|
return;
|
||||||
|
|
||||||
|
DisguiseGuardian disguise = (DisguiseGuardian)base;
|
||||||
|
disguise.setTarget(0);
|
||||||
|
|
||||||
|
Manager.getDisguiseManager().updateDisguise(disguise);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void selfParticles(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : _targets.keySet())
|
||||||
|
{
|
||||||
|
Vector dir = UtilAlg.getTrajectory( player.getLocation().add(0, 1.5, 0), _targets.get(player).getLocation());
|
||||||
|
dir.multiply(8);
|
||||||
|
|
||||||
|
UtilParticle.PlayParticle(ParticleType.MAGIC_CRIT,
|
||||||
|
player.getLocation().add(0, 1.5, 0),
|
||||||
|
(float)dir.getX(),
|
||||||
|
(float)dir.getY(),
|
||||||
|
(float)dir.getZ(),
|
||||||
|
1, 0, ViewDist.LONG, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
player.playSound(player.getLocation(), Sound.FIREWORK_TWINKLE2, 2f, 2f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void flight(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : GetActive())
|
||||||
|
{
|
||||||
|
if (UtilPlayer.isSpectator(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
player.setAllowFlight(true);
|
||||||
|
player.setFlying(true);
|
||||||
|
|
||||||
|
if (UtilEnt.isGrounded(player))
|
||||||
|
UtilAction.velocity(player, new Vector(0,1,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());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,8 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println(player.getName() + " has activated " + Name);
|
||||||
|
|
||||||
EnableCustom(player);
|
EnableCustom(player);
|
||||||
Manager.setActive(player, this);
|
Manager.setActive(player, this);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mineplex.core.game;
|
package mineplex.core.game;
|
||||||
|
|
||||||
|
import org.bukkit.DyeColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
public enum GameDisplay
|
public enum GameDisplay
|
||||||
@ -10,7 +11,6 @@ public enum GameDisplay
|
|||||||
Bridge("The Bridges", Material.IRON_PICKAXE, (byte)0, GameCategory.SURVIVAL, 3),
|
Bridge("The Bridges", Material.IRON_PICKAXE, (byte)0, GameCategory.SURVIVAL, 3),
|
||||||
CastleSiege("Castle Siege", Material.DIAMOND_CHESTPLATE, (byte)0, GameCategory.CLASSICS, 4),
|
CastleSiege("Castle Siege", Material.DIAMOND_CHESTPLATE, (byte)0, GameCategory.CLASSICS, 4),
|
||||||
ChampionsDominate("Champions Domination", "Champions", Material.BEACON, (byte)0, GameCategory.CHAMPIONS, 6),
|
ChampionsDominate("Champions Domination", "Champions", Material.BEACON, (byte)0, GameCategory.CHAMPIONS, 6),
|
||||||
//ChampionsMOBA(ChampionsMOBA.class, "Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0, GameCategory.CHAMPIONS, 7),
|
|
||||||
ChampionsTDM("Champions TDM", "Champions", Material.GOLD_SWORD, (byte)0, GameCategory.CHAMPIONS, 5),
|
ChampionsTDM("Champions TDM", "Champions", Material.GOLD_SWORD, (byte)0, GameCategory.CHAMPIONS, 5),
|
||||||
Christmas("Christmas Chaos", Material.SNOW_BALL, (byte)0, GameCategory.CLASSICS, 8),
|
Christmas("Christmas Chaos", Material.SNOW_BALL, (byte)0, GameCategory.CLASSICS, 8),
|
||||||
DeathTag("Death Tag", Material.SKULL_ITEM, (byte)0, GameCategory.ARCADE, 9),
|
DeathTag("Death Tag", Material.SKULL_ITEM, (byte)0, GameCategory.ARCADE, 9),
|
||||||
@ -21,8 +21,7 @@ public enum GameDisplay
|
|||||||
DragonsTeams("Dragons Teams", Material.ENDER_STONE, (byte)0, GameCategory.TEAM_VARIANT, 14),
|
DragonsTeams("Dragons Teams", Material.ENDER_STONE, (byte)0, GameCategory.TEAM_VARIANT, 14),
|
||||||
Draw("Draw My Thing", Material.BOOK_AND_QUILL, (byte)0, GameCategory.CLASSICS, 15),
|
Draw("Draw My Thing", Material.BOOK_AND_QUILL, (byte)0, GameCategory.CLASSICS, 15),
|
||||||
Evolution("Evolution", Material.EMERALD, (byte)0, GameCategory.ARCADE, 16),
|
Evolution("Evolution", Material.EMERALD, (byte)0, GameCategory.ARCADE, 16),
|
||||||
//FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17),
|
Gravity("Gravity", Material.ENDER_PORTAL, (byte)0, GameCategory.EXTRA, 18),
|
||||||
Gravity("Gravity", Material.SEA_LANTERN, (byte)0, GameCategory.EXTRA, 18),
|
|
||||||
Halloween("Halloween Horror", Material.PUMPKIN, (byte)0, GameCategory.CLASSICS, 19),
|
Halloween("Halloween Horror", Material.PUMPKIN, (byte)0, GameCategory.CLASSICS, 19),
|
||||||
HideSeek("Block Hunt", Material.GRASS, (byte)0, GameCategory.CLASSICS, 20),
|
HideSeek("Block Hunt", Material.GRASS, (byte)0, GameCategory.CLASSICS, 20),
|
||||||
HoleInTheWall("Hole in the Wall", Material.STAINED_GLASS, (byte) 2, GameCategory.ARCADE, 52),
|
HoleInTheWall("Hole in the Wall", Material.STAINED_GLASS, (byte) 2, GameCategory.ARCADE, 52),
|
||||||
@ -67,7 +66,7 @@ public enum GameDisplay
|
|||||||
|
|
||||||
Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54),
|
Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54),
|
||||||
|
|
||||||
ChampionsCTF("Champions CTF", "Champions", Material.REDSTONE_BLOCK, (byte)0, GameCategory.CHAMPIONS, 55),
|
ChampionsCTF("Champions CTF", "Champions", Material.BANNER, DyeColor.RED.getDyeData(), GameCategory.CHAMPIONS, 56),
|
||||||
|
|
||||||
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);
|
Event("Mineplex Event", Material.CAKE, (byte)0, GameCategory.EVENT, 999);
|
||||||
|
|
||||||
|
@ -2,11 +2,8 @@ package mineplex.core.hologram;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -34,7 +31,7 @@ public class Hologram
|
|||||||
/**
|
/**
|
||||||
* 1.7 packets uses both EntityIDs while 1.8 uses only the first.
|
* 1.7 packets uses both EntityIDs while 1.8 uses only the first.
|
||||||
*/
|
*/
|
||||||
private ArrayList<Entry<Integer, Integer>> _entityIds = new ArrayList<Entry<Integer, Integer>>();
|
private ArrayList<Integer> _entityIds = new ArrayList<Integer>();
|
||||||
private Entity _followEntity;
|
private Entity _followEntity;
|
||||||
private HologramManager _hologramManager;
|
private HologramManager _hologramManager;
|
||||||
private String[] _hologramText = new String[0];
|
private String[] _hologramText = new String[0];
|
||||||
@ -53,6 +50,7 @@ public class Hologram
|
|||||||
private int _viewDistance = 70;
|
private int _viewDistance = 70;
|
||||||
protected Vector relativeToEntity;
|
protected Vector relativeToEntity;
|
||||||
private boolean _hideBoundingBox;
|
private boolean _hideBoundingBox;
|
||||||
|
private HologramInteraction _interaction;
|
||||||
|
|
||||||
public Hologram(HologramManager hologramManager, Location location, String... text)
|
public Hologram(HologramManager hologramManager, Location location, String... text)
|
||||||
{
|
{
|
||||||
@ -61,6 +59,18 @@ public class Hologram
|
|||||||
setText(text);
|
setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Hologram setInteraction(HologramInteraction interact)
|
||||||
|
{
|
||||||
|
_interaction = interact;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HologramInteraction getInteraction()
|
||||||
|
{
|
||||||
|
return _interaction;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the player to the Hologram to be effected by Whitelist or Blacklist
|
* Adds the player to the Hologram to be effected by Whitelist or Blacklist
|
||||||
*/
|
*/
|
||||||
@ -151,6 +161,7 @@ public class Hologram
|
|||||||
nearbyPlayers.add(player);
|
nearbyPlayers.add(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nearbyPlayers;
|
return nearbyPlayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,9 +240,7 @@ public class Hologram
|
|||||||
|
|
||||||
for (int i = 0; i < _entityIds.size(); i++)
|
for (int i = 0; i < _entityIds.size(); i++)
|
||||||
{
|
{
|
||||||
Entry<Integer, Integer> entry = _entityIds.get(i);
|
entityIds1_8[i] = _entityIds.get(i);
|
||||||
|
|
||||||
entityIds1_8[i] = entry.getKey();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_destroy1_8 = new PacketPlayOutEntityDestroy(entityIds1_8);
|
_destroy1_8 = new PacketPlayOutEntityDestroy(entityIds1_8);
|
||||||
@ -247,7 +256,7 @@ public class Hologram
|
|||||||
|
|
||||||
for (int i = _entityIds.size(); i < _hologramText.length; i++)
|
for (int i = _entityIds.size(); i < _hologramText.length; i++)
|
||||||
{
|
{
|
||||||
_entityIds.add(new HashMap.SimpleEntry(UtilEnt.getNewEntityId(), UtilEnt.getNewEntityId()));
|
_entityIds.add(UtilEnt.getNewEntityId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -261,9 +270,7 @@ public class Hologram
|
|||||||
}
|
}
|
||||||
for (int textRow = 0; textRow < _hologramText.length; textRow++)
|
for (int textRow = 0; textRow < _hologramText.length; textRow++)
|
||||||
{
|
{
|
||||||
Entry<Integer, Integer> entityIds = this._entityIds.get(textRow);
|
Packet[] packets1_8 = makeSpawnPackets1_8(textRow, _entityIds.get(textRow), _hologramText[textRow]);
|
||||||
|
|
||||||
Packet[] packets1_8 = makeSpawnPackets1_8(textRow, entityIds.getKey(), _hologramText[textRow]);
|
|
||||||
|
|
||||||
for (int i = 0; i < packets1_8.length; i++)
|
for (int i = 0; i < packets1_8.length; i++)
|
||||||
{
|
{
|
||||||
@ -326,8 +333,7 @@ public class Hologram
|
|||||||
public Hologram setFollowEntity(Entity entityToFollow)
|
public Hologram setFollowEntity(Entity entityToFollow)
|
||||||
{
|
{
|
||||||
_followEntity = entityToFollow;
|
_followEntity = entityToFollow;
|
||||||
relativeToEntity = entityToFollow == null ? null : this._location.clone().subtract(entityToFollow.getLocation())
|
relativeToEntity = entityToFollow == null ? null : _location.clone().subtract(entityToFollow.getLocation()).toVector();
|
||||||
.toVector();
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -340,7 +346,7 @@ public class Hologram
|
|||||||
*/
|
*/
|
||||||
public Hologram setHologramTarget(HologramTarget newTarget)
|
public Hologram setHologramTarget(HologramTarget newTarget)
|
||||||
{
|
{
|
||||||
this._target = newTarget;
|
_target = newTarget;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,11 +411,11 @@ public class Hologram
|
|||||||
if (x >= -128 && x <= 127 && y >= -128 && y <= 127 && z >= -128 && z <= 127)
|
if (x >= -128 && x <= 127 && y >= -128 && y <= 127 && z >= -128 && z <= 127)
|
||||||
{
|
{
|
||||||
_lastMovement.subtract(new Vector(x / 32D, y / 32D, z / 32D));
|
_lastMovement.subtract(new Vector(x / 32D, y / 32D, z / 32D));
|
||||||
for (Entry<Integer, Integer> entityId : this._entityIds)
|
for (Integer entityId : _entityIds)
|
||||||
{
|
{
|
||||||
PacketPlayOutEntity.PacketPlayOutRelEntityMove relMove = new PacketPlayOutEntity.PacketPlayOutRelEntityMove();
|
PacketPlayOutEntity.PacketPlayOutRelEntityMove relMove = new PacketPlayOutEntity.PacketPlayOutRelEntityMove();
|
||||||
|
|
||||||
relMove.a = entityId.getKey();
|
relMove.a = entityId;
|
||||||
relMove.b = (byte) x;
|
relMove.b = (byte) x;
|
||||||
relMove.c = (byte) y;
|
relMove.c = (byte) y;
|
||||||
relMove.d = (byte) z;
|
relMove.d = (byte) z;
|
||||||
@ -425,13 +431,12 @@ public class Hologram
|
|||||||
|
|
||||||
_lastMovement = new Vector(newLocation.getX() - (x / 32D), 0, newLocation.getZ() - (z / 32D));
|
_lastMovement = new Vector(newLocation.getX() - (x / 32D), 0, newLocation.getZ() - (z / 32D));
|
||||||
|
|
||||||
for (Entry<Integer, Integer> entityId : this._entityIds)
|
for (Integer entityId : _entityIds)
|
||||||
{
|
{
|
||||||
PacketPlayOutEntityTeleport teleportPacket = new PacketPlayOutEntityTeleport();
|
PacketPlayOutEntityTeleport teleportPacket = new PacketPlayOutEntityTeleport();
|
||||||
teleportPacket.a = entityId.getKey();
|
teleportPacket.a = entityId;
|
||||||
teleportPacket.b = x;
|
teleportPacket.b = x;
|
||||||
teleportPacket.c = (int) Math
|
teleportPacket.c = (int) Math.floor((oldLocation.getY() + (-2.1) + ((double) i * 0.285)) * 32);
|
||||||
.floor((oldLocation.getY() + (-2.1) + ((double) i * 0.285)) * 32);
|
|
||||||
teleportPacket.d = z;
|
teleportPacket.d = z;
|
||||||
|
|
||||||
packets1_8[i] = teleportPacket;
|
packets1_8[i] = teleportPacket;
|
||||||
@ -458,6 +463,11 @@ public class Hologram
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEntityId(int entityId)
|
||||||
|
{
|
||||||
|
return _entityIds.contains(entityId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the hologram text
|
* Set the hologram text
|
||||||
*/
|
*/
|
||||||
@ -491,28 +501,28 @@ public class Hologram
|
|||||||
{
|
{
|
||||||
// Add entity id and send spawn packets
|
// Add entity id and send spawn packets
|
||||||
// You add a entity id because the new hologram needs
|
// You add a entity id because the new hologram needs
|
||||||
Entry<Integer, Integer> entry = new HashMap.SimpleEntry(UtilEnt.getNewEntityId(), UtilEnt.getNewEntityId());
|
int entityId = UtilEnt.getNewEntityId();
|
||||||
_entityIds.add(entry);
|
_entityIds.add(entityId);
|
||||||
|
|
||||||
packets1_8.addAll(Arrays.asList(makeSpawnPackets1_8(i, entry.getKey(), newText[i])));
|
packets1_8.addAll(Arrays.asList(makeSpawnPackets1_8(i, entityId, newText[i])));
|
||||||
}
|
}
|
||||||
// If less lines than previously
|
// If less lines than previously
|
||||||
else if (i >= newText.length)
|
else if (i >= newText.length)
|
||||||
{
|
{
|
||||||
// Remove entity id and send destroy packets
|
// Remove entity id and send destroy packets
|
||||||
Entry<Integer, Integer> entry = _entityIds.remove(newText.length);
|
Integer entityId = _entityIds.remove(newText.length);
|
||||||
|
|
||||||
destroy1_8 = Arrays.copyOf(destroy1_8, destroy1_8.length + 1);
|
destroy1_8 = Arrays.copyOf(destroy1_8, destroy1_8.length + 1);
|
||||||
destroy1_8[destroy1_8.length - 1] = entry.getKey();
|
destroy1_8[destroy1_8.length - 1] = entityId;
|
||||||
}
|
}
|
||||||
else if (!newText[i].equals(_hologramText[i]))
|
else if (!newText[i].equals(_hologramText[i]))
|
||||||
{
|
{
|
||||||
// Send update metadata packets
|
// Send update metadata packets
|
||||||
Entry<Integer, Integer> entry = _entityIds.get(i);
|
Integer entityId = _entityIds.get(i);
|
||||||
|
|
||||||
PacketPlayOutEntityMetadata metadata1_8 = new PacketPlayOutEntityMetadata();
|
PacketPlayOutEntityMetadata metadata1_8 = new PacketPlayOutEntityMetadata();
|
||||||
|
|
||||||
metadata1_8.a = entry.getKey();
|
metadata1_8.a = entityId;
|
||||||
|
|
||||||
DataWatcher watcher1_8 = new DataWatcher(null);
|
DataWatcher watcher1_8 = new DataWatcher(null);
|
||||||
|
|
||||||
@ -552,7 +562,7 @@ public class Hologram
|
|||||||
*/
|
*/
|
||||||
public Hologram setViewDistance(int newDistance)
|
public Hologram setViewDistance(int newDistance)
|
||||||
{
|
{
|
||||||
this._viewDistance = newDistance;
|
_viewDistance = newDistance;
|
||||||
return setLocation(getLocation());
|
return setLocation(getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,6 +603,7 @@ public class Hologram
|
|||||||
_playersTracking.clear();
|
_playersTracking.clear();
|
||||||
_lastMovement = null;
|
_lastMovement = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package mineplex.core.hologram;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
|
||||||
|
public interface HologramInteraction
|
||||||
|
{
|
||||||
|
public void onClick(Player player, ClickType clickType);
|
||||||
|
}
|
@ -5,28 +5,33 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.packethandler.IPacketHandler;
|
||||||
|
import mineplex.core.packethandler.PacketHandler;
|
||||||
|
import mineplex.core.packethandler.PacketInfo;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import net.minecraft.server.v1_8_R3.Packet;
|
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
|
||||||
|
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.EnumEntityUseAction;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class HologramManager implements Listener
|
public class HologramManager implements Listener, IPacketHandler
|
||||||
{
|
{
|
||||||
private ArrayList<Hologram> _activeHolograms = new ArrayList<Hologram>();
|
private ArrayList<Hologram> _activeHolograms = new ArrayList<Hologram>();
|
||||||
|
|
||||||
public HologramManager(JavaPlugin arcadeManager)
|
public HologramManager(JavaPlugin arcadeManager, PacketHandler packetHandler)
|
||||||
{
|
{
|
||||||
Bukkit.getPluginManager().registerEvents(this, arcadeManager);
|
Bukkit.getPluginManager().registerEvents(this, arcadeManager);
|
||||||
|
packetHandler.addPacketHandler(this, true, PacketPlayInUseEntity.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addHologram(Hologram hologram)
|
void addHologram(Hologram hologram)
|
||||||
@ -44,11 +49,15 @@ public class HologramManager implements Listener
|
|||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.TICK || _activeHolograms.isEmpty())
|
if (event.getType() != UpdateType.TICK || _activeHolograms.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
List<World> worlds = Bukkit.getWorlds();
|
List<World> worlds = Bukkit.getWorlds();
|
||||||
|
|
||||||
Iterator<Hologram> itel = _activeHolograms.iterator();
|
Iterator<Hologram> itel = _activeHolograms.iterator();
|
||||||
|
|
||||||
while (itel.hasNext())
|
while (itel.hasNext())
|
||||||
{
|
{
|
||||||
Hologram hologram = itel.next();
|
Hologram hologram = itel.next();
|
||||||
|
|
||||||
if (!worlds.contains(hologram.getLocation().getWorld()))
|
if (!worlds.contains(hologram.getLocation().getWorld()))
|
||||||
{
|
{
|
||||||
itel.remove();
|
itel.remove();
|
||||||
@ -59,6 +68,7 @@ public class HologramManager implements Listener
|
|||||||
if (hologram.getEntityFollowing() != null)
|
if (hologram.getEntityFollowing() != null)
|
||||||
{
|
{
|
||||||
Entity following = hologram.getEntityFollowing();
|
Entity following = hologram.getEntityFollowing();
|
||||||
|
|
||||||
if (hologram.isRemoveOnEntityDeath() && !following.isValid())
|
if (hologram.isRemoveOnEntityDeath() && !following.isValid())
|
||||||
{
|
{
|
||||||
itel.remove();
|
itel.remove();
|
||||||
@ -71,14 +81,19 @@ public class HologramManager implements Listener
|
|||||||
Vector vec = hologram.relativeToEntity.clone();
|
Vector vec = hologram.relativeToEntity.clone();
|
||||||
hologram.setLocation(following.getLocation().add(hologram.relativeToEntity));
|
hologram.setLocation(following.getLocation().add(hologram.relativeToEntity));
|
||||||
hologram.relativeToEntity = vec;
|
hologram.relativeToEntity = vec;
|
||||||
|
|
||||||
continue; // No need to do the rest of the code as setLocation does it.
|
continue; // No need to do the rest of the code as setLocation does it.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Player> canSee = hologram.getNearbyPlayers();
|
ArrayList<Player> canSee = hologram.getNearbyPlayers();
|
||||||
|
|
||||||
Iterator<Player> itel2 = hologram.getPlayersTracking().iterator();
|
Iterator<Player> itel2 = hologram.getPlayersTracking().iterator();
|
||||||
|
|
||||||
while (itel2.hasNext())
|
while (itel2.hasNext())
|
||||||
{
|
{
|
||||||
Player player = itel2.next();
|
Player player = itel2.next();
|
||||||
|
|
||||||
if (!canSee.contains(player))
|
if (!canSee.contains(player))
|
||||||
{
|
{
|
||||||
itel2.remove();
|
itel2.remove();
|
||||||
@ -88,6 +103,7 @@ public class HologramManager implements Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Player player : canSee)
|
for (Player player : canSee)
|
||||||
{
|
{
|
||||||
if (!hologram.getPlayersTracking().contains(player))
|
if (!hologram.getPlayersTracking().contains(player))
|
||||||
@ -100,4 +116,24 @@ public class HologramManager implements Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(PacketInfo packetInfo)
|
||||||
|
{
|
||||||
|
PacketPlayInUseEntity packetPlayIn = (PacketPlayInUseEntity) packetInfo.getPacket();
|
||||||
|
|
||||||
|
for (Hologram hologram : _activeHolograms)
|
||||||
|
{
|
||||||
|
if (!hologram.isEntityId(packetPlayIn.a))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (hologram.getInteraction() != null)
|
||||||
|
{
|
||||||
|
hologram.getInteraction().onClick(packetInfo.getPlayer(),
|
||||||
|
packetPlayIn.action == EnumEntityUseAction.ATTACK ? ClickType.LEFT : ClickType.RIGHT);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,11 +97,11 @@ public class LagMeter extends MiniPlugin
|
|||||||
|
|
||||||
_count++;
|
_count++;
|
||||||
|
|
||||||
if (System.currentTimeMillis() - _start > 60000)
|
if (System.currentTimeMillis() - _start > 30000)
|
||||||
{
|
{
|
||||||
if (_timingsRunning)
|
if (_timingsRunning)
|
||||||
{
|
{
|
||||||
if (_ticksPerSecond > 15 || System.currentTimeMillis() - _timingsStarted > 60000)
|
if (System.currentTimeMillis() - _timingsStarted > 30000)
|
||||||
{
|
{
|
||||||
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), "timings paste");
|
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), "timings paste");
|
||||||
_timingsRunning = false;
|
_timingsRunning = false;
|
||||||
|
@ -54,6 +54,7 @@ public abstract class Mount<T> extends SalesPackageBase implements Listener
|
|||||||
Manager.setActive(player, this);
|
Manager.setActive(player, this);
|
||||||
EnableCustom(player);
|
EnableCustom(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void EnableCustom(Player player);
|
public abstract void EnableCustom(Player player);
|
||||||
public abstract void Disable(Player player);
|
public abstract void Disable(Player player);
|
||||||
|
|
||||||
|
@ -1,27 +1,126 @@
|
|||||||
package mineplex.core.mount.types;
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Slime;
|
||||||
import org.bukkit.entity.Horse.Color;
|
import org.bukkit.entity.Horse.Color;
|
||||||
import org.bukkit.entity.Horse.Style;
|
import org.bukkit.entity.Horse.Style;
|
||||||
import org.bukkit.entity.Horse.Variant;
|
import org.bukkit.entity.Horse.Variant;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.mount.HorseMount;
|
import mineplex.core.mount.HorseMount;
|
||||||
|
import mineplex.core.mount.Mount;
|
||||||
import mineplex.core.mount.MountManager;
|
import mineplex.core.mount.MountManager;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
public class MountTitan extends HorseMount
|
public class MountTitan extends Mount<MountTitanData>
|
||||||
{
|
{
|
||||||
public MountTitan(MountManager manager)
|
public MountTitan(MountManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Titanic Mount", new String[]
|
super(manager, "Molten Snake", Material.REDSTONE_BLOCK, (byte)0, new String[]
|
||||||
{
|
{
|
||||||
C.cWhite + "Coming Soon...",
|
C.cWhite + "From the distant ether realm,",
|
||||||
|
C.cWhite + "this prized dragon is said to",
|
||||||
|
C.cWhite + "obey only true Heroes!",
|
||||||
" ",
|
" ",
|
||||||
C.cRed + "Unlocked with Titan Rank",
|
C.cRed + "Unlocked with Titan Rank",
|
||||||
},
|
}, -1);
|
||||||
Material.INK_SACK,
|
}
|
||||||
(byte)8,
|
|
||||||
-1,
|
@Override
|
||||||
Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null);
|
public void EnableCustom(Player player)
|
||||||
|
{
|
||||||
|
player.leaveVehicle();
|
||||||
|
player.eject();
|
||||||
|
|
||||||
|
//Remove other mounts
|
||||||
|
Manager.DeregisterAll(player);
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
|
||||||
|
|
||||||
|
//Store
|
||||||
|
_active.put(player, new MountTitanData(player, GetName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Disable(Player player)
|
||||||
|
{
|
||||||
|
MountTitanData data = _active.remove(player);
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
data.clean();
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Mount", "You despawned " + F.elem(GetName()) + "."));
|
||||||
|
|
||||||
|
Manager.removeActive(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void update(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (MountTitanData data : _active.values())
|
||||||
|
{
|
||||||
|
data.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void interactMount(PlayerInteractEntityEvent event)
|
||||||
|
{
|
||||||
|
if (event.getRightClicked() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!GetActive().containsKey(event.getPlayer()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!GetActive().get(event.getPlayer()).ownsMount(event.getPlayer()))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Mount", "This is not your Mount!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.getPlayer().leaveVehicle();
|
||||||
|
event.getPlayer().eject();
|
||||||
|
|
||||||
|
GetActive().get(event.getPlayer()).mount(event.getPlayer(), event.getRightClicked());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void target(EntityTargetEvent event)
|
||||||
|
{
|
||||||
|
if (!(event.getEntity() instanceof Player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!GetActive().containsKey(event.getTarget()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!GetActive().get(event.getTarget()).ownsMount((Player)event.getEntity()))
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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,179 @@
|
|||||||
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseMagmaCube;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.util.EulerAngle;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class MountTitanData
|
||||||
|
{
|
||||||
|
private String _owner;
|
||||||
|
|
||||||
|
private LivingEntity _head;
|
||||||
|
|
||||||
|
private ArrayList<ArmorStand> _nodes;
|
||||||
|
|
||||||
|
public MountTitanData(DisguiseManager disguiseManager, Player player, String name)
|
||||||
|
{
|
||||||
|
_owner = player.getName();
|
||||||
|
|
||||||
|
// Nodes
|
||||||
|
_nodes = new ArrayList<ArmorStand>();
|
||||||
|
|
||||||
|
Location loc = player.getLocation();
|
||||||
|
loc.setYaw(0);
|
||||||
|
loc.setPitch(0);
|
||||||
|
|
||||||
|
for (int i = 0; i < 30; i++)
|
||||||
|
{
|
||||||
|
ArmorStand node = player.getWorld().spawn(loc, ArmorStand.class);
|
||||||
|
|
||||||
|
node.setVisible(false);
|
||||||
|
node.setGravity(false);
|
||||||
|
|
||||||
|
node.setHelmet(new ItemStack(Material.REDSTONE_BLOCK));
|
||||||
|
|
||||||
|
_nodes.add(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Head
|
||||||
|
_head = (LivingEntity) player.getWorld().spawnEntity(loc, EntityType.BAT);
|
||||||
|
UtilEnt.Vegetate(_head, true);
|
||||||
|
UtilEnt.silence(_head, true);
|
||||||
|
UtilEnt.setFakeHead(_head, true);
|
||||||
|
|
||||||
|
_head.setCustomName(player.getName() + "'s " + name);
|
||||||
|
|
||||||
|
((CraftLivingEntity) _head).getHandle().setMineplexInvisible(true);
|
||||||
|
|
||||||
|
DisguiseMagmaCube disguise = new DisguiseMagmaCube(_head);
|
||||||
|
disguise.SetSize(2);
|
||||||
|
|
||||||
|
disguiseManager.disguise(disguise);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mount(Player player, Entity entity)
|
||||||
|
{
|
||||||
|
if (_head.equals(entity) || _nodes.contains(entity))
|
||||||
|
_head.setPassenger(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update()
|
||||||
|
{
|
||||||
|
// Head
|
||||||
|
if (_head.getPassenger() != null)
|
||||||
|
{
|
||||||
|
_head.setVelocity(_head.getPassenger().getLocation().getDirection().add(new Vector(0, 0.2, 0)));
|
||||||
|
|
||||||
|
UtilEnt.CreatureLook(_head, _head.getPassenger().getLocation().getDirection());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Player player = Bukkit.getPlayerExact(_owner);
|
||||||
|
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
Vector moving = null;
|
||||||
|
|
||||||
|
if (UtilMath.offset(player, _head) > 12)
|
||||||
|
{
|
||||||
|
moving = _head.getLocation().getDirection().normalize();
|
||||||
|
|
||||||
|
Vector vec = moving.clone().subtract(UtilAlg.getTrajectory(player, _head)).normalize();
|
||||||
|
|
||||||
|
vec.setY(-vec.getY());
|
||||||
|
|
||||||
|
moving.add(vec.multiply(0.15));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
moving = _head.getLocation().getDirection();
|
||||||
|
|
||||||
|
moving.setX(moving.getX() + UtilMath.rr(0.1, true));
|
||||||
|
moving.setY(moving.getY() + UtilMath.rr(0.3, true));
|
||||||
|
moving.setZ(moving.getZ() + UtilMath.rr(0.1, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
moving.normalize().multiply(0.5);
|
||||||
|
|
||||||
|
UtilEnt.CreatureLook(_head, moving);
|
||||||
|
|
||||||
|
_head.setVelocity(moving);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Location infront = _head.getLocation().add(0, -1.3, 0);
|
||||||
|
infront.setYaw(0);
|
||||||
|
infront.setPitch(0);
|
||||||
|
|
||||||
|
// Move
|
||||||
|
for (int i = 0; i < 30; i++)
|
||||||
|
{
|
||||||
|
ArmorStand node = _nodes.get(i);
|
||||||
|
|
||||||
|
Location loc = node.getLocation();
|
||||||
|
|
||||||
|
// Move
|
||||||
|
if (i == 0)
|
||||||
|
node.teleport(infront);
|
||||||
|
else if (UtilMath.offset(node.getLocation(), infront) > 0.5)
|
||||||
|
node.teleport(infront.add(UtilAlg.getTrajectory(infront, node.getLocation()).multiply(0.5)));
|
||||||
|
|
||||||
|
// Rotation
|
||||||
|
node.setHeadPose(UtilAlg.vectorToEuler(UtilAlg.getTrajectory(node.getLocation(), loc)));
|
||||||
|
|
||||||
|
infront = node.getLocation();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shuffle In
|
||||||
|
if (_head.getPassenger() == null)
|
||||||
|
{
|
||||||
|
for (int i = _nodes.size() - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
ArmorStand node = _nodes.get(i);
|
||||||
|
|
||||||
|
Location loc = node.getLocation();
|
||||||
|
|
||||||
|
if (i > 0)
|
||||||
|
infront = _nodes.get(i - 1).getLocation();
|
||||||
|
else
|
||||||
|
infront = _head.getLocation().add(0, -1.3, 0);
|
||||||
|
|
||||||
|
node.teleport(infront);
|
||||||
|
|
||||||
|
node.setHeadPose(new EulerAngle(0, -UtilAlg.GetYaw(UtilAlg.getTrajectory(node.getLocation(), loc)), 0));
|
||||||
|
// node.setHeadPose(UtilAlg.vectorToEuler(UtilAlg.getTrajectory(node.getLocation(), loc)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clean()
|
||||||
|
{
|
||||||
|
_head.remove();
|
||||||
|
|
||||||
|
for (ArmorStand stand : _nodes)
|
||||||
|
stand.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean ownsMount(Player player)
|
||||||
|
{
|
||||||
|
return _owner.equals(player.getName());
|
||||||
|
}
|
||||||
|
}
|
@ -42,6 +42,7 @@ public class PetFactory
|
|||||||
_pets.put(EntityType.OCELOT, new Pet("Cat", EntityType.OCELOT, 6000));
|
_pets.put(EntityType.OCELOT, new Pet("Cat", EntityType.OCELOT, 6000));
|
||||||
_pets.put(EntityType.MUSHROOM_COW, new Pet("Mooshroom", EntityType.MUSHROOM_COW, 5000));
|
_pets.put(EntityType.MUSHROOM_COW, new Pet("Mooshroom", EntityType.MUSHROOM_COW, 5000));
|
||||||
_pets.put(EntityType.WITHER, new Pet("Widder", EntityType.WITHER, -1));
|
_pets.put(EntityType.WITHER, new Pet("Widder", EntityType.WITHER, -1));
|
||||||
|
_pets.put(EntityType.SKELETON, new Pet("Guardian", EntityType.SKELETON, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreatePetExtras()
|
private void CreatePetExtras()
|
||||||
|
@ -14,9 +14,12 @@ import mineplex.core.account.event.ClientWebResponseEvent;
|
|||||||
import mineplex.core.blockrestore.BlockRestore;
|
import mineplex.core.blockrestore.BlockRestore;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.NautHashMap;
|
import mineplex.core.common.util.NautHashMap;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.disguise.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseGuardian;
|
||||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.inventory.InventoryManager;
|
import mineplex.core.inventory.InventoryManager;
|
||||||
@ -38,8 +41,10 @@ import org.bukkit.entity.Ageable;
|
|||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Guardian;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Skeleton;
|
||||||
import org.bukkit.entity.Villager;
|
import org.bukkit.entity.Villager;
|
||||||
import org.bukkit.entity.Zombie;
|
import org.bukkit.entity.Zombie;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -159,6 +164,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
if (!Get(p).GetPets().containsKey(EntityType.WITHER))
|
if (!Get(p).GetPets().containsKey(EntityType.WITHER))
|
||||||
Get(p).GetPets().put(EntityType.WITHER, "Widder");
|
Get(p).GetPets().put(EntityType.WITHER, "Widder");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rank.has(Rank.TITAN))
|
||||||
|
{
|
||||||
|
// if (!Get(p).GetPets().containsKey(EntityType.SKELETON))
|
||||||
|
// Get(p).GetPets().put(EntityType.SKELETON, "Guardian");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddPetOwner(Player player, EntityType entityType, Location location)
|
public void AddPetOwner(Player player, EntityType entityType, Location location)
|
||||||
@ -175,6 +186,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
|
|
||||||
Creature pet;
|
Creature pet;
|
||||||
|
|
||||||
|
//Wither Spawn
|
||||||
if (entityType == EntityType.WITHER)
|
if (entityType == EntityType.WITHER)
|
||||||
{
|
{
|
||||||
_creatureModule.SetForce(true);
|
_creatureModule.SetForce(true);
|
||||||
@ -196,6 +208,7 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
|
|
||||||
_creatureModule.SetForce(false);
|
_creatureModule.SetForce(false);
|
||||||
}
|
}
|
||||||
|
//Default Spawn
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pet = (Creature)_creatureModule.SpawnEntity(location, entityType);
|
pet = (Creature)_creatureModule.SpawnEntity(location, entityType);
|
||||||
@ -220,6 +233,20 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
((Villager) pet).setBaby();
|
((Villager) pet).setBaby();
|
||||||
((Villager) pet).setAgeLock(true);
|
((Villager) pet).setAgeLock(true);
|
||||||
}
|
}
|
||||||
|
else if (pet instanceof Skeleton)
|
||||||
|
{
|
||||||
|
pet.getEquipment().setHelmet(new ItemStack(Material.PUMPKIN)); //stop burning
|
||||||
|
UtilEnt.silence(pet, true);
|
||||||
|
|
||||||
|
DisguiseGuardian disguise = new DisguiseGuardian(pet);
|
||||||
|
|
||||||
|
if (Get(player).GetPets().get(entityType) != null && Get(player).GetPets().get(entityType).length() > 0)
|
||||||
|
{
|
||||||
|
disguise.setName(Get(player).GetPets().get(entityType));
|
||||||
|
}
|
||||||
|
|
||||||
|
_disguiseManager.disguise(disguise);
|
||||||
|
}
|
||||||
|
|
||||||
_activePetOwners.put(player.getName(), pet);
|
_activePetOwners.put(player.getName(), pet);
|
||||||
_failedAttempts.put(player.getName(), 0);
|
_failedAttempts.put(player.getName(), 0);
|
||||||
@ -336,6 +363,12 @@ public class PetManager extends MiniClientPlugin<PetClient>
|
|||||||
yDiff = Math.abs(petSpot.getBlockY() - ownerSpot.getBlockY());
|
yDiff = Math.abs(petSpot.getBlockY() - ownerSpot.getBlockY());
|
||||||
zDiff = Math.abs(petSpot.getBlockZ() - ownerSpot.getBlockZ());
|
zDiff = Math.abs(petSpot.getBlockZ() - ownerSpot.getBlockZ());
|
||||||
|
|
||||||
|
//Guardian
|
||||||
|
if (pet instanceof Skeleton && Math.random() > 0.66 && UtilEnt.isGrounded(pet))
|
||||||
|
{
|
||||||
|
UtilAction.velocity(pet, UtilAlg.getTrajectory(pet, owner), Math.random() * 0.3 + 0.3, false, 0, 0.3, 1, true);
|
||||||
|
}
|
||||||
|
|
||||||
if ((xDiff + yDiff + zDiff) > 4)
|
if ((xDiff + yDiff + zDiff) > 4)
|
||||||
{
|
{
|
||||||
EntityCreature ec = ((CraftCreature) pet).getHandle();
|
EntityCreature ec = ((CraftCreature) pet).getHandle();
|
||||||
|
@ -136,6 +136,12 @@ public class ProjectileManager extends MiniPlugin
|
|||||||
sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult, canHit));
|
sound, soundVolume, soundPitch, null, 0, effectRate, particle, pX, pY, pZ, pS, pC, hitboxMult, canHit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteThrown(Entity thrown)
|
||||||
|
{
|
||||||
|
_thrown.remove(thrown);
|
||||||
|
thrown.remove();
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void Update(UpdateEvent event)
|
public void Update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
@ -269,6 +269,13 @@ public class ProjectileUser
|
|||||||
nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D;
|
nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D;
|
||||||
nmsEntity.locZ -= nmsEntity.motZ / f2 * 0.0500000007450581D;
|
nmsEntity.locZ -= nmsEntity.motZ / f2 * 0.0500000007450581D;
|
||||||
|
|
||||||
|
if (nmsEntity.locX == Double.NaN)
|
||||||
|
System.out.println(_thrown + " has made " + nmsEntity + "'s locX NaN.");
|
||||||
|
if (nmsEntity.locY == Double.NaN)
|
||||||
|
System.out.println(_thrown + " has made " + nmsEntity + "'s locY NaN.");
|
||||||
|
if (nmsEntity.locZ == Double.NaN)
|
||||||
|
System.out.println(_thrown + " has made " + nmsEntity + "'s locZ NaN.");
|
||||||
|
|
||||||
_callback.Collide(null, block, this);
|
_callback.Collide(null, block, this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import mineplex.core.common.util.UtilTextMiddle;
|
|||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.gadget.event.GadgetBlockEvent;
|
import mineplex.core.gadget.event.GadgetBlockEvent;
|
||||||
import mineplex.core.hologram.Hologram;
|
import mineplex.core.hologram.Hologram;
|
||||||
|
import mineplex.core.hologram.HologramInteraction;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
import mineplex.core.inventory.InventoryManager;
|
import mineplex.core.inventory.InventoryManager;
|
||||||
import mineplex.core.reward.Reward;
|
import mineplex.core.reward.Reward;
|
||||||
@ -32,6 +33,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
import org.bukkit.event.inventory.InventoryOpenEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
@ -63,7 +65,20 @@ public class TreasureLocation implements Listener
|
|||||||
_hologramManager = hologramManager;
|
_hologramManager = hologramManager;
|
||||||
_statusManager = statusManager;
|
_statusManager = statusManager;
|
||||||
_currentTreasure = null;
|
_currentTreasure = null;
|
||||||
_hologram = new Hologram(_hologramManager, chestBlock.getLocation().add(0.5, 2.5, 0.5), C.cGreen + C.Bold + "Open Treasure");
|
_hologram = new Hologram(_hologramManager, chestBlock.getLocation().add(0.5, 2.5, 0.5), C.cGreen + C.Bold
|
||||||
|
+ "Open Treasure");
|
||||||
|
_hologram.setInteraction(new HologramInteraction()
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType)
|
||||||
|
{
|
||||||
|
if (clickType == ClickType.LEFT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
openShop(player);
|
||||||
|
}
|
||||||
|
});
|
||||||
setHoloChestVisible(true);
|
setHoloChestVisible(true);
|
||||||
_shop = new TreasureShop(treasureManager, _inventoryManager, clientManager, donationManager, this);
|
_shop = new TreasureShop(treasureManager, _inventoryManager, clientManager, donationManager, this);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
|
|||||||
itemIgnore.add("Proximity Zapper");
|
itemIgnore.add("Proximity Zapper");
|
||||||
|
|
||||||
ItemFactory itemFactory = new ItemFactory(plugin, blockRestore, _condition, damageManager, energy, fire, throwManager, webServerAddress, itemIgnore);
|
ItemFactory itemFactory = new ItemFactory(plugin, blockRestore, _condition, damageManager, energy, fire, throwManager, webServerAddress, itemIgnore);
|
||||||
SkillFactory skillManager = new SkillFactory(plugin, damageManager, this, _combatManager, _condition, throwManager, disguiseManager, blockRestore, fire, new Movement(plugin), teleport, energy, webServerAddress);
|
SkillFactory skillManager = new SkillFactory(plugin, damageManager, this, _combatManager, _condition, throwManager, disguiseManager, blockRestore, itemFactory.ThrownManager, fire, new Movement(plugin), teleport, energy, webServerAddress);
|
||||||
skillManager.RemoveSkill("Dwarf Toss", "Block Toss");
|
skillManager.RemoveSkill("Dwarf Toss", "Block Toss");
|
||||||
_classManager = new ClassManager(plugin, _clientManager, donationManager, skillManager, itemFactory, webServerAddress);
|
_classManager = new ClassManager(plugin, _clientManager, donationManager, skillManager, itemFactory, webServerAddress);
|
||||||
|
|
||||||
|
@ -130,8 +130,10 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
|
|
||||||
PartyManager partyManager = new PartyManager(this, portal, clientManager, preferenceManager);
|
PartyManager partyManager = new PartyManager(this, portal, clientManager, preferenceManager);
|
||||||
|
|
||||||
|
SkillConditionManager conditionManager = new SkillConditionManager(this);
|
||||||
|
|
||||||
PersonalServerManager personalServerManager = new PersonalServerManager(this, clientManager);
|
PersonalServerManager personalServerManager = new PersonalServerManager(this, clientManager);
|
||||||
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, new ConditionManager(this), disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, giveawayManager);
|
HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, inventoryManager, conditionManager, disguiseManager, new TaskManager(this, clientManager, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this, packetHandler), npcManager, personalServerManager, packetHandler, punish, serverStatusManager, giveawayManager);
|
||||||
|
|
||||||
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this, clientManager), partyManager);
|
QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this, clientManager), partyManager);
|
||||||
|
|
||||||
@ -157,9 +159,11 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
CombatManager combatManager = new CombatManager(this);
|
CombatManager combatManager = new CombatManager(this);
|
||||||
|
|
||||||
ProjectileManager throwManager = new ProjectileManager(this);
|
ProjectileManager throwManager = new ProjectileManager(this);
|
||||||
SkillConditionManager conditionManager = new SkillConditionManager(this);
|
|
||||||
|
|
||||||
DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager, conditionManager);
|
DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager, conditionManager);
|
||||||
|
conditionManager.setDamageManager(damage);
|
||||||
|
|
||||||
Fire fire = new Fire(this, conditionManager, damage);
|
Fire fire = new Fire(this, conditionManager, damage);
|
||||||
Teleport teleport = new Teleport(this);
|
Teleport teleport = new Teleport(this);
|
||||||
Energy energy = new Energy(this);
|
Energy energy = new Energy(this);
|
||||||
|
@ -67,7 +67,6 @@ import mineplex.hub.modules.NewsManager;
|
|||||||
import mineplex.hub.modules.ParkourManager;
|
import mineplex.hub.modules.ParkourManager;
|
||||||
import mineplex.hub.modules.SoccerManager;
|
import mineplex.hub.modules.SoccerManager;
|
||||||
import mineplex.hub.modules.TextManager;
|
import mineplex.hub.modules.TextManager;
|
||||||
import mineplex.hub.modules.TrickOrTreatManager;
|
|
||||||
import mineplex.hub.modules.WorldManager;
|
import mineplex.hub.modules.WorldManager;
|
||||||
import mineplex.hub.profile.gui.GUIProfile;
|
import mineplex.hub.profile.gui.GUIProfile;
|
||||||
import mineplex.hub.tutorial.TutorialManager;
|
import mineplex.hub.tutorial.TutorialManager;
|
||||||
|
@ -224,6 +224,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
UtilPlayer.message(thrower, F.main("Stacker", "You threw " + F.name(UtilEnt.getName(throwee))));
|
UtilPlayer.message(thrower, F.main("Stacker", "You threw " + F.name(UtilEnt.getName(throwee))));
|
||||||
UtilPlayer.message(throwee, F.main("Stacker", "You were thrown by " + F.name(thrower.getName())));
|
UtilPlayer.message(throwee, F.main("Stacker", "You were thrown by " + F.name(thrower.getName())));
|
||||||
|
|
||||||
|
System.out.println("Stacker throw.");
|
||||||
|
|
||||||
UtilAction.velocity(throwee, thrower.getLocation().getDirection(), 1.8, false, 0, 0.3, 2, false);
|
UtilAction.velocity(throwee, thrower.getLocation().getDirection(), 1.8, false, 0, 0.3, 2, false);
|
||||||
|
|
||||||
_projectileManager.AddThrow(throwee, thrower, this, 4000, true, false, true, false, 0.5f);
|
_projectileManager.AddThrow(throwee, thrower, this, 4000, true, false, true, false, 0.5f);
|
||||||
@ -245,6 +247,8 @@ public class StackerManager extends MiniPlugin implements IThrown
|
|||||||
if (!Manager.hasPlayerStackingEnabled(target))
|
if (!Manager.hasPlayerStackingEnabled(target))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
System.out.println("Stacker collide.");
|
||||||
|
|
||||||
//Velocity
|
//Velocity
|
||||||
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true);
|
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true);
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ public enum GameType
|
|||||||
Draw("Draw My Thing"),
|
Draw("Draw My Thing"),
|
||||||
Evolution("Evolution"),
|
Evolution("Evolution"),
|
||||||
FlappyBird("Flappy Bird"),
|
FlappyBird("Flappy Bird"),
|
||||||
|
Gladiators("Gladiators"),
|
||||||
Gravity("Gravity"),
|
Gravity("Gravity"),
|
||||||
Halloween("Halloween Horror"),
|
Halloween("Halloween Horror"),
|
||||||
HideSeek("Block Hunt"),
|
HideSeek("Block Hunt"),
|
||||||
|
@ -160,6 +160,7 @@ public class MapParser extends JavaPlugin implements Listener
|
|||||||
player.addAttachment(plugin, "worldedit.*", hasPermission);
|
player.addAttachment(plugin, "worldedit.*", hasPermission);
|
||||||
player.addAttachment(plugin, "voxelsniper.sniper", hasPermission);
|
player.addAttachment(plugin, "voxelsniper.sniper", hasPermission);
|
||||||
player.addAttachment(plugin, "voxelsniper.brush.*", hasPermission);
|
player.addAttachment(plugin, "voxelsniper.brush.*", hasPermission);
|
||||||
|
player.addAttachment(plugin, "coloredsigns.format", hasPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
_permissionMap.put(player, hasPermission);
|
_permissionMap.put(player, hasPermission);
|
||||||
|
@ -316,6 +316,11 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
|
|||||||
return _skillFactory;
|
return _skillFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemFactory GetItemFactory()
|
||||||
|
{
|
||||||
|
return _itemFactory;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClientClass AddPlayer(String player)
|
protected ClientClass AddPlayer(String player)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
package mineplex.minecraft.game.classcombat.Condition;
|
package mineplex.minecraft.game.classcombat.Condition;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.condition.ConditionEffect;
|
import mineplex.minecraft.game.core.condition.ConditionEffect;
|
||||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
|
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
|
||||||
|
@ -90,6 +90,13 @@ public class Assassin extends Skill
|
|||||||
event.AddMod(null, GetName(), -1.5, false);
|
event.AddMod(null, GetName(), -1.5, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void CancelEnergy(EnergyEvent event)
|
||||||
|
{
|
||||||
|
if (getLevel(event.GetPlayer()) > 0)
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Reset(Player player)
|
public void Reset(Player player)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package mineplex.minecraft.game.classcombat.Skill.Assassin;
|
package mineplex.minecraft.game.classcombat.Skill.Assassin;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -24,6 +26,7 @@ import mineplex.core.common.util.UtilBlock;
|
|||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
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.minecraft.game.classcombat.Skill.SkillActive;
|
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
||||||
@ -31,7 +34,7 @@ import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
|||||||
|
|
||||||
public class Evade extends SkillActive
|
public class Evade extends SkillActive
|
||||||
{
|
{
|
||||||
private HashSet<Player> _active = new HashSet<Player>();
|
private HashMap<Player, Long> _active = new HashMap<Player, Long>();
|
||||||
|
|
||||||
public Evade(SkillFactory skills, String name, ClassType classType, SkillType skillType,
|
public Evade(SkillFactory skills, String name, ClassType classType, SkillType skillType,
|
||||||
int cost, int levels,
|
int cost, int levels,
|
||||||
@ -56,12 +59,6 @@ public class Evade extends SkillActive
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String GetEnergyString()
|
|
||||||
{
|
|
||||||
return "Energy: #26#-2 and #18#-2 per Second";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean CustomCheck(Player player, int level)
|
public boolean CustomCheck(Player player, int level)
|
||||||
{
|
{
|
||||||
@ -77,36 +74,12 @@ public class Evade extends SkillActive
|
|||||||
@Override
|
@Override
|
||||||
public void Skill(Player player, int level)
|
public void Skill(Player player, int level)
|
||||||
{
|
{
|
||||||
_active.add(player);
|
_active.put(player, System.currentTimeMillis());
|
||||||
|
|
||||||
//Inform
|
//Inform
|
||||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You prepared to " + F.skill(GetName()) + "."));
|
UtilPlayer.message(player, F.main(GetClassType().name(), "You prepared to " + F.skill(GetName()) + "."));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void Energy(UpdateEvent event)
|
|
||||||
{
|
|
||||||
if (event.getType() != UpdateType.TICK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (Player cur : GetUsers())
|
|
||||||
{
|
|
||||||
if (!_active.contains(cur))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!cur.isBlocking())
|
|
||||||
{
|
|
||||||
_active.remove(cur);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Factory.Energy().Use(cur, GetName(), 0.9 - (getLevel(cur) * 0.1), true, true))
|
|
||||||
{
|
|
||||||
_active.remove(cur);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void Damage(CustomDamageEvent event)
|
public void Damage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
@ -125,7 +98,7 @@ public class Evade extends SkillActive
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//Active
|
//Active
|
||||||
if (!_active.contains(damagee))
|
if (!_active.containsKey(damagee))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Damager
|
//Damager
|
||||||
@ -136,9 +109,6 @@ public class Evade extends SkillActive
|
|||||||
int level = getLevel(damagee);
|
int level = getLevel(damagee);
|
||||||
if (level == 0) return;
|
if (level == 0) return;
|
||||||
|
|
||||||
if (!mineplex.core.recharge.Recharge.Instance.use(damagee, GetName(), 500, false, false))
|
|
||||||
return;
|
|
||||||
|
|
||||||
//Cancel
|
//Cancel
|
||||||
event.SetCancelled(GetName());
|
event.SetCancelled(GetName());
|
||||||
|
|
||||||
@ -230,4 +200,24 @@ public class Evade extends SkillActive
|
|||||||
{
|
{
|
||||||
_active.remove(player);
|
_active.remove(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void clean(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Player> activeIter = _active.keySet().iterator();
|
||||||
|
|
||||||
|
while (activeIter.hasNext())
|
||||||
|
{
|
||||||
|
Player player = activeIter.next();
|
||||||
|
|
||||||
|
if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 750))
|
||||||
|
{
|
||||||
|
activeIter.remove();
|
||||||
|
UtilPlayer.message(player, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + "."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,12 +77,6 @@ public class Illusion extends SkillActive
|
|||||||
setAchievementSkill(true);
|
setAchievementSkill(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String GetEnergyString()
|
|
||||||
{
|
|
||||||
return "Energy: #40#-3 and #12.5#-0.5 per Second";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean CustomCheck(Player player, int level)
|
public boolean CustomCheck(Player player, int level)
|
||||||
{
|
{
|
||||||
@ -107,8 +101,8 @@ public class Illusion extends SkillActive
|
|||||||
UtilEnt.Vegetate(skel);
|
UtilEnt.Vegetate(skel);
|
||||||
UtilEnt.silence(skel, true);
|
UtilEnt.silence(skel, true);
|
||||||
|
|
||||||
skel.setMaxHealth(7);
|
skel.setMaxHealth(14);
|
||||||
skel.setHealth(7);
|
skel.setHealth(14);
|
||||||
|
|
||||||
ClassCombatCreatureAllowSpawnEvent disableEvent = new ClassCombatCreatureAllowSpawnEvent(false);
|
ClassCombatCreatureAllowSpawnEvent disableEvent = new ClassCombatCreatureAllowSpawnEvent(false);
|
||||||
UtilServer.getServer().getPluginManager().callEvent(disableEvent);
|
UtilServer.getServer().getPluginManager().callEvent(disableEvent);
|
||||||
|
@ -39,8 +39,8 @@ public class Leap extends SkillActive
|
|||||||
"Take a great leap forwards.",
|
"Take a great leap forwards.",
|
||||||
"",
|
"",
|
||||||
"Wall Kick by using Leap with your",
|
"Wall Kick by using Leap with your",
|
||||||
"back against a wall. This uses no",
|
"back against a wall. This doesn't",
|
||||||
"Energy or Recharge.",
|
"trigger Leaps Recharge.",
|
||||||
"",
|
"",
|
||||||
"Cannot be used while Slowed."
|
"Cannot be used while Slowed."
|
||||||
});
|
});
|
||||||
|
@ -41,8 +41,9 @@ public class Recall extends Skill
|
|||||||
{
|
{
|
||||||
"Drop Axe/Sword to Use.",
|
"Drop Axe/Sword to Use.",
|
||||||
"",
|
"",
|
||||||
"Instantly teleport back to where",
|
"Go back in time #2#2 seconds,",
|
||||||
"you were #2#2 seconds ago.",
|
"restoring your location and",
|
||||||
|
"up to #3#1 health."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +86,8 @@ public class Recall extends Skill
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//Heal
|
//Heal
|
||||||
player.setHealth(health.getLast());
|
double newHealth = Math.min(health.getLast(), player.getHealth() + 3 + level);
|
||||||
|
player.setHealth(newHealth);
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
|
player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
|
||||||
|
@ -22,7 +22,8 @@ public class ViperStrikes extends Skill
|
|||||||
SetDesc(new String[]
|
SetDesc(new String[]
|
||||||
{
|
{
|
||||||
"Your attacks give enemies",
|
"Your attacks give enemies",
|
||||||
"Poison 1 for #1#2 seconds."
|
"Shock, Slow 1 and Poison 1",
|
||||||
|
"for #0#1 seconds."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,10 +49,8 @@ public class ViperStrikes extends Skill
|
|||||||
if (damagee == null) return;
|
if (damagee == null) return;
|
||||||
|
|
||||||
//Confuse
|
//Confuse
|
||||||
Factory.Condition().Factory().Poison(GetName(), damagee, damager, 1 + 2*level, 0, false, false, false);
|
Factory.Condition().Factory().PoisonShock(GetName(), damagee, damager, level, false);
|
||||||
|
Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, 0, false, false, true, false);
|
||||||
//Damage
|
|
||||||
//event.AddMod(damager.getName(), GetName(), -1 - level, true);
|
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f);
|
damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f);
|
||||||
|
@ -64,7 +64,7 @@ public class BlockToss extends SkillCharge implements IThrown
|
|||||||
@Override
|
@Override
|
||||||
public String GetRechargeString()
|
public String GetRechargeString()
|
||||||
{
|
{
|
||||||
return "Recharge: " + "#" + UtilMath.trim(1, 4000/1000d) + "#" + UtilMath.trim(1, -500/1000d) + " Seconds";
|
return "Recharge: " + "#4#-0.5 Seconds";
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -92,6 +92,10 @@ public class BlockToss extends SkillCharge implements IThrown
|
|||||||
int level = getLevel(player);
|
int level = getLevel(player);
|
||||||
if (level == 0) return;
|
if (level == 0) return;
|
||||||
|
|
||||||
|
//Recharge
|
||||||
|
if (!Recharge.Instance.usable(player, GetName()))
|
||||||
|
return;
|
||||||
|
|
||||||
//Water
|
//Water
|
||||||
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
|
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
|
||||||
{
|
{
|
||||||
@ -101,10 +105,6 @@ public class BlockToss extends SkillCharge implements IThrown
|
|||||||
|
|
||||||
Block grab = event.getClickedBlock();
|
Block grab = event.getClickedBlock();
|
||||||
|
|
||||||
//Recharge
|
|
||||||
if (!Recharge.Instance.use(player, GetName(), 1000, false, false))
|
|
||||||
return;
|
|
||||||
|
|
||||||
//Door and Banner
|
//Door and Banner
|
||||||
if (grab.getRelative(BlockFace.UP).getTypeId() == 64 || grab.getRelative(BlockFace.UP).getTypeId() == 71 || grab.getRelative(BlockFace.UP).getType() == Material.STANDING_BANNER)
|
if (grab.getRelative(BlockFace.UP).getTypeId() == 64 || grab.getRelative(BlockFace.UP).getTypeId() == 71 || grab.getRelative(BlockFace.UP).getType() == Material.STANDING_BANNER)
|
||||||
{
|
{
|
||||||
@ -202,6 +202,9 @@ public class BlockToss extends SkillCharge implements IThrown
|
|||||||
|
|
||||||
for (Player cur : throwSet)
|
for (Player cur : throwSet)
|
||||||
{
|
{
|
||||||
|
Recharge.Instance.recharge(cur, GetName());
|
||||||
|
Recharge.Instance.use(cur, GetName(), 4000 - (500 * getLevel(cur)), false, true);
|
||||||
|
|
||||||
FallingBlock block = _holding.remove(cur);
|
FallingBlock block = _holding.remove(cur);
|
||||||
float charge = _charge.remove(cur);
|
float charge = _charge.remove(cur);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class Colossus extends Skill
|
|||||||
|
|
||||||
//Damage
|
//Damage
|
||||||
event.AddMod(damagee.getName(), GetName(), 0, false);
|
event.AddMod(damagee.getName(), GetName(), 0, false);
|
||||||
event.AddKnockback(GetName(), 0.35);
|
event.AddKnockback(GetName(), 0.65);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleExitEvent;
|
import org.bukkit.event.vehicle.VehicleExitEvent;
|
||||||
|
import org.spigotmc.event.entity.EntityDismountEvent;
|
||||||
|
|
||||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
@ -115,19 +116,23 @@ public class DwarfToss extends SkillActive
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//getEntity is the vehicle
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void PreventDismount(VehicleExitEvent event)
|
public void PreventDismount(EntityDismountEvent event)
|
||||||
{
|
{
|
||||||
if (event.isCancelled())
|
if (event.isCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(event.getExited() instanceof Player))
|
System.out.println(UtilEnt.getName(event.getDismounted()));
|
||||||
|
System.out.println(UtilEnt.getName(event.getEntity()));
|
||||||
|
|
||||||
|
if (!(event.getDismounted() instanceof Player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(event.getVehicle() instanceof Player))
|
if (!(event.getEntity() instanceof Player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_holding.containsKey((Player)event.getVehicle()) && _holding.get((Player)event.getVehicle()) == event.getExited())
|
if (_holding.containsKey((Player)event.getEntity()) && _holding.get((Player)event.getEntity()) == event.getDismounted())
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public class HoldPosition extends SkillActive
|
|||||||
SetDesc(new String[]
|
SetDesc(new String[]
|
||||||
{
|
{
|
||||||
"Hold your position, gaining",
|
"Hold your position, gaining",
|
||||||
"Protection 3, Slow 4 and no",
|
"Protection 3, Slow 3 and no",
|
||||||
"knockback for #3#1 seconds."
|
"knockback for #3#1 seconds."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public class HoldPosition extends SkillActive
|
|||||||
//Action
|
//Action
|
||||||
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 2, false, true, false, true);
|
Factory.Condition().Factory().Slow(GetName(), player, player, duration, 2, false, true, false, true);
|
||||||
Factory.Condition().Factory().Protection(GetName(), player, player, duration, 2, false, false, true);
|
Factory.Condition().Factory().Protection(GetName(), player, player, duration, 2, false, false, true);
|
||||||
Factory.Condition().Factory().Jump(GetName(), player, player, duration, 250, false, false, true);
|
Factory.Condition().Factory().ArcadeHungerDisable(GetName(), player, player, duration, false);
|
||||||
|
|
||||||
//Inform
|
//Inform
|
||||||
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
|
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
|
||||||
@ -119,6 +119,9 @@ public class HoldPosition extends SkillActive
|
|||||||
UtilParticle.PlayParticle(ParticleType.MOB_SPELL, player.getLocation(),
|
UtilParticle.PlayParticle(ParticleType.MOB_SPELL, player.getLocation(),
|
||||||
(float)(Math.random() - 0.5), 0.2f + (float)(Math.random() * 1), (float)(Math.random() - 0.5), 0, 3 + getLevel(player),
|
(float)(Math.random() - 0.5), 0.2f + (float)(Math.random() * 1), (float)(Math.random() - 0.5), 0, 3 + getLevel(player),
|
||||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
player.setFoodLevel(2);
|
||||||
|
player.setSprinting(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ public class Riposte extends SkillActive
|
|||||||
//Effect
|
//Effect
|
||||||
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f);
|
damager.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f);
|
||||||
|
|
||||||
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.4, false, false);
|
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.3, false, false);
|
||||||
|
|
||||||
//Inform
|
//Inform
|
||||||
UtilPlayer.message(damagee, F.main(GetClassType().name(), "You parried with " + F.skill(GetName(level)) + "."));
|
UtilPlayer.message(damagee, F.main(GetClassType().name(), "You parried with " + F.skill(GetName(level)) + "."));
|
||||||
|
@ -214,7 +214,7 @@ public class Immolate extends Skill
|
|||||||
|
|
||||||
Item fire = cur.getWorld().dropItem(cur.getLocation().add(0, 0.5, 0), itemStack);
|
Item fire = cur.getWorld().dropItem(cur.getLocation().add(0, 0.5, 0), itemStack);
|
||||||
fire.setVelocity(new Vector((Math.random() - 0.5)/3,Math.random()/3,(Math.random() - 0.5)/3));
|
fire.setVelocity(new Vector((Math.random() - 0.5)/3,Math.random()/3,(Math.random() - 0.5)/3));
|
||||||
Factory.Fire().Add(fire, cur, 2, 0, 0.25 + (level * 0.25), 0, GetName());
|
Factory.Fire().Add(fire, cur, 2, 0, 0.25 + (level * 0.25), 0, GetName(), false);
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
cur.getWorld().playSound(cur.getLocation(), Sound.FIZZ, 0.2f, 1f);
|
cur.getWorld().playSound(cur.getLocation(), Sound.FIZZ, 0.2f, 1f);
|
||||||
|
@ -113,7 +113,7 @@ public class Inferno extends SkillActive
|
|||||||
itemStack.setItemMeta(meta);
|
itemStack.setItemMeta(meta);
|
||||||
|
|
||||||
Item fire = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), itemStack);
|
Item fire = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), itemStack);
|
||||||
Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName());
|
Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), 1, GetName(), false);
|
||||||
|
|
||||||
fire.teleport(cur.getEyeLocation());
|
fire.teleport(cur.getEyeLocation());
|
||||||
double x = 0.07 - (UtilMath.r(14)/100d);
|
double x = 0.07 - (UtilMath.r(14)/100d);
|
||||||
|
@ -18,17 +18,12 @@ import mineplex.core.common.util.F;
|
|||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.projectile.IThrown;
|
import mineplex.core.projectile.IThrown;
|
||||||
import mineplex.core.projectile.ProjectileUser;
|
import mineplex.core.projectile.ProjectileUser;
|
||||||
import mineplex.core.recharge.Recharge;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
|
||||||
import mineplex.minecraft.game.core.condition.Condition;
|
|
||||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
|
||||||
|
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ public class Disengage extends SkillActive
|
|||||||
|
|
||||||
//Condition
|
//Condition
|
||||||
Factory.Condition().Factory().Slow(GetName(), damager, damagee, 2.5 + (0.5 * level), 3, false, true, true, true);
|
Factory.Condition().Factory().Slow(GetName(), damager, damagee, 2.5 + (0.5 * level), 3, false, true, true, true);
|
||||||
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 1, false, false);
|
Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 0.3, false, false);
|
||||||
|
|
||||||
_fall.put(damagee, System.currentTimeMillis());
|
_fall.put(damagee, System.currentTimeMillis());
|
||||||
|
|
||||||
|
@ -61,7 +61,9 @@ public class HealingShot extends SkillActive
|
|||||||
"Regeneration 3 for #3#1 seconds,",
|
"Regeneration 3 for #3#1 seconds,",
|
||||||
"and remove all negative effects.",
|
"and remove all negative effects.",
|
||||||
"",
|
"",
|
||||||
"Gives Nausea to enemies for #5#1 seconds."
|
"Self hits give Regeneration 2.",
|
||||||
|
"",
|
||||||
|
"Gives Nausea to enemies for #5#1 seconds.",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,9 +155,9 @@ public class HealingShot extends SkillActive
|
|||||||
projectile.remove();
|
projectile.remove();
|
||||||
|
|
||||||
//Regen
|
//Regen
|
||||||
if (Factory.Relation().canHurt(damager, damagee))
|
if (!Factory.Relation().canHurt(damager, damagee) || damager.equals(damagee))
|
||||||
{
|
{
|
||||||
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, 2, false, false, false);
|
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, damager.equals(damagee) ? 1 : 2, false, false, false);
|
||||||
|
|
||||||
//Remove Bad
|
//Remove Bad
|
||||||
damagee.setFireTicks(0);
|
damagee.setFireTicks(0);
|
||||||
|
@ -40,8 +40,9 @@ public class HeavyArrows extends Skill
|
|||||||
"an additional #10#10 % knockback",
|
"an additional #10#10 % knockback",
|
||||||
"as well as #1#1 additional damage.",
|
"as well as #1#1 additional damage.",
|
||||||
"",
|
"",
|
||||||
"You also receive #10#10 % knockback",
|
"You also receive #12#6 % reversed",
|
||||||
"when firing arrows if not sneaking.",
|
"velocity of your arrows while not",
|
||||||
|
"sneaking.",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ public class HeavyArrows extends Skill
|
|||||||
//Backboost
|
//Backboost
|
||||||
if (!player.isSneaking() && Recharge.Instance.use(player, GetName(), 750, false, false))
|
if (!player.isSneaking() && Recharge.Instance.use(player, GetName(), 750, false, false))
|
||||||
{
|
{
|
||||||
double vel = (event.getProjectile().getVelocity().length() * (0.1 + 0.1 * level));
|
double vel = (event.getProjectile().getVelocity().length() * (0.12 + 0.06 * level));
|
||||||
UtilAction.velocity(player, player.getLocation().getDirection().multiply(-1), vel,
|
UtilAction.velocity(player, player.getLocation().getDirection().multiply(-1), vel,
|
||||||
false, 0, 0.3, 0.6, true);
|
false, 0, 0.3, 0.6, true);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public class Longshot extends Skill
|
|||||||
SetDesc(new String[]
|
SetDesc(new String[]
|
||||||
{
|
{
|
||||||
"Arrows do an additional 1 damage",
|
"Arrows do an additional 1 damage",
|
||||||
"for every #4#-0.5 Blocks they travelled,",
|
"for every #4.5#-0.5 Blocks they travelled,",
|
||||||
"however, their base damage is",
|
"however, their base damage is",
|
||||||
"reduced by 5.",
|
"reduced by 5.",
|
||||||
"",
|
"",
|
||||||
@ -74,7 +74,7 @@ public class Longshot extends Skill
|
|||||||
double length = UtilMath.offset(loc, projectile.getLocation());
|
double length = UtilMath.offset(loc, projectile.getLocation());
|
||||||
|
|
||||||
// Damage
|
// Damage
|
||||||
double damage = Math.min(6 + 6 * level, (length / (4 - 0.5 * level)) - 5);
|
double damage = Math.min(6 + 6 * level, (length / (4.5 - 0.5 * level)) - 5);
|
||||||
|
|
||||||
if (damage < 0)
|
if (damage < 0)
|
||||||
damage = 0;
|
damage = 0;
|
||||||
|
@ -151,12 +151,12 @@ public class NapalmShot extends SkillActive
|
|||||||
projectile.remove();
|
projectile.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority=EventPriority.MONITOR) //make it happen after the damage event ^
|
||||||
public void projectileHit(ProjectileHitEvent event)
|
public void projectileHit(ProjectileHitEvent event)
|
||||||
{
|
{
|
||||||
Projectile proj = event.getEntity();
|
Projectile proj = event.getEntity();
|
||||||
|
|
||||||
if (!_arrows.remove(proj))
|
if (!_arrows.contains(proj))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (proj.getShooter() == null)
|
if (proj.getShooter() == null)
|
||||||
@ -179,7 +179,7 @@ public class NapalmShot extends SkillActive
|
|||||||
itemStack.setItemMeta(meta);
|
itemStack.setItemMeta(meta);
|
||||||
|
|
||||||
Item fire = proj.getWorld().dropItemNaturally(proj.getLocation(), itemStack);
|
Item fire = proj.getWorld().dropItemNaturally(proj.getLocation(), itemStack);
|
||||||
Factory.Fire().Add(fire, damager, 16, 0.25, 2, 0, GetName());
|
Factory.Fire().Add(fire, damager, 16, 0.25, 2, 0.25, GetName(), true);
|
||||||
fire.setVelocity(fire.getVelocity().multiply(1 + (0.15 * level)));
|
fire.setVelocity(fire.getVelocity().multiply(1 + (0.15 * level)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class Overcharge extends SkillChargeBow
|
|||||||
@Override
|
@Override
|
||||||
public void DoSkillCustom(Player player, float charge, Arrow arrow)
|
public void DoSkillCustom(Player player, float charge, Arrow arrow)
|
||||||
{
|
{
|
||||||
double damage = charge * (getLevel(player));
|
double damage = charge * (1.5 + 1.5 * getLevel(player));
|
||||||
_arrows.put(arrow, damage);
|
_arrows.put(arrow, damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
|||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -78,25 +79,26 @@ public class Sharpshooter extends Skill
|
|||||||
if (event.GetDamagerEntity(true) != null && event.GetDamagerEntity(true).equals(event.GetDamageeEntity()))
|
if (event.GetDamagerEntity(true) != null && event.GetDamagerEntity(true).equals(event.GetDamageeEntity()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int bonus = 1;
|
int bonus = 0;
|
||||||
if (_hitCount.containsKey(player))
|
if (_hitCount.containsKey(player))
|
||||||
bonus = _hitCount.get(player);
|
bonus = _hitCount.get(player);
|
||||||
|
|
||||||
|
//Increase
|
||||||
|
bonus = Math.min(bonus + 1, 2 * level);
|
||||||
|
_hitCount.put(player, bonus);
|
||||||
|
|
||||||
//Damage
|
//Damage
|
||||||
event.AddMod(player.getName(), GetName(), bonus, true);
|
event.AddMod(player.getName(), GetName(), bonus, true);
|
||||||
|
|
||||||
//Increase
|
|
||||||
bonus = Math.min(bonus + 1, 2 * level);
|
|
||||||
|
|
||||||
_hitCount.put(player, bonus);
|
|
||||||
|
|
||||||
//Inform
|
//Inform
|
||||||
UtilPlayer.message((Entity)projectile.getShooter(), F.main(GetClassType().name(), GetName() + ": " +
|
UtilPlayer.message(event.GetDamagerPlayer(true), F.main(GetClassType().name(), GetName() + ": " +
|
||||||
F.elem(bonus + " Consecutive Hits") + C.cGray + " (" + F.skill("+" + bonus + "Damage" ) + C.cGray + ")" ) );
|
F.elem(bonus + " Consecutive Hits") + C.cGray + " (" + F.skill("+" + bonus + " Damage" ) + C.cGray + ")" ) );
|
||||||
|
|
||||||
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 0.8f + (float)(bonus * 0.2));
|
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 0.8f + (float)(bonus * 0.2));
|
||||||
|
|
||||||
projectile.remove();
|
projectile.remove();
|
||||||
|
|
||||||
|
Recharge.Instance.useForce(player, GetName() + " Timer", 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -38,7 +38,7 @@ public class VitalitySpores extends Skill
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void playerMove(PlayerMoveEvent event)
|
public void playerMove(PlayerMoveEvent event)
|
||||||
{
|
{
|
||||||
if (UtilMath.offset(event.getFrom(), event.getTo()) > 0)
|
if (doesUserHaveSkill(event.getPlayer()) && UtilMath.offset(event.getFrom(), event.getTo()) > 0)
|
||||||
_lastMove.put(event.getPlayer(), System.currentTimeMillis());
|
_lastMove.put(event.getPlayer(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +71,6 @@ public class VitalitySpores extends Skill
|
|||||||
@Override
|
@Override
|
||||||
public void Reset(Player player)
|
public void Reset(Player player)
|
||||||
{
|
{
|
||||||
|
_lastMove.remove(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ public class WolfsPounce extends SkillChargeSword
|
|||||||
"Taking damage cancels charge.",
|
"Taking damage cancels charge.",
|
||||||
"",
|
"",
|
||||||
"Colliding with another player",
|
"Colliding with another player",
|
||||||
"mid-air deals up to 6 damage",
|
"mid-air deals up to #4#1 damage",
|
||||||
"and Slow 2 for 3 seconds."
|
"and Slow 2 for 3 seconds."
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -61,7 +61,7 @@ public class WolfsPounce extends SkillChargeSword
|
|||||||
public void DoSkillCustom(Player player, float charge)
|
public void DoSkillCustom(Player player, float charge)
|
||||||
{
|
{
|
||||||
//Action
|
//Action
|
||||||
UtilAction.velocity(player, 0.4 + (1.4*charge), 0.2, 0.3 + (0.8*charge), true);
|
UtilAction.velocity(player, 0.4 + (1.4*charge), 0.2, 0.4 + (0.9*charge), true);
|
||||||
_live.put(player, System.currentTimeMillis());
|
_live.put(player, System.currentTimeMillis());
|
||||||
|
|
||||||
//Inform
|
//Inform
|
||||||
@ -128,7 +128,7 @@ public class WolfsPounce extends SkillChargeSword
|
|||||||
if (_chargeStore.containsKey(damager))
|
if (_chargeStore.containsKey(damager))
|
||||||
charge = _chargeStore.remove(damager);
|
charge = _chargeStore.remove(damager);
|
||||||
|
|
||||||
int damage = (int)(6 * charge);
|
int damage = (int)((4 + getLevel(damager)) * charge);
|
||||||
|
|
||||||
//Damage Event
|
//Damage Event
|
||||||
Factory.Damage().NewDamageEvent(damagee, damager, null,
|
Factory.Damage().NewDamageEvent(damagee, damager, null,
|
||||||
|
@ -257,6 +257,11 @@ public abstract class Skill implements ISkill, Listener
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean doesUserHaveSkill(Player player)
|
||||||
|
{
|
||||||
|
return _users.containsKey(player);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<Player> GetUsers()
|
public Set<Player> GetUsers()
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.blockrestore.BlockRestore;
|
import mineplex.core.blockrestore.BlockRestore;
|
||||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
|
||||||
import mineplex.core.disguise.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
import mineplex.core.donation.repository.GameSalesPackageToken;
|
import mineplex.core.donation.repository.GameSalesPackageToken;
|
||||||
import mineplex.core.energy.Energy;
|
import mineplex.core.energy.Energy;
|
||||||
@ -18,17 +17,91 @@ import mineplex.core.teleport.Teleport;
|
|||||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
|
||||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.ISkill.SkillType;
|
import mineplex.minecraft.game.classcombat.Skill.ISkill.SkillType;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Brute.*;
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.Assassin;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Assassin.*;
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.BackStab;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Global.*;
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.Blink;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Knight.*;
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.ComboAttack;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Mage.*;
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.Evade;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.Flash;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.Illusion;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.Leap;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.MarkedForDeath;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.Recall;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.ShockingStrikes;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.SilencingArrow;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.SmokeArrow;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.SmokeBomb;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Assassin.ViperStrikes;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.BlockToss;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.Bloodlust;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.Brute;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.Colossus;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.CripplingBlow;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.DwarfToss;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.FleshHook;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.Intimidation;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.Overwhelm;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.SeismicSlam;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.Stampede;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.Takedown;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Brute.WhirlwindAxe;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Global.BreakFall;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Global.Fitness;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Global.Recharge;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Global.Resistance;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.AxeThrow;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.BullsCharge;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.Cleave;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.DefensiveStance;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.Deflection;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.Fortitude;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.HiltSmash;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.HoldPosition;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.Knight;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.LevelField;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.Riposte;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.ShieldSmash;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.Swordsmanship;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Knight.Vengeance;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.ArcticArmor;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.Blizzard;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.FireBlast;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.Fissure;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.GlacialBlade;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.IcePrison;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.Immolate;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.Inferno;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.LifeBonds;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.LightningOrb;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.Mage;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.MagmaBlade;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.NullBlade;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.Rupture;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Mage.StaticLazer;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Mage.Void;
|
import mineplex.minecraft.game.classcombat.Skill.Mage.Void;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Ranger.*;
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.Agility;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.BarbedArrows;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.Barrage;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.Disengage;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.ExplosiveShot;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.HealingShot;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.HeavyArrows;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.Longshot;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.NapalmShot;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.Overcharge;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.PinDown;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.Ranger;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.RopedArrow;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.Sharpshooter;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.VitalitySpores;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.WolfsFury;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.Ranger.WolfsPounce;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.repository.SkillRepository;
|
import mineplex.minecraft.game.classcombat.Skill.repository.SkillRepository;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.repository.token.SkillToken;
|
import mineplex.minecraft.game.classcombat.Skill.repository.token.SkillToken;
|
||||||
|
import mineplex.minecraft.game.classcombat.item.Throwable.ProximityManager;
|
||||||
import mineplex.minecraft.game.core.IRelation;
|
import mineplex.minecraft.game.core.IRelation;
|
||||||
import mineplex.minecraft.game.core.combat.CombatManager;
|
import mineplex.minecraft.game.core.combat.CombatManager;
|
||||||
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||||
import mineplex.minecraft.game.core.damage.DamageManager;
|
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||||
import mineplex.minecraft.game.core.fire.Fire;
|
import mineplex.minecraft.game.core.fire.Fire;
|
||||||
|
|
||||||
@ -163,14 +236,14 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
//Sword
|
//Sword
|
||||||
AddSkill(new Evade(this, "Evade", ClassType.Assassin, SkillType.Sword,
|
AddSkill(new Evade(this, "Evade", ClassType.Assassin, SkillType.Sword,
|
||||||
1, 4,
|
1, 4,
|
||||||
26, -2,
|
0, 0,
|
||||||
0, 0, true,
|
6500, -500, true,
|
||||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
|
AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword,
|
||||||
1, 4,
|
1, 4,
|
||||||
50, -4,
|
0, 0,
|
||||||
17000, -1000, true,
|
17000, -1000, true,
|
||||||
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
@ -178,21 +251,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
//Axe
|
//Axe
|
||||||
AddSkill(new Blink(this, "Blink", ClassType.Assassin, SkillType.Axe,
|
AddSkill(new Blink(this, "Blink", ClassType.Assassin, SkillType.Axe,
|
||||||
1, 4,
|
1, 4,
|
||||||
64, -4,
|
0, 0,
|
||||||
12000, 0, true,
|
12000, 0, true,
|
||||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
AddSkill(new Flash(this, "Flash", ClassType.Assassin, SkillType.Axe,
|
AddSkill(new Flash(this, "Flash", ClassType.Assassin, SkillType.Axe,
|
||||||
1, 4,
|
1, 4,
|
||||||
30, -2,
|
0, 0,
|
||||||
0, 0, true,
|
0, 0, true,
|
||||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
AddSkill(new Leap(this, "Leap", ClassType.Assassin, SkillType.Axe,
|
AddSkill(new Leap(this, "Leap", ClassType.Assassin, SkillType.Axe,
|
||||||
1, 4,
|
1, 4,
|
||||||
36, -3,
|
0, 0,
|
||||||
10500, -1500, true,
|
10500, -1500, true,
|
||||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
@ -200,21 +273,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
//Bow
|
//Bow
|
||||||
AddSkill(new MarkedForDeath(this, "Marked for Death", ClassType.Assassin, SkillType.Bow,
|
AddSkill(new MarkedForDeath(this, "Marked for Death", ClassType.Assassin, SkillType.Bow,
|
||||||
1, 4,
|
1, 4,
|
||||||
40, 0,
|
0, 0,
|
||||||
20000, -2000, true,
|
20000, -2000, true,
|
||||||
new Material[] {Material.BOW},
|
new Material[] {Material.BOW},
|
||||||
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||||
|
|
||||||
AddSkill(new SmokeArrow(this, "Smoke Arrow", ClassType.Assassin, SkillType.Bow,
|
AddSkill(new SmokeArrow(this, "Smoke Arrow", ClassType.Assassin, SkillType.Bow,
|
||||||
1, 4,
|
1, 4,
|
||||||
40, 0,
|
0, 0,
|
||||||
20000, -2000, true,
|
20000, -2000, true,
|
||||||
new Material[] {Material.BOW},
|
new Material[] {Material.BOW},
|
||||||
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||||
|
|
||||||
AddSkill(new SilencingArrow(this, "Silencing Arrow", ClassType.Assassin, SkillType.Bow,
|
AddSkill(new SilencingArrow(this, "Silencing Arrow", ClassType.Assassin, SkillType.Bow,
|
||||||
1, 4,
|
1, 4,
|
||||||
40, 0,
|
0, 0,
|
||||||
20000, -2000, true,
|
20000, -2000, true,
|
||||||
new Material[] {Material.BOW},
|
new Material[] {Material.BOW},
|
||||||
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
new Action[] {Action.LEFT_CLICK_AIR, Action.LEFT_CLICK_BLOCK}));
|
||||||
@ -257,21 +330,21 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
AddSkill(new SeismicSlam(this, "Seismic Slam", ClassType.Brute, SkillType.Axe,
|
AddSkill(new SeismicSlam(this, "Seismic Slam", ClassType.Brute, SkillType.Axe,
|
||||||
1, 5,
|
1, 5,
|
||||||
0, 0,
|
0, 0,
|
||||||
24000, -2000, true,
|
21000, -1000, true,
|
||||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
AddSkill(new Takedown(this, "Takedown", ClassType.Brute, SkillType.Axe,
|
AddSkill(new Takedown(this, "Takedown", ClassType.Brute, SkillType.Axe,
|
||||||
1, 5,
|
1, 5,
|
||||||
0, 0,
|
0, 0,
|
||||||
24000, -2000, true,
|
21000, -1000, true,
|
||||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
AddSkill(new WhirlwindAxe(this, "Whirlwind Axe", ClassType.Brute, SkillType.Axe,
|
AddSkill(new WhirlwindAxe(this, "Whirlwind Axe", ClassType.Brute, SkillType.Axe,
|
||||||
1, 5,
|
1, 5,
|
||||||
0, 0,
|
0, 0,
|
||||||
24000, -2000, true,
|
21000, -1000, true,
|
||||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
@ -338,7 +411,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
|
|||||||
AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe,
|
AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe,
|
||||||
1, 5,
|
1, 5,
|
||||||
0, 0,
|
0, 0,
|
||||||
2200, -200, true,
|
3300, -300, true,
|
||||||
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE},
|
||||||
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK}));
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
|
|||||||
private Energy _energy;
|
private Energy _energy;
|
||||||
private Fire _fire;
|
private Fire _fire;
|
||||||
private ProjectileManager _projectileManager;
|
private ProjectileManager _projectileManager;
|
||||||
|
private ProximityManager _proxyManager;
|
||||||
private java.lang.reflect.Field _itemMaxDurability;
|
private java.lang.reflect.Field _itemMaxDurability;
|
||||||
private HashMap<String, Item> _items;
|
private HashMap<String, Item> _items;
|
||||||
private HashSet<String> _ignore;
|
private HashSet<String> _ignore;
|
||||||
@ -47,6 +48,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
|
|||||||
_energy = energy;
|
_energy = energy;
|
||||||
_fire = fire;
|
_fire = fire;
|
||||||
_projectileManager = projectileManager;
|
_projectileManager = projectileManager;
|
||||||
|
_proxyManager = new ProximityManager();
|
||||||
|
|
||||||
_items = new HashMap<String, Item>();
|
_items = new HashMap<String, Item>();
|
||||||
_ignore = ignore;
|
_ignore = ignore;
|
||||||
@ -240,6 +242,8 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
|
|||||||
|
|
||||||
for (Item item : _items.values())
|
for (Item item : _items.values())
|
||||||
registerEvents(item);
|
registerEvents(item);
|
||||||
|
|
||||||
|
registerEvents(_proxyManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -249,5 +253,12 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
|
|||||||
|
|
||||||
for (Item item : _items.values())
|
for (Item item : _items.values())
|
||||||
HandlerList.unregisterAll(item);
|
HandlerList.unregisterAll(item);
|
||||||
|
|
||||||
|
HandlerList.unregisterAll(_proxyManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProximityManager getProximityManager()
|
||||||
|
{
|
||||||
|
return _proxyManager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
package mineplex.minecraft.game.classcombat.item;
|
package mineplex.minecraft.game.classcombat.item;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEvent;
|
||||||
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
|
import mineplex.core.common.util.UtilGear;
|
||||||
|
import mineplex.core.common.util.UtilInv;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.projectile.IThrown;
|
||||||
|
import mineplex.core.projectile.ProjectileUser;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -9,21 +21,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilAction;
|
|
||||||
import mineplex.core.common.util.UtilBlock;
|
|
||||||
import mineplex.core.common.util.UtilEvent;
|
|
||||||
import mineplex.core.common.util.UtilGear;
|
|
||||||
import mineplex.core.common.util.UtilInv;
|
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
|
||||||
import mineplex.core.projectile.IThrown;
|
|
||||||
import mineplex.core.projectile.ProjectileUser;
|
|
||||||
import mineplex.core.recharge.Recharge;
|
|
||||||
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
|
|
||||||
import mineplex.minecraft.game.classcombat.item.Item;
|
|
||||||
import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
|
||||||
import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
|
|
||||||
|
|
||||||
public abstract class ItemUsable extends Item implements IThrown
|
public abstract class ItemUsable extends Item implements IThrown
|
||||||
{
|
{
|
||||||
private ActionType _useAction;
|
private ActionType _useAction;
|
||||||
|
@ -2,9 +2,10 @@ package mineplex.minecraft.game.classcombat.item.Throwable;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -34,6 +35,7 @@ import mineplex.core.common.util.UtilParticle.ParticleType;
|
|||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
||||||
import mineplex.minecraft.game.classcombat.item.ItemUsable;
|
import mineplex.minecraft.game.classcombat.item.ItemUsable;
|
||||||
|
import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent;
|
||||||
|
|
||||||
public class ProximityExplosive extends ItemUsable
|
public class ProximityExplosive extends ItemUsable
|
||||||
{
|
{
|
||||||
@ -66,6 +68,13 @@ public class ProximityExplosive extends ItemUsable
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ThrowCustom(PlayerInteractEvent event, org.bukkit.entity.Item ent)
|
||||||
|
{
|
||||||
|
ProximityUseEvent useEvent = new ProximityUseEvent(event.getPlayer(), this, ent);
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(useEvent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||||
{
|
{
|
||||||
@ -161,17 +170,20 @@ public class ProximityExplosive extends ItemUsable
|
|||||||
if (event.getType() != UpdateType.FAST)
|
if (event.getType() != UpdateType.FAST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HashSet<Entity> expired = new HashSet<Entity>();
|
Iterator<Entity> armedIter = _armed.keySet().iterator();
|
||||||
|
|
||||||
for (Entity ent : _armed.keySet())
|
while (armedIter.hasNext())
|
||||||
{
|
{
|
||||||
|
Entity ent = armedIter.next();
|
||||||
|
|
||||||
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 3600)
|
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 3600)
|
||||||
expired.add(ent);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Entity ent : expired)
|
|
||||||
{
|
{
|
||||||
Detonate(ent);
|
UtilParticle.PlayParticle(ParticleType.EXPLODE, ent.getLocation(), 0.1f, 0.1f, 0.1f, 0, 10,
|
||||||
|
ViewDist.MAX, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
ent.remove();
|
||||||
|
armedIter.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,104 @@
|
|||||||
|
package mineplex.minecraft.game.classcombat.item.Throwable;
|
||||||
|
|
||||||
|
import java.util.AbstractMap;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
public class ProximityManager implements Listener
|
||||||
|
{
|
||||||
|
private int _proxyLimit = 6;
|
||||||
|
|
||||||
|
private HashMap<Player, ArrayList<Entry<String, Entity>>> _proxyMap = new HashMap<Player, ArrayList<Entry<String, Entity>>>();
|
||||||
|
|
||||||
|
public void setProxyLimit(int limit)
|
||||||
|
{
|
||||||
|
_proxyLimit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
|
public void proximityThrownEvent(ProximityUseEvent event)
|
||||||
|
{
|
||||||
|
//Don't bother if the proxy has been disallowed
|
||||||
|
if (!event.getEntity().isValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!_proxyMap.containsKey(event.getPlayer()))
|
||||||
|
_proxyMap.put(event.getPlayer(), new ArrayList<Entry<String,Entity>>());
|
||||||
|
|
||||||
|
ArrayList<Entry<String, Entity>> proxies = _proxyMap.get(event.getPlayer());
|
||||||
|
|
||||||
|
//Store New
|
||||||
|
proxies.add(new AbstractMap.SimpleEntry<String, Entity>(event.getItemType().GetName(), event.getEntity()));
|
||||||
|
|
||||||
|
//Clean Excess
|
||||||
|
while (proxies.size() > _proxyLimit)
|
||||||
|
{
|
||||||
|
Entry<String, Entity> entry = proxies.remove(0);
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Game", "Your old " + entry.getKey() + " was removed. Limit of " + _proxyLimit + "."));
|
||||||
|
entry.getValue().remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void clean(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
clean(null, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clean(Location loc, int radius)
|
||||||
|
{
|
||||||
|
Iterator<Player> playerIter = _proxyMap.keySet().iterator();
|
||||||
|
|
||||||
|
while (playerIter.hasNext())
|
||||||
|
{
|
||||||
|
Player player = playerIter.next();
|
||||||
|
|
||||||
|
//Clean Offline Players
|
||||||
|
if (!player.isOnline())
|
||||||
|
{
|
||||||
|
playerIter.remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<Entry<String,Entity>> proxies = _proxyMap.get(player);
|
||||||
|
|
||||||
|
Iterator<Entry<String,Entity>> proxyIter = proxies.iterator();
|
||||||
|
|
||||||
|
//Clean Dead Proxies
|
||||||
|
while (proxyIter.hasNext())
|
||||||
|
{
|
||||||
|
Entry<String,Entity> proxy = proxyIter.next();
|
||||||
|
|
||||||
|
if (!proxy.getValue().isValid() || //Dead
|
||||||
|
(loc != null && UtilMath.offset(proxy.getValue().getLocation(), loc) < radius)) //Around Radius
|
||||||
|
{
|
||||||
|
proxy.getValue().remove();
|
||||||
|
proxyIter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Clean Empty Entries
|
||||||
|
if (proxies.isEmpty())
|
||||||
|
playerIter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,7 +2,9 @@ package mineplex.minecraft.game.classcombat.item.Throwable;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -31,6 +33,7 @@ import mineplex.core.common.util.UtilPlayer;
|
|||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
||||||
import mineplex.minecraft.game.classcombat.item.ItemUsable;
|
import mineplex.minecraft.game.classcombat.item.ItemUsable;
|
||||||
|
import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent;
|
||||||
|
|
||||||
public class ProximityZapper extends ItemUsable
|
public class ProximityZapper extends ItemUsable
|
||||||
{
|
{
|
||||||
@ -63,6 +66,13 @@ public class ProximityZapper extends ItemUsable
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ThrowCustom(PlayerInteractEvent event, org.bukkit.entity.Item ent)
|
||||||
|
{
|
||||||
|
ProximityUseEvent useEvent = new ProximityUseEvent(event.getPlayer(), this, ent);
|
||||||
|
Bukkit.getServer().getPluginManager().callEvent(useEvent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
public void Collide(LivingEntity target, Block block, ProjectileUser data)
|
||||||
{
|
{
|
||||||
@ -154,17 +164,20 @@ public class ProximityZapper extends ItemUsable
|
|||||||
if (event.getType() != UpdateType.FAST)
|
if (event.getType() != UpdateType.FAST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HashSet<Entity> expired = new HashSet<Entity>();
|
Iterator<Entity> armedIter = _armed.keySet().iterator();
|
||||||
|
|
||||||
for (Entity ent : _armed.keySet())
|
while (armedIter.hasNext())
|
||||||
{
|
{
|
||||||
|
Entity ent = armedIter.next();
|
||||||
|
|
||||||
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 3600)
|
if (ent.isDead() || !ent.isValid() || ent.getTicksLived() >= 3600)
|
||||||
expired.add(ent);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Entity ent : expired)
|
|
||||||
{
|
{
|
||||||
Detonate(ent, null);
|
UtilParticle.PlayParticle(ParticleType.EXPLODE, ent.getLocation(), 0.1f, 0.1f, 0.1f, 0, 10,
|
||||||
|
ViewDist.MAX, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
ent.remove();
|
||||||
|
armedIter.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
package mineplex.minecraft.game.classcombat.item.event;
|
||||||
|
|
||||||
|
import mineplex.minecraft.game.classcombat.item.Item;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class ProximityUseEvent extends Event
|
||||||
|
{
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
||||||
|
private Player _player;
|
||||||
|
private Item _item;
|
||||||
|
private org.bukkit.entity.Item _entity;
|
||||||
|
|
||||||
|
public ProximityUseEvent(Player player, Item item, org.bukkit.entity.Item ent)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
_item = item;
|
||||||
|
_entity = ent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HandlerList getHandlers()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList()
|
||||||
|
{
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer()
|
||||||
|
{
|
||||||
|
return _player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item getItemType()
|
||||||
|
{
|
||||||
|
return _item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public org.bukkit.entity.Item getEntity()
|
||||||
|
{
|
||||||
|
return _entity;
|
||||||
|
}
|
||||||
|
}
|
@ -61,7 +61,8 @@ public class ClassShopManager extends MiniPlugin
|
|||||||
Achievement.CHAMPIONS_THE_LONGEST_SHOT,
|
Achievement.CHAMPIONS_THE_LONGEST_SHOT,
|
||||||
Achievement.CHAMPIONS_WINS,
|
Achievement.CHAMPIONS_WINS,
|
||||||
Achievement.CHAMPIONS_CAPTURES,
|
Achievement.CHAMPIONS_CAPTURES,
|
||||||
Achievement.CHAMPIONS_CLUTCH
|
Achievement.CHAMPIONS_CLUTCH,
|
||||||
|
Achievement.CHAMPIONS_SPECIAL_WIN
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ public class Condition
|
|||||||
{
|
{
|
||||||
CLOAK,
|
CLOAK,
|
||||||
SHOCK,
|
SHOCK,
|
||||||
|
POISON_SHOCK,
|
||||||
SILENCE,
|
SILENCE,
|
||||||
BURNING,
|
BURNING,
|
||||||
FALLING,
|
FALLING,
|
||||||
@ -19,6 +20,7 @@ public class Condition
|
|||||||
INVULNERABLE,
|
INVULNERABLE,
|
||||||
EXPLOSION,
|
EXPLOSION,
|
||||||
FIRE_ITEM_IMMUNITY,
|
FIRE_ITEM_IMMUNITY,
|
||||||
|
ARCADE_HUNGER_DISABLE,
|
||||||
|
|
||||||
CUSTOM,
|
CUSTOM,
|
||||||
|
|
||||||
|
@ -347,9 +347,17 @@ public class ConditionEffect implements Listener
|
|||||||
LivingEntity ent = event.GetDamageeEntity();
|
LivingEntity ent = event.GetDamageeEntity();
|
||||||
if (ent == null) return;
|
if (ent == null) return;
|
||||||
|
|
||||||
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON);
|
//Ignore Poison Shock
|
||||||
if (condition == null) return;
|
Condition poisonShock = Manager.GetActiveCondition(ent, ConditionType.POISON_SHOCK);
|
||||||
|
if (poisonShock != null)
|
||||||
|
{
|
||||||
|
event.SetCancelled("Poison Shock - Poison Cancel");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON);
|
||||||
|
if (condition == null)
|
||||||
|
return;
|
||||||
//Damage
|
//Damage
|
||||||
event.SetDamager(condition.GetSource());
|
event.SetDamager(condition.GetSource());
|
||||||
event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true);
|
event.AddMod(UtilEnt.getName(condition.GetSource()), condition.GetReason(), 0, true);
|
||||||
@ -357,6 +365,24 @@ public class ConditionEffect implements Listener
|
|||||||
event.SetKnockback(false);
|
event.SetKnockback(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void PoisonShock(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (LivingEntity ent : Manager.GetActiveConditions().keySet())
|
||||||
|
{
|
||||||
|
Condition condition = Manager.GetActiveCondition(ent, ConditionType.POISON_SHOCK);
|
||||||
|
if (condition == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Manager.getDamagerManager().NewDamageEvent(ent, condition.GetSource(), null,
|
||||||
|
DamageCause.CUSTOM, 0.1, false, true, false,
|
||||||
|
condition.GetSource().getName(), "Poison");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void Fall(CustomDamageEvent event)
|
public void Fall(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
|
@ -246,6 +246,14 @@ public class ConditionFactory
|
|||||||
Material.SLIME_BALL, (byte)14, showIndicator, ambient));
|
Material.SLIME_BALL, (byte)14, showIndicator, ambient));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Condition PoisonShock(String reason, LivingEntity ent, LivingEntity source,
|
||||||
|
double duration, boolean extend)
|
||||||
|
{
|
||||||
|
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
|
||||||
|
ConditionType.POISON_SHOCK, 0, (int)(20 * duration), extend,
|
||||||
|
Material.SLIME_BALL, (byte)14, false, false));
|
||||||
|
}
|
||||||
|
|
||||||
public Condition Confuse(String reason, LivingEntity ent, LivingEntity source,
|
public Condition Confuse(String reason, LivingEntity ent, LivingEntity source,
|
||||||
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient)
|
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient)
|
||||||
{
|
{
|
||||||
@ -277,4 +285,12 @@ public class ConditionFactory
|
|||||||
ConditionType.HEALTH_BOOST, mult, (int)(20 * duration), extend,
|
ConditionType.HEALTH_BOOST, mult, (int)(20 * duration), extend,
|
||||||
Material.APPLE, (byte)0, showIndicator, ambient));
|
Material.APPLE, (byte)0, showIndicator, ambient));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Condition ArcadeHungerDisable(String reason, LivingEntity ent, LivingEntity source,
|
||||||
|
double duration, boolean extend)
|
||||||
|
{
|
||||||
|
return Manager.AddCondition(new Condition(Manager, reason, ent, source,
|
||||||
|
ConditionType.ARCADE_HUNGER_DISABLE, 0, (int)(20 * duration), extend,
|
||||||
|
Material.COAL, (byte)0, false, false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import mineplex.core.common.util.UtilTime;
|
|||||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||||
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
|
||||||
import mineplex.minecraft.game.core.condition.events.ConditionApplyEvent;
|
import mineplex.minecraft.game.core.condition.events.ConditionApplyEvent;
|
||||||
|
import mineplex.minecraft.game.core.damage.DamageManager;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -40,6 +41,8 @@ public class ConditionManager extends MiniPlugin
|
|||||||
private ConditionApplicator _applicator;
|
private ConditionApplicator _applicator;
|
||||||
protected ConditionEffect Effect;
|
protected ConditionEffect Effect;
|
||||||
|
|
||||||
|
private DamageManager _damageManager;
|
||||||
|
|
||||||
private WeakHashMap<LivingEntity, LinkedList<Condition>> _conditions = new WeakHashMap<LivingEntity, LinkedList<Condition>>();
|
private WeakHashMap<LivingEntity, LinkedList<Condition>> _conditions = new WeakHashMap<LivingEntity, LinkedList<Condition>>();
|
||||||
private WeakHashMap<LivingEntity, LinkedList<ConditionActive>> _activeConditions = new WeakHashMap<LivingEntity, LinkedList<ConditionActive>>();
|
private WeakHashMap<LivingEntity, LinkedList<ConditionActive>> _activeConditions = new WeakHashMap<LivingEntity, LinkedList<ConditionActive>>();
|
||||||
|
|
||||||
@ -54,6 +57,16 @@ public class ConditionManager extends MiniPlugin
|
|||||||
Effect();
|
Effect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDamageManager(DamageManager damageManager)
|
||||||
|
{
|
||||||
|
_damageManager = damageManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DamageManager getDamagerManager()
|
||||||
|
{
|
||||||
|
return _damageManager;
|
||||||
|
}
|
||||||
|
|
||||||
public ConditionFactory Factory()
|
public ConditionFactory Factory()
|
||||||
{
|
{
|
||||||
if (_factory == null)
|
if (_factory == null)
|
||||||
|
@ -177,14 +177,6 @@ public class DamageManager extends MiniPlugin
|
|||||||
NewDamageEvent(damagee, damager, proj, null, cause, damage, knockback, ignoreRate, ignoreArmor, source, reason, cancelled);
|
NewDamageEvent(damagee, damager, proj, null, cause, damage, knockback, ignoreRate, ignoreArmor, source, reason, cancelled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj, Location knockbackOrigin,
|
|
||||||
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
|
|
||||||
String source, String reason, boolean cancelled)
|
|
||||||
{
|
|
||||||
_plugin.getServer().getPluginManager().callEvent(new CustomDamageEvent(damagee, damager, proj, knockbackOrigin, cause,
|
|
||||||
damage, knockback, ignoreRate, ignoreArmor, source, reason, cancelled));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj, Location knockbackOrigin,
|
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj, Location knockbackOrigin,
|
||||||
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
|
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
|
||||||
String source, String reason)
|
String source, String reason)
|
||||||
@ -193,6 +185,14 @@ public class DamageManager extends MiniPlugin
|
|||||||
reason, false);
|
reason, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void NewDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile proj, Location knockbackOrigin,
|
||||||
|
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
|
||||||
|
String source, String reason, boolean cancelled)
|
||||||
|
{
|
||||||
|
_plugin.getServer().getPluginManager().callEvent(new CustomDamageEvent(damagee, damager, proj, knockbackOrigin, cause,
|
||||||
|
damage, knockback, ignoreRate, ignoreArmor, source, reason, cancelled));
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void CancelDamageEvent(CustomDamageEvent event)
|
public void CancelDamageEvent(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
|
@ -42,9 +42,9 @@ public class Fire extends MiniPlugin
|
|||||||
_damageManager = damageManager;
|
_damageManager = damageManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Add(Item item, LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName)
|
public void Add(Item item, LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName, boolean hitSelf)
|
||||||
{
|
{
|
||||||
_fire.put(item, new FireData(owner, expireTime, delayTime, burnTime, damage, skillName));
|
_fire.put(item, new FireData(owner, expireTime, delayTime, burnTime, damage, skillName, hitSelf));
|
||||||
item.setPickupDelay(0);
|
item.setPickupDelay(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ public class Fire extends MiniPlugin
|
|||||||
if (ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9)
|
if (ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ent.equals(_fire.get(fire).GetOwner()))
|
if (!_fire.get(fire).canHitOwner() && ent.equals(_fire.get(fire).GetOwner()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (_conditionManager.HasCondition(ent, ConditionType.FIRE_ITEM_IMMUNITY, null))
|
if (_conditionManager.HasCondition(ent, ConditionType.FIRE_ITEM_IMMUNITY, null))
|
||||||
@ -111,7 +111,7 @@ public class Fire extends MiniPlugin
|
|||||||
if (!_fire.containsKey(fire))
|
if (!_fire.containsKey(fire))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_fire.get(fire).GetOwner().equals(player))
|
if (!_fire.get(fire).canHitOwner() && _fire.get(fire).GetOwner().equals(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -10,8 +10,9 @@ public class FireData
|
|||||||
private double _burnTime;
|
private double _burnTime;
|
||||||
private double _damage;
|
private double _damage;
|
||||||
private String _skillName;
|
private String _skillName;
|
||||||
|
private boolean _hitOwner;
|
||||||
|
|
||||||
public FireData(LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName)
|
public FireData(LivingEntity owner, double expireTime, double delayTime, double burnTime, double damage, String skillName, boolean hitSelf)
|
||||||
{
|
{
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
_expireTime = System.currentTimeMillis() + (long)(1000 * expireTime);
|
_expireTime = System.currentTimeMillis() + (long)(1000 * expireTime);
|
||||||
@ -19,6 +20,7 @@ public class FireData
|
|||||||
_burnTime = burnTime;
|
_burnTime = burnTime;
|
||||||
_damage = damage;
|
_damage = damage;
|
||||||
_skillName = skillName;
|
_skillName = skillName;
|
||||||
|
_hitOwner = hitSelf;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LivingEntity GetOwner()
|
public LivingEntity GetOwner()
|
||||||
@ -50,4 +52,9 @@ public class FireData
|
|||||||
{
|
{
|
||||||
return System.currentTimeMillis() > _expireTime;
|
return System.currentTimeMillis() > _expireTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canHitOwner()
|
||||||
|
{
|
||||||
|
return _hitOwner;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public class Arcade extends JavaPlugin
|
|||||||
BlockRestore blockRestore = new BlockRestore(this);
|
BlockRestore blockRestore = new BlockRestore(this);
|
||||||
|
|
||||||
ProjectileManager projectileManager = new ProjectileManager(this);
|
ProjectileManager projectileManager = new ProjectileManager(this);
|
||||||
HologramManager hologramManager = new HologramManager(this);
|
HologramManager hologramManager = new HologramManager(this, packetHandler);
|
||||||
|
|
||||||
//Inventory
|
//Inventory
|
||||||
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
|
InventoryManager inventoryManager = new InventoryManager(this, _clientManager);
|
||||||
|
@ -24,7 +24,6 @@ import mineplex.core.common.util.UtilAction;
|
|||||||
import mineplex.core.common.util.UtilGear;
|
import mineplex.core.common.util.UtilGear;
|
||||||
import mineplex.core.common.util.UtilInv;
|
import mineplex.core.common.util.UtilInv;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
import mineplex.core.creature.Creature;
|
import mineplex.core.creature.Creature;
|
||||||
@ -41,9 +40,7 @@ import mineplex.core.itemstack.ItemStackFactory;
|
|||||||
import mineplex.core.movement.Movement;
|
import mineplex.core.movement.Movement;
|
||||||
import mineplex.core.notifier.NotificationManager;
|
import mineplex.core.notifier.NotificationManager;
|
||||||
import mineplex.core.npc.NpcManager;
|
import mineplex.core.npc.NpcManager;
|
||||||
import mineplex.core.packethandler.IPacketHandler;
|
|
||||||
import mineplex.core.packethandler.PacketHandler;
|
import mineplex.core.packethandler.PacketHandler;
|
||||||
import mineplex.core.packethandler.PacketInfo;
|
|
||||||
import mineplex.core.party.PartyManager;
|
import mineplex.core.party.PartyManager;
|
||||||
import mineplex.core.pet.PetManager;
|
import mineplex.core.pet.PetManager;
|
||||||
import mineplex.core.poll.PollManager;
|
import mineplex.core.poll.PollManager;
|
||||||
@ -61,7 +58,6 @@ import mineplex.core.status.ServerStatusManager;
|
|||||||
import mineplex.core.task.TaskManager;
|
import mineplex.core.task.TaskManager;
|
||||||
import mineplex.core.teleport.Teleport;
|
import mineplex.core.teleport.Teleport;
|
||||||
import mineplex.core.timing.TimingManager;
|
import mineplex.core.timing.TimingManager;
|
||||||
import mineplex.core.titangiveaway.TitanGiveawayManager;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
||||||
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
|
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
|
||||||
@ -104,10 +100,10 @@ import nautilus.game.arcade.managers.GameSpectatorManager;
|
|||||||
import nautilus.game.arcade.managers.GameStatManager;
|
import nautilus.game.arcade.managers.GameStatManager;
|
||||||
import nautilus.game.arcade.managers.GameTournamentManager;
|
import nautilus.game.arcade.managers.GameTournamentManager;
|
||||||
import nautilus.game.arcade.managers.GameWorldManager;
|
import nautilus.game.arcade.managers.GameWorldManager;
|
||||||
import nautilus.game.arcade.managers.HolidayManager;
|
|
||||||
import nautilus.game.arcade.managers.IdleManager;
|
import nautilus.game.arcade.managers.IdleManager;
|
||||||
import nautilus.game.arcade.managers.MiscManager;
|
import nautilus.game.arcade.managers.MiscManager;
|
||||||
import nautilus.game.arcade.shop.ArcadeShop;
|
import nautilus.game.arcade.shop.ArcadeShop;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -235,16 +231,19 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
_explosionManager = new Explosion(plugin, _blockRestore);
|
_explosionManager = new Explosion(plugin, _blockRestore);
|
||||||
_explosionManager.SetDebris(false);
|
_explosionManager.SetDebris(false);
|
||||||
|
|
||||||
if (serverConfig.GameList.contains(GameType.ChampionsDominate)
|
|
||||||
|| serverConfig.GameList.contains(GameType.ChampionsTDM)
|
|
||||||
|| serverConfig.GameList.contains(GameType.ChampionsCTF))
|
|
||||||
{
|
|
||||||
_conditionManager = new SkillConditionManager(plugin);
|
_conditionManager = new SkillConditionManager(plugin);
|
||||||
}
|
|
||||||
else
|
//Dont see a reason to ever just use the normal one
|
||||||
{
|
// if (serverConfig.GameList.contains(GameType.ChampionsDominate)
|
||||||
_conditionManager = new ConditionManager(plugin);
|
// || serverConfig.GameList.contains(GameType.ChampionsTDM)
|
||||||
}
|
// || serverConfig.GameList.contains(GameType.ChampionsCTF))
|
||||||
|
// {
|
||||||
|
// _conditionManager = new SkillConditionManager(plugin);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// _conditionManager = new ConditionManager(plugin);
|
||||||
|
// }
|
||||||
|
|
||||||
_clientManager = clientManager;
|
_clientManager = clientManager;
|
||||||
_serverStatusManager = serverStatusManager;
|
_serverStatusManager = serverStatusManager;
|
||||||
@ -254,6 +253,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
_damageManager = damageManager;
|
_damageManager = damageManager;
|
||||||
_damageManager.UseSimpleWeaponDamage = true;
|
_damageManager.UseSimpleWeaponDamage = true;
|
||||||
_damageManager.setConditionManager(_conditionManager);
|
_damageManager.setConditionManager(_conditionManager);
|
||||||
|
_conditionManager.setDamageManager(_damageManager);
|
||||||
|
|
||||||
_disguiseManager = disguiseManager;
|
_disguiseManager = disguiseManager;
|
||||||
|
|
||||||
@ -713,6 +713,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
{
|
{
|
||||||
event.setMotd(ChatColor.YELLOW + "In Progress" + extrainformation);
|
event.setMotd(ChatColor.YELLOW + "In Progress" + extrainformation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"))
|
||||||
|
event.setMotd(ChatColor.GOLD + "Private Mineplex Test Server");
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -72,7 +72,6 @@ public enum GameType
|
|||||||
CastleSiege(CastleSiege.class, GameDisplay.CastleSiege),
|
CastleSiege(CastleSiege.class, GameDisplay.CastleSiege),
|
||||||
ChampionsCTF(ChampionsCTF.class, GameDisplay.ChampionsCTF),
|
ChampionsCTF(ChampionsCTF.class, GameDisplay.ChampionsCTF),
|
||||||
ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate),
|
ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate),
|
||||||
//ChampionsMOBA(ChampionsMOBA.class, "Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0, GameCategory.CHAMPIONS, 7),
|
|
||||||
ChampionsTDM(ChampionsTDM.class, GameDisplay.ChampionsTDM),
|
ChampionsTDM(ChampionsTDM.class, GameDisplay.ChampionsTDM),
|
||||||
Christmas(Christmas.class, GameDisplay.Christmas, "http://file.mineplex.com/ResChristmas.zip", true),
|
Christmas(Christmas.class, GameDisplay.Christmas, "http://file.mineplex.com/ResChristmas.zip", true),
|
||||||
DeathTag(DeathTag.class, GameDisplay.DeathTag),
|
DeathTag(DeathTag.class, GameDisplay.DeathTag),
|
||||||
@ -83,7 +82,6 @@ public enum GameType
|
|||||||
DragonsTeams(DragonsTeams.class, GameDisplay.DragonsTeams),
|
DragonsTeams(DragonsTeams.class, GameDisplay.DragonsTeams),
|
||||||
Draw(Draw.class, GameDisplay.Draw),
|
Draw(Draw.class, GameDisplay.Draw),
|
||||||
Evolution(Evolution.class, GameDisplay.Evolution),
|
Evolution(Evolution.class, GameDisplay.Evolution),
|
||||||
//FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17),
|
|
||||||
Gravity(Gravity.class, GameDisplay.Gravity),
|
Gravity(Gravity.class, GameDisplay.Gravity),
|
||||||
Halloween(Halloween.class, GameDisplay.Halloween, "http://file.mineplex.com/ResHalloween.zip", true),
|
Halloween(Halloween.class, GameDisplay.Halloween, "http://file.mineplex.com/ResHalloween.zip", true),
|
||||||
HideSeek(HideSeek.class, GameDisplay.HideSeek),
|
HideSeek(HideSeek.class, GameDisplay.HideSeek),
|
||||||
@ -92,7 +90,7 @@ public enum GameType
|
|||||||
Lobbers(BombLobbers.class, GameDisplay.Lobbers),
|
Lobbers(BombLobbers.class, GameDisplay.Lobbers),
|
||||||
Micro(Micro.class, GameDisplay.Micro),
|
Micro(Micro.class, GameDisplay.Micro),
|
||||||
MilkCow(MilkCow.class, GameDisplay.MilkCow),
|
MilkCow(MilkCow.class, GameDisplay.MilkCow),
|
||||||
MineStrike(MineStrike.class, GameDisplay.MineStrike, "http://file.mineplex.com/ResMinestrike.zip", true),// Temp set to CHAMPIONS to fix UI bug
|
MineStrike(MineStrike.class, GameDisplay.MineStrike, "http://chivebox.com/mineplex/ResMinestrike.zip", true),
|
||||||
MineWare(MineWare.class, GameDisplay.MineWare),
|
MineWare(MineWare.class, GameDisplay.MineWare),
|
||||||
OldMineWare(OldMineWare.class, GameDisplay.OldMineWare),
|
OldMineWare(OldMineWare.class, GameDisplay.OldMineWare),
|
||||||
Paintball(Paintball.class, GameDisplay.Paintball),
|
Paintball(Paintball.class, GameDisplay.Paintball),
|
||||||
|
@ -195,6 +195,7 @@ public abstract class Game implements Listener
|
|||||||
public boolean AutomaticRespawn = true;
|
public boolean AutomaticRespawn = true;
|
||||||
|
|
||||||
public double DeathSpectateSecs = 0;
|
public double DeathSpectateSecs = 0;
|
||||||
|
public boolean DeathTeleport = true;
|
||||||
|
|
||||||
public boolean QuitOut = true;
|
public boolean QuitOut = true;
|
||||||
public boolean QuitDropItems = false;
|
public boolean QuitDropItems = false;
|
||||||
@ -209,6 +210,7 @@ public abstract class Game implements Listener
|
|||||||
public int WorldWaterDamage = 0;
|
public int WorldWaterDamage = 0;
|
||||||
public boolean WorldBoundaryKill = true;
|
public boolean WorldBoundaryKill = true;
|
||||||
public boolean WorldBlockBurn = false;
|
public boolean WorldBlockBurn = false;
|
||||||
|
public boolean WorldBlockGrow = false;
|
||||||
public boolean WorldFireSpread = false;
|
public boolean WorldFireSpread = false;
|
||||||
public boolean WorldLeavesDecay = false;
|
public boolean WorldLeavesDecay = false;
|
||||||
public boolean WorldSoilTrample = false;
|
public boolean WorldSoilTrample = false;
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package nautilus.game.arcade.game.games.champions;
|
package nautilus.game.arcade.game.games.champions;
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.inventory.data.Item;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||||
@ -21,8 +23,11 @@ import nautilus.game.arcade.stats.ClutchStatTracker;
|
|||||||
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
|
import nautilus.game.arcade.stats.ElectrocutionStatTracker;
|
||||||
import nautilus.game.arcade.stats.KillReasonStatTracker;
|
import nautilus.game.arcade.stats.KillReasonStatTracker;
|
||||||
import nautilus.game.arcade.stats.SeismicSlamStatTracker;
|
import nautilus.game.arcade.stats.SeismicSlamStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.SpecialWinStatTracker;
|
||||||
import nautilus.game.arcade.stats.TheLongestShotStatTracker;
|
import nautilus.game.arcade.stats.TheLongestShotStatTracker;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -59,6 +64,8 @@ public class ChampionsCTF extends CaptureTheFlag
|
|||||||
Manager.GetDamage().UseSimpleWeaponDamage = false;
|
Manager.GetDamage().UseSimpleWeaponDamage = false;
|
||||||
Manager.getCosmeticManager().setHideParticles(true);
|
Manager.getCosmeticManager().setHideParticles(true);
|
||||||
|
|
||||||
|
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
|
||||||
|
|
||||||
this.StrictAntiHack = true;
|
this.StrictAntiHack = true;
|
||||||
|
|
||||||
InventoryOpenChest = true;
|
InventoryOpenChest = true;
|
||||||
@ -76,10 +83,11 @@ public class ChampionsCTF extends CaptureTheFlag
|
|||||||
new TheLongestShotStatTracker(this),
|
new TheLongestShotStatTracker(this),
|
||||||
new SeismicSlamStatTracker(this),
|
new SeismicSlamStatTracker(this),
|
||||||
new CapturesStatTracker(this, "Captures"),
|
new CapturesStatTracker(this, "Captures"),
|
||||||
new ClutchStatTracker(this, "Clutch")
|
new ClutchStatTracker(this, "Clutch"),
|
||||||
|
new SpecialWinStatTracker(this, "SpecialWin")
|
||||||
);
|
);
|
||||||
|
|
||||||
new ChampsFixer(this);
|
new ChampionsFixes(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -140,4 +148,19 @@ public class ChampionsCTF extends CaptureTheFlag
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void cleanProximities(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!IsLive())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Location loc : getLocations(true))
|
||||||
|
{
|
||||||
|
Manager.getClassManager().GetItemFactory().getProximityManager().clean(loc, 12);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,8 @@ public class ChampionsDominate extends Domination
|
|||||||
Manager.GetDamage().UseSimpleWeaponDamage = false;
|
Manager.GetDamage().UseSimpleWeaponDamage = false;
|
||||||
Manager.getCosmeticManager().setHideParticles(true);
|
Manager.getCosmeticManager().setHideParticles(true);
|
||||||
|
|
||||||
|
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
|
||||||
|
|
||||||
this.StrictAntiHack = true;
|
this.StrictAntiHack = true;
|
||||||
|
|
||||||
InventoryOpenChest = true;
|
InventoryOpenChest = true;
|
||||||
@ -77,7 +79,7 @@ public class ChampionsDominate extends Domination
|
|||||||
new SeismicSlamStatTracker(this)
|
new SeismicSlamStatTracker(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
new ChampsFixer(this);
|
new ChampionsFixes(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package nautilus.game.arcade.game.games.champions;
|
package nautilus.game.arcade.game.games.champions;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.inventory.data.Item;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.classcombat.Skill.Skill;
|
import mineplex.minecraft.game.classcombat.Skill.Skill;
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
@ -9,6 +12,8 @@ import nautilus.game.arcade.game.Game;
|
|||||||
import nautilus.game.arcade.game.Game.GameState;
|
import nautilus.game.arcade.game.Game.GameState;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -18,11 +23,11 @@ import org.bukkit.event.block.BlockDamageEvent;
|
|||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
|
||||||
public class ChampsFixer implements Listener
|
public class ChampionsFixes implements Listener
|
||||||
{
|
{
|
||||||
private Game _host;
|
private Game _host;
|
||||||
|
|
||||||
public ChampsFixer(Game game)
|
public ChampionsFixes(Game game)
|
||||||
{
|
{
|
||||||
_host = game;
|
_host = game;
|
||||||
Bukkit.getPluginManager().registerEvents(this, _host.getArcadeManager().getPlugin());
|
Bukkit.getPluginManager().registerEvents(this, _host.getArcadeManager().getPlugin());
|
||||||
@ -34,7 +39,7 @@ public class ChampsFixer implements Listener
|
|||||||
if (event.GetGame() != _host)
|
if (event.GetGame() != _host)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event.GetState() == GameState.Dead)
|
if (event.GetState() == GameState.End || event.GetState() == GameState.Dead)
|
||||||
HandlerList.unregisterAll(this);
|
HandlerList.unregisterAll(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +56,7 @@ public class ChampsFixer implements Listener
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
event.setCancelMessage("You cannot change kits while holding someone in Dwarf Toss!");
|
event.setCancelMessage("You cannot change kits while using Dwarf Toss!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
@ -67,11 +72,14 @@ public class ChampsFixer implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onUpdate(UpdateEvent event)
|
public void resetSkillsWhileInInventory(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (!_host.IsLive())
|
if (!_host.IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
if (player.getOpenInventory() == null || player.getOpenInventory().getTopInventory() == null)
|
if (player.getOpenInventory() == null || player.getOpenInventory().getTopInventory() == null)
|
||||||
@ -97,5 +105,4 @@ public class ChampsFixer implements Listener
|
|||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -60,6 +60,8 @@ public class ChampionsTDM extends TeamDeathmatch
|
|||||||
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
|
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
|
||||||
Manager.getCosmeticManager().setHideParticles(true);
|
Manager.getCosmeticManager().setHideParticles(true);
|
||||||
|
|
||||||
|
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
|
||||||
|
|
||||||
this.StrictAntiHack = true;
|
this.StrictAntiHack = true;
|
||||||
|
|
||||||
InventoryOpenChest = true;
|
InventoryOpenChest = true;
|
||||||
@ -77,7 +79,7 @@ public class ChampionsTDM extends TeamDeathmatch
|
|||||||
new SeismicSlamStatTracker(this)
|
new SeismicSlamStatTracker(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
new ChampsFixer(this);
|
new ChampionsFixes(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -85,8 +84,7 @@ public class CaptureTheFlag extends TeamGame
|
|||||||
private HashMap<Player, List<ItemStack>> _hotbars = new HashMap<Player, List<ItemStack>>();
|
private HashMap<Player, List<ItemStack>> _hotbars = new HashMap<Player, List<ItemStack>>();
|
||||||
private HashMap<Player, ItemStack> _helmets = new HashMap<Player, ItemStack>();
|
private HashMap<Player, ItemStack> _helmets = new HashMap<Player, ItemStack>();
|
||||||
|
|
||||||
private boolean _redFlickerStage = false;
|
private boolean _flickerStage = false;
|
||||||
private boolean _blueFlickerStage = false;
|
|
||||||
|
|
||||||
public CaptureTheFlag(ArcadeManager manager, GameType type, Kit[] kits)
|
public CaptureTheFlag(ArcadeManager manager, GameType type, Kit[] kits)
|
||||||
{
|
{
|
||||||
@ -224,8 +222,8 @@ public class CaptureTheFlag extends TeamGame
|
|||||||
for (Resupply resupply : _resupply)
|
for (Resupply resupply : _resupply)
|
||||||
resupply.Update();
|
resupply.Update();
|
||||||
|
|
||||||
getFlag(true).handleBottomInfo(_redFlickerStage, ChatColor.RED);
|
getFlag(true).handleBottomInfo(_flickerStage, ChatColor.RED);
|
||||||
getFlag(false).handleBottomInfo(_blueFlickerStage, ChatColor.AQUA);
|
getFlag(false).handleBottomInfo(_flickerStage, ChatColor.AQUA);
|
||||||
}
|
}
|
||||||
else if (event.getType() == UpdateType.SEC)
|
else if (event.getType() == UpdateType.SEC)
|
||||||
for (Flag flag : _flags)
|
for (Flag flag : _flags)
|
||||||
@ -407,6 +405,28 @@ public class CaptureTheFlag extends TeamGame
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Location> getLocations(boolean base)
|
||||||
|
{
|
||||||
|
List<Location> locs = new ArrayList<Location>();
|
||||||
|
if (base)
|
||||||
|
{
|
||||||
|
locs.add(_blueFlag);
|
||||||
|
locs.add(_redFlag);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
locs.add(getFlag(true).getPlacedLocation());
|
||||||
|
locs.add(getFlag(false).getPlacedLocation());
|
||||||
|
}
|
||||||
|
|
||||||
|
return locs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getScoreDifference()
|
||||||
|
{
|
||||||
|
return Math.abs(_blueScore - _redScore);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void ScoreboardUpdate(UpdateEvent event)
|
public void ScoreboardUpdate(UpdateEvent event)
|
||||||
@ -432,22 +452,21 @@ public class CaptureTheFlag extends TeamGame
|
|||||||
|
|
||||||
String redMessage = "Flag Dropped";
|
String redMessage = "Flag Dropped";
|
||||||
if (getFlag(true).isAtHome())
|
if (getFlag(true).isAtHome())
|
||||||
{
|
|
||||||
redMessage = "Flag Safe";
|
redMessage = "Flag Safe";
|
||||||
_redFlickerStage = false;
|
|
||||||
}
|
|
||||||
if (getFlag(true).getCarrier() != null)
|
if (getFlag(true).getCarrier() != null)
|
||||||
redMessage = "Flag Taken";
|
redMessage = "Flag Taken";
|
||||||
|
|
||||||
if (_redFlickerStage)
|
if (_flickerStage)
|
||||||
{
|
{
|
||||||
|
if (!getFlag(true).isAtHome())
|
||||||
Scoreboard.Write(C.cRed + redMessage);
|
Scoreboard.Write(C.cRed + redMessage);
|
||||||
_redFlickerStage = false;
|
else
|
||||||
|
Scoreboard.Write(redMessage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Scoreboard.Write(redMessage);
|
Scoreboard.Write(redMessage);
|
||||||
_redFlickerStage = true;
|
|
||||||
}
|
}
|
||||||
//Flag in play stuff
|
//Flag in play stuff
|
||||||
|
|
||||||
@ -457,23 +476,27 @@ public class CaptureTheFlag extends TeamGame
|
|||||||
|
|
||||||
String blueMessage = "Flag Dropped";
|
String blueMessage = "Flag Dropped";
|
||||||
if (getFlag(false).isAtHome())
|
if (getFlag(false).isAtHome())
|
||||||
{
|
|
||||||
blueMessage = "Flag Safe";
|
blueMessage = "Flag Safe";
|
||||||
_blueFlickerStage = false;
|
|
||||||
}
|
|
||||||
if (getFlag(false).getCarrier() != null)
|
|
||||||
blueMessage = "Flag Taken";
|
|
||||||
|
|
||||||
if (_blueFlickerStage)
|
if (getFlag(false).getCarrier() != null)
|
||||||
{
|
{
|
||||||
|
blueMessage = "Flag Taken";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_flickerStage)
|
||||||
|
{
|
||||||
|
if (!getFlag(false).isAtHome())
|
||||||
Scoreboard.Write(C.cAqua + blueMessage);
|
Scoreboard.Write(C.cAqua + blueMessage);
|
||||||
_blueFlickerStage = false;
|
else
|
||||||
|
Scoreboard.Write(blueMessage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Scoreboard.Write(blueMessage);
|
Scoreboard.Write(blueMessage);
|
||||||
_blueFlickerStage = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_flickerStage = !_flickerStage;
|
||||||
|
|
||||||
//Flag in play stuff
|
//Flag in play stuff
|
||||||
|
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
|
@ -409,12 +409,15 @@ public class Flag
|
|||||||
if (!_host.isInZone(player.getLocation(), true)) return;
|
if (!_host.isInZone(player.getLocation(), true)) return;
|
||||||
|
|
||||||
if (!_host.isAtHome(_team.GetColor() == ChatColor.RED ? ChatColor.BLUE : ChatColor.RED))
|
if (!_host.isAtHome(_team.GetColor() == ChatColor.RED ? ChatColor.BLUE : ChatColor.RED))
|
||||||
|
{
|
||||||
|
if (_host.getArcadeManager().IsTournamentServer())
|
||||||
{
|
{
|
||||||
if (Recharge.Instance.use(player, "No Cap Message", 1000, false, false))
|
if (Recharge.Instance.use(player, "No Cap Message", 1000, false, false))
|
||||||
UtilTextMiddle.display("", C.cRed + "Your flag must be at home to capture!", player);
|
UtilTextMiddle.display("", C.cRed + "Your flag must be at home to capture!", player);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_host.resetInventory(player);
|
_host.resetInventory(player);
|
||||||
announceCapture(player);
|
announceCapture(player);
|
||||||
|
@ -129,7 +129,7 @@ public class PerkFlamingSwordEVO extends Perk
|
|||||||
{
|
{
|
||||||
//Fire
|
//Fire
|
||||||
Item fire = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER));
|
Item fire = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER));
|
||||||
Manager.GetFire().Add(fire, player, 0.7, 0, 0.5, 1, "Inferno");
|
Manager.GetFire().Add(fire, player, 0.7, 0, 0.5, 1, "Inferno", false);
|
||||||
|
|
||||||
fire.teleport(player.getEyeLocation());
|
fire.teleport(player.getEyeLocation());
|
||||||
double x = 0.07 - (UtilMath.r(14)/100d);
|
double x = 0.07 - (UtilMath.r(14)/100d);
|
||||||
|
@ -116,6 +116,10 @@ import net.minecraft.server.v1_8_R3.EntityArrow;
|
|||||||
|
|
||||||
public class MineStrike extends TeamGame
|
public class MineStrike extends TeamGame
|
||||||
{
|
{
|
||||||
|
public static float RECOIL = 0.8f;
|
||||||
|
public static float CONE = 0.7f;
|
||||||
|
public static float MOVE_PENALTY = 0.8f;
|
||||||
|
|
||||||
public static class PlayerHeadshotEvent extends PlayerEvent
|
public static class PlayerHeadshotEvent extends PlayerEvent
|
||||||
{
|
{
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
@ -207,10 +211,12 @@ public class MineStrike extends TeamGame
|
|||||||
private HashSet<Entity> _defusalDropped = new HashSet<Entity>();
|
private HashSet<Entity> _defusalDropped = new HashSet<Entity>();
|
||||||
|
|
||||||
private HashMap<Location, Long> _incendiary = new HashMap<Location, Long>();
|
private HashMap<Location, Long> _incendiary = new HashMap<Location, Long>();
|
||||||
|
private HashMap<Block, Long> _smokeBlocks = new HashMap<Block, Long>();
|
||||||
|
|
||||||
private Bomb _bomb = null;
|
private Bomb _bomb = null;
|
||||||
private Item _bombItem = null;
|
private Item _bombItem = null;
|
||||||
private Player _bombHolder = null;
|
private Player _bombHolder = null;
|
||||||
|
private long _bombHolderLastMove = 0;
|
||||||
|
|
||||||
private Player _bombPlanter;
|
private Player _bombPlanter;
|
||||||
private Player _bombDefuser;
|
private Player _bombDefuser;
|
||||||
@ -261,6 +267,8 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
this.ItemDrop = true;
|
this.ItemDrop = true;
|
||||||
|
|
||||||
|
this.DeathTeleport = false;
|
||||||
|
|
||||||
this.InventoryClick = true;
|
this.InventoryClick = true;
|
||||||
|
|
||||||
this.JoinInProgress = true;
|
this.JoinInProgress = true;
|
||||||
@ -280,7 +288,7 @@ public class MineStrike extends TeamGame
|
|||||||
"Sprinting heavily decreases accuracy",
|
"Sprinting heavily decreases accuracy",
|
||||||
"Jumping massively decreases accuracy",
|
"Jumping massively decreases accuracy",
|
||||||
"Crouching increases accuracy",
|
"Crouching increases accuracy",
|
||||||
"Left-Click to roll Grenades",
|
"Left-Click to drop Grenades",
|
||||||
"Right-Click to throw Grenades",
|
"Right-Click to throw Grenades",
|
||||||
"Burst Fire for greater accuracy",
|
"Burst Fire for greater accuracy",
|
||||||
"Sniper Rifles are only accurate while scoped",
|
"Sniper Rifles are only accurate while scoped",
|
||||||
@ -356,7 +364,7 @@ public class MineStrike extends TeamGame
|
|||||||
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Knife"));
|
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Knife"));
|
||||||
|
|
||||||
//Armor
|
//Armor
|
||||||
giveTeamArmor(event.getPlayer(), Color.fromRGB(255, 0, 0));
|
giveTeamArmor(event.getPlayer(), Color.fromRGB(255, 75, 75));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (team.GetColor() == ChatColor.AQUA)
|
else if (team.GetColor() == ChatColor.AQUA)
|
||||||
@ -369,10 +377,10 @@ public class MineStrike extends TeamGame
|
|||||||
gun.giveToPlayer(event.getPlayer(), true);
|
gun.giveToPlayer(event.getPlayer(), true);
|
||||||
|
|
||||||
//Knife
|
//Knife
|
||||||
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, "Knife"));
|
event.getPlayer().getInventory().setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Knife"));
|
||||||
|
|
||||||
//Armor
|
//Armor
|
||||||
giveTeamArmor(event.getPlayer(), Color.fromRGB(0, 0, 255));
|
giveTeamArmor(event.getPlayer(), Color.fromRGB(125, 200, 255));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,6 +393,8 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
//Dont Get Hit By Bullets
|
//Dont Get Hit By Bullets
|
||||||
((CraftPlayer) event.getEntity()).getHandle().spectating = true;
|
((CraftPlayer) event.getEntity()).getHandle().spectating = true;
|
||||||
|
|
||||||
|
Manager.GetCondition().Factory().Blind("Ghost", event.getEntity(), event.getEntity(), 2.5, 0, false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void disguiseSneak(Player player, GameTeam team)
|
// public void disguiseSneak(Player player, GameTeam team)
|
||||||
@ -530,6 +540,7 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
|
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
|
||||||
_bombHolder = player;
|
_bombHolder = player;
|
||||||
|
_bombHolderLastMove = System.currentTimeMillis();
|
||||||
|
|
||||||
if (_bombItem != null)
|
if (_bombItem != null)
|
||||||
{
|
{
|
||||||
@ -603,6 +614,17 @@ public class MineStrike extends TeamGame
|
|||||||
_incendiary.put(loc, endTime);
|
_incendiary.put(loc, endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public void registerSmokeBlock(Block block, long endTime)
|
||||||
|
{
|
||||||
|
if (block.getType() == Material.AIR || block.getType() == Material.PORTAL || block.getType() == Material.FIRE)
|
||||||
|
{
|
||||||
|
block.setTypeIdAndData(90, (byte)UtilMath.r(2), false);
|
||||||
|
|
||||||
|
_smokeBlocks.put(block, endTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Gun getGunInHand(Player player, ItemStack overrideStack)
|
public Gun getGunInHand(Player player, ItemStack overrideStack)
|
||||||
{
|
{
|
||||||
ItemStack stack = player.getItemInHand();
|
ItemStack stack = player.getItemInHand();
|
||||||
@ -718,6 +740,12 @@ public class MineStrike extends TeamGame
|
|||||||
if (grenade == null)
|
if (grenade == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!UtilTime.elapsed(GetStateTime(), 10000))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot throw Grenades yet."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
grenade.throwGrenade(event.getPlayer(), UtilEvent.isAction(event, ActionType.L), this);
|
grenade.throwGrenade(event.getPlayer(), UtilEvent.isAction(event, ActionType.L), this);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -1217,8 +1245,6 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
damagee.getWorld().playSound(damagee.getLocation(), Sound.IRONGOLEM_DEATH, 1f, 1f);
|
damagee.getWorld().playSound(damagee.getLocation(), Sound.IRONGOLEM_DEATH, 1f, 1f);
|
||||||
|
|
||||||
event.SetKnockback(false);
|
|
||||||
}
|
}
|
||||||
//Standard
|
//Standard
|
||||||
else
|
else
|
||||||
@ -1227,9 +1253,9 @@ public class MineStrike extends TeamGame
|
|||||||
event.AddMod(damager.getName(), "Knife", 6 - event.GetDamage(), false);
|
event.AddMod(damager.getName(), "Knife", 6 - event.GetDamage(), false);
|
||||||
|
|
||||||
event.GetDamageeEntity().getWorld().playSound(event.GetDamageeEntity().getLocation(), Sound.BAT_HURT, 1f, 1f);
|
event.GetDamageeEntity().getWorld().playSound(event.GetDamageeEntity().getLocation(), Sound.BAT_HURT, 1f, 1f);
|
||||||
|
|
||||||
event.AddKnockback("Knife", 1.2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event.SetKnockback(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1291,12 +1317,11 @@ public class MineStrike extends TeamGame
|
|||||||
if (Armor.isArmor(event.GetDamageePlayer().getInventory().getHelmet()) ||
|
if (Armor.isArmor(event.GetDamageePlayer().getInventory().getHelmet()) ||
|
||||||
(_scoped.containsKey(event.GetDamageePlayer()) && UtilGear.isMat(_scoped.get(event.GetDamageePlayer()), Material.LEATHER_HELMET)))
|
(_scoped.containsKey(event.GetDamageePlayer()) && UtilGear.isMat(_scoped.get(event.GetDamageePlayer()), Material.LEATHER_HELMET)))
|
||||||
{
|
{
|
||||||
event.AddMod(event.GetDamageePlayer().getName(), "Helmet", -damage*1, false);
|
event.AddMod(event.GetDamageePlayer().getName(), "Helmet", -damage*0.5, false);
|
||||||
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SPIDER_DEATH, 1f, 1f);
|
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SPIDER_DEATH, 1f, 1f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SLIME_ATTACK, 1f, 1f);
|
event.GetDamageePlayer().getWorld().playSound(event.GetDamageePlayer().getEyeLocation(), Sound.SLIME_ATTACK, 1f, 1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1368,16 +1393,16 @@ public class MineStrike extends TeamGame
|
|||||||
|
|
||||||
public boolean hitBody(Player player, Location loc)
|
public boolean hitBody(Player player, Location loc)
|
||||||
{
|
{
|
||||||
return UtilMath.offset2d(loc, player.getLocation()) < 0.6 && //0.6 is ideal
|
return UtilMath.offset2d(loc, player.getLocation()) < 0.6 &&
|
||||||
loc.getY() > player.getLocation().getY() &&
|
loc.getY() >= player.getLocation().getY() &&
|
||||||
loc.getY() < player.getEyeLocation().getY() - 0.1;
|
loc.getY() <= player.getEyeLocation().getY();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hitHead(Player player, Location loc)
|
public boolean hitHead(Player player, Location loc)
|
||||||
{
|
{
|
||||||
return UtilMath.offset2d(loc, player.getLocation()) < 0.2 && //0.3 was old value, too large
|
return UtilMath.offset2d(loc, player.getLocation()) < 0.2 &&
|
||||||
loc.getY() >= player.getEyeLocation().getY() - 0.1 &&
|
loc.getY() >= player.getEyeLocation().getY() + 0.0 &&
|
||||||
loc.getY() < player.getEyeLocation().getY() + 0.1; //0.2 was old value, too large
|
loc.getY() < player.getEyeLocation().getY() + 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1404,6 +1429,9 @@ public class MineStrike extends TeamGame
|
|||||||
if (event.GetLog().GetLastDamager().GetReason().contains("AWP"))
|
if (event.GetLog().GetLastDamager().GetReason().contains("AWP"))
|
||||||
amount = 100;
|
amount = 100;
|
||||||
|
|
||||||
|
else if (event.GetLog().GetLastDamager().GetReason().contains("PP-Bizon"))
|
||||||
|
amount = 600;
|
||||||
|
|
||||||
else if (event.GetLog().GetLastDamager().GetReason().contains("Nova"))
|
else if (event.GetLog().GetLastDamager().GetReason().contains("Nova"))
|
||||||
amount = 900;
|
amount = 900;
|
||||||
|
|
||||||
@ -1476,14 +1504,6 @@ public class MineStrike extends TeamGame
|
|||||||
UtilParticle.PlayParticle(ParticleType.CRIT, grenadeItem.getLocation(), 0, 0, 0, 0, 1,
|
UtilParticle.PlayParticle(ParticleType.CRIT, grenadeItem.getLocation(), 0, 0, 0, 0, 1,
|
||||||
ViewDist.NORMAL, UtilServer.getPlayers());
|
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
|
|
||||||
//Expired
|
|
||||||
if (!grenadeItem.isValid() || grenadeItem.getTicksLived() > 400)
|
|
||||||
{
|
|
||||||
grenadeItem.remove();
|
|
||||||
grenadeIterator.remove();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Completed
|
//Completed
|
||||||
Grenade grenade = _grenadesThrown.get(grenadeItem);
|
Grenade grenade = _grenadesThrown.get(grenadeItem);
|
||||||
if (grenade.update(this, grenadeItem))
|
if (grenade.update(this, grenadeItem))
|
||||||
@ -1601,7 +1621,7 @@ public class MineStrike extends TeamGame
|
|||||||
_bombPlanter.setExp(Math.min(_bombPlanter.getExp() + 0.017f, 0.99999f));
|
_bombPlanter.setExp(Math.min(_bombPlanter.getExp() + 0.017f, 0.99999f));
|
||||||
|
|
||||||
if (Math.random() > 0.90)
|
if (Math.random() > 0.90)
|
||||||
_bombPlanter.getWorld().playSound(_bombPlanter.getLocation(), Sound.NOTE_PLING, 1f, 3f);
|
_bombPlanter.getWorld().playSound(_bombPlanter.getLocation(), Sound.NOTE_PLING, 2f, 3f);
|
||||||
|
|
||||||
UtilTextMiddle.display(C.cRed + C.Bold + "Planting Bomb", UtilTextMiddle.progress(_bombPlanter.getExp()), 0, 10, 0, _bombPlanter);
|
UtilTextMiddle.display(C.cRed + C.Bold + "Planting Bomb", UtilTextMiddle.progress(_bombPlanter.getExp()), 0, 10, 0, _bombPlanter);
|
||||||
|
|
||||||
@ -1655,7 +1675,11 @@ public class MineStrike extends TeamGame
|
|||||||
{
|
{
|
||||||
for (Player player : GetTeam(ChatColor.AQUA).GetPlayers(true))
|
for (Player player : GetTeam(ChatColor.AQUA).GetPlayers(true))
|
||||||
{
|
{
|
||||||
Block block = player.getTargetBlock((HashSet<Byte>) null, 5);
|
HashSet<Material> ignoreBlocks = new HashSet<Material>();
|
||||||
|
ignoreBlocks.add(Material.AIR);
|
||||||
|
ignoreBlocks.add(Material.PORTAL);
|
||||||
|
|
||||||
|
Block block = player.getTargetBlock(ignoreBlocks, 5);
|
||||||
|
|
||||||
if (block == null || !_bomb.isBlock(block))
|
if (block == null || !_bomb.isBlock(block))
|
||||||
continue;
|
continue;
|
||||||
@ -1700,7 +1724,11 @@ public class MineStrike extends TeamGame
|
|||||||
if (_bombDefuser == null)
|
if (_bombDefuser == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Block block = _bombDefuser.getTargetBlock((HashSet<Byte>) null, 5);
|
HashSet<Material> ignoreBlocks = new HashSet<Material>();
|
||||||
|
ignoreBlocks.add(Material.AIR);
|
||||||
|
ignoreBlocks.add(Material.PORTAL);
|
||||||
|
|
||||||
|
Block block = _bombDefuser.getTargetBlock(ignoreBlocks, 5);
|
||||||
|
|
||||||
if (!IsAlive(_bombDefuser) || block == null || !_bomb.isBlock(block) || !_bombDefuser.isOnline() || UtilMath.offset(_bombDefuser.getLocation(), block.getLocation().add(0.5, 0, 0.5)) > 3)
|
if (!IsAlive(_bombDefuser) || block == null || !_bomb.isBlock(block) || !_bombDefuser.isOnline() || UtilMath.offset(_bombDefuser.getLocation(), block.getLocation().add(0.5, 0, 0.5)) > 3)
|
||||||
{
|
{
|
||||||
@ -2148,6 +2176,11 @@ public class MineStrike extends TeamGame
|
|||||||
_incendiary.clear();
|
_incendiary.clear();
|
||||||
Manager.GetBlockRestore().RestoreAll();
|
Manager.GetBlockRestore().RestoreAll();
|
||||||
|
|
||||||
|
//Smoke
|
||||||
|
for (Block block : _smokeBlocks.keySet())
|
||||||
|
block.setType(Material.AIR);
|
||||||
|
_smokeBlocks.clear();
|
||||||
|
|
||||||
//Restock Ammo
|
//Restock Ammo
|
||||||
for (Gun gun : _gunsEquipped.keySet())
|
for (Gun gun : _gunsEquipped.keySet())
|
||||||
gun.restockAmmo(_gunsEquipped.get(gun));
|
gun.restockAmmo(_gunsEquipped.get(gun));
|
||||||
@ -2399,6 +2432,47 @@ public class MineStrike extends TeamGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void gunUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!IsLive())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Gun gun : _gunsEquipped.keySet())
|
||||||
|
{
|
||||||
|
gun.displayAmmo(_gunsEquipped.get(gun));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void smokeUpdate(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Iterator<Block> smokeIterator = _smokeBlocks.keySet().iterator();
|
||||||
|
|
||||||
|
while (smokeIterator.hasNext())
|
||||||
|
{
|
||||||
|
Block block = smokeIterator.next();
|
||||||
|
|
||||||
|
if (System.currentTimeMillis() > _smokeBlocks.get(block))
|
||||||
|
{
|
||||||
|
if (block.getType() == Material.PORTAL)
|
||||||
|
block.setTypeIdAndData(0, (byte)0, false);
|
||||||
|
|
||||||
|
smokeIterator.remove();
|
||||||
|
}
|
||||||
|
else if (block.getType() == Material.AIR)
|
||||||
|
{
|
||||||
|
block.setTypeIdAndData(90, (byte)UtilMath.r(2), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void bombBurnUpdate(UpdateEvent event)
|
public void bombBurnUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
@ -2706,7 +2780,7 @@ public class MineStrike extends TeamGame
|
|||||||
public void fireDamage(CustomDamageEvent event)
|
public void fireDamage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
if (event.GetCause() == DamageCause.FIRE)
|
if (event.GetCause() == DamageCause.FIRE)
|
||||||
event.AddMod(this.GetName(), "Fire", 3, false);
|
event.AddMod(this.GetName(), "Fire", 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -2759,6 +2833,48 @@ public class MineStrike extends TeamGame
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.getMessage().contains("recoil"))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MineStrike.RECOIL = Float.parseFloat(event.getMessage().split(" ")[1]);
|
||||||
|
this.Announce(C.cPurple + C.Bold + "Recoil Bloom: " + ChatColor.RESET + (int)(MineStrike.RECOIL * 100) + "%");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getMessage().contains("cone"))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MineStrike.CONE = Float.parseFloat(event.getMessage().split(" ")[1]);
|
||||||
|
this.Announce(C.cPurple + C.Bold + "Cone of Fire: " + ChatColor.RESET + (int)(MineStrike.CONE * 100) + "%");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.getMessage().contains("move"))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MineStrike.MOVE_PENALTY = Float.parseFloat(event.getMessage().split(" ")[1]);
|
||||||
|
this.Announce(C.cPurple + C.Bold + "Move/Sprint/Jump Penalties: " + ChatColor.RESET + (int)(MineStrike.MOVE_PENALTY * 100) + "%");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getMessage().contains("instant"))
|
if (event.getMessage().contains("instant"))
|
||||||
{
|
{
|
||||||
_bulletInstant = (_bulletInstant + 1)%3;
|
_bulletInstant = (_bulletInstant + 1)%3;
|
||||||
@ -2882,4 +2998,126 @@ public class MineStrike extends TeamGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void bombMove(PlayerMoveEvent event)
|
||||||
|
{
|
||||||
|
if (_bombHolder == null || !event.getPlayer().equals(_bombHolder))
|
||||||
|
return;
|
||||||
|
|
||||||
|
_bombHolderLastMove = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void bombTimeDrop(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_freezeTime > 0)
|
||||||
|
_bombHolderLastMove = System.currentTimeMillis();
|
||||||
|
|
||||||
|
if (_bombHolder != null && UtilTime.elapsed(_bombHolderLastMove, 10000))
|
||||||
|
{
|
||||||
|
_bombHolder.getInventory().remove(Material.GOLD_SWORD);
|
||||||
|
|
||||||
|
Vector vel = new Vector(Math.random() - 0.5, 0, Math.random() - 0.5);
|
||||||
|
vel.normalize();
|
||||||
|
vel.multiply(0.3);
|
||||||
|
vel.setY(0.2);
|
||||||
|
|
||||||
|
_bombItem = _bombHolder.getWorld().dropItem(_bombHolder.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD, (byte)0, 1, C.cGold + C.Bold + "C4 Explosive"));
|
||||||
|
_bombItem.setVelocity(vel);
|
||||||
|
_bombItem.setPickupDelay(60);
|
||||||
|
|
||||||
|
//Radio
|
||||||
|
playSound(Radio.T_BOMB_DROP, null, GetTeam(_bombHolder));
|
||||||
|
|
||||||
|
_bombHolder = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Location GetSpectatorLocation()
|
||||||
|
{
|
||||||
|
if (SpectatorSpawn != null)
|
||||||
|
return SpectatorSpawn;
|
||||||
|
|
||||||
|
Vector vec = new Vector(0, 0, 0);
|
||||||
|
double count = 0;
|
||||||
|
|
||||||
|
for (GameTeam team : this.GetTeamList())
|
||||||
|
{
|
||||||
|
for (Location spawn : team.GetSpawns())
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
vec.add(spawn.toVector());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SpectatorSpawn = new Location(this.WorldData.World, 0, 0, 0);
|
||||||
|
|
||||||
|
vec.multiply(1d / count);
|
||||||
|
|
||||||
|
SpectatorSpawn.setX(vec.getX());
|
||||||
|
SpectatorSpawn.setY(vec.getY() + 50); //ADD 50
|
||||||
|
SpectatorSpawn.setZ(vec.getZ());
|
||||||
|
|
||||||
|
// Move Up - Out Of Blocks
|
||||||
|
while (!UtilBlock.airFoliage(SpectatorSpawn.getBlock())
|
||||||
|
|| !UtilBlock.airFoliage(SpectatorSpawn.getBlock().getRelative(BlockFace.UP)))
|
||||||
|
{
|
||||||
|
SpectatorSpawn.add(0, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Up = 0;
|
||||||
|
|
||||||
|
// Move Up - Through Air
|
||||||
|
for (int i = 0; i < 15; i++)
|
||||||
|
{
|
||||||
|
if (UtilBlock.airFoliage(SpectatorSpawn.getBlock().getRelative(BlockFace.UP)))
|
||||||
|
{
|
||||||
|
SpectatorSpawn.add(0, 1, 0);
|
||||||
|
Up++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move Down - Out Of Blocks
|
||||||
|
while (Up > 0 && !UtilBlock.airFoliage(SpectatorSpawn.getBlock())
|
||||||
|
|| !UtilBlock.airFoliage(SpectatorSpawn.getBlock().getRelative(BlockFace.UP)))
|
||||||
|
{
|
||||||
|
SpectatorSpawn.subtract(0, 1, 0);
|
||||||
|
Up--;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpectatorSpawn = SpectatorSpawn.getBlock().getLocation().add(0.5, 0.1, 0.5);
|
||||||
|
|
||||||
|
while (SpectatorSpawn.getBlock().getTypeId() != 0 || SpectatorSpawn.getBlock().getRelative(BlockFace.UP).getTypeId() != 0)
|
||||||
|
SpectatorSpawn.add(0, 1, 0);
|
||||||
|
|
||||||
|
return SpectatorSpawn;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void enableScpResPack(PlayerCommandPreprocessEvent event)
|
||||||
|
{
|
||||||
|
if (event.getMessage().equalsIgnoreCase("/rpoff"))
|
||||||
|
{
|
||||||
|
event.getPlayer().setResourcePack("http://file.mineplex.com/ResReset.zip");
|
||||||
|
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Resource Pack: " + C.cRed + "Disabled"));
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Type " + F.elem("/rpon") + " to enable."));
|
||||||
|
}
|
||||||
|
else if (event.getMessage().equalsIgnoreCase("/rpon"))
|
||||||
|
{
|
||||||
|
event.getPlayer().setResourcePack(GetType().getResourcePackUrl());
|
||||||
|
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Resource Pack: " + C.cGreen + "Enabled"));
|
||||||
|
UtilPlayer.message(event.getPlayer(), F.main("Resource Pack", "Type " + F.elem("/rpoff") + " to disable."));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,14 +236,15 @@ public class ShopManager
|
|||||||
Host.registerGrenade(grenade, player);
|
Host.registerGrenade(grenade, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Use 250 instead of 255, to show that its kevlar/helmet
|
||||||
else if (item instanceof Helmet)
|
else if (item instanceof Helmet)
|
||||||
{
|
{
|
||||||
((Helmet)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(100, 0, 0) : Color.fromRGB(0, 0, 100));
|
((Helmet)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(250, 75, 75) : Color.fromRGB(125, 200, 250));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (item instanceof Kevlar)
|
else if (item instanceof Kevlar)
|
||||||
{
|
{
|
||||||
((Kevlar)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(100, 0, 0) : Color.fromRGB(0, 0, 100));
|
((Kevlar)item).giveToPlayer(player, (team.GetColor() == ChatColor.RED) ? Color.fromRGB(250, 75, 75) : Color.fromRGB(125, 200, 250));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (item instanceof DefusalKit)
|
else if (item instanceof DefusalKit)
|
||||||
|
@ -34,10 +34,18 @@ public class Bomb
|
|||||||
|
|
||||||
Block = planter.getLocation().getBlock();
|
Block = planter.getLocation().getBlock();
|
||||||
|
|
||||||
|
if (Block.getType() != Material.PORTAL)
|
||||||
|
{
|
||||||
Type = Block.getType();
|
Type = Block.getType();
|
||||||
Data = Block.getData();
|
Data = Block.getData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Type = Material.AIR;
|
||||||
|
Data = 0;
|
||||||
|
}
|
||||||
|
|
||||||
Block.setType(Material.DAYLIGHT_DETECTOR);
|
Block.setTypeIdAndData(Material.DAYLIGHT_DETECTOR.getId(), (byte)0, false);
|
||||||
|
|
||||||
StartTime = System.currentTimeMillis();
|
StartTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
@ -45,7 +53,7 @@ public class Bomb
|
|||||||
public boolean update()
|
public boolean update()
|
||||||
{
|
{
|
||||||
if (Block.getType() != Material.DAYLIGHT_DETECTOR)
|
if (Block.getType() != Material.DAYLIGHT_DETECTOR)
|
||||||
Block.setType(Material.DAYLIGHT_DETECTOR);
|
Block.setTypeIdAndData(Material.DAYLIGHT_DETECTOR.getId(), (byte)0, false);
|
||||||
|
|
||||||
double scale = (double)(System.currentTimeMillis() - StartTime)/(double)BombTime;
|
double scale = (double)(System.currentTimeMillis() - StartTime)/(double)BombTime;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public class Armor extends StrikeItem
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
|
LeatherArmorMeta meta = (LeatherArmorMeta)stack.getItemMeta();
|
||||||
return (meta.getColor().getBlue() == 100 || meta.getColor().getRed() == 100);
|
return (meta.getColor().getBlue() == 250 || meta.getColor().getRed() == 250);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -74,6 +74,19 @@ public abstract class FireGrenadeBase extends Grenade
|
|||||||
if (!UtilBlock.solid(block.getRelative(BlockFace.DOWN)))
|
if (!UtilBlock.solid(block.getRelative(BlockFace.DOWN)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
//Smoke
|
||||||
|
boolean nearSmoke = false;
|
||||||
|
for (Block other : UtilBlock.getSurrounding(block, false))
|
||||||
|
{
|
||||||
|
if (other.getType() == Material.PORTAL)
|
||||||
|
{
|
||||||
|
nearSmoke = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nearSmoke)
|
||||||
|
continue;
|
||||||
|
|
||||||
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(game.Manager.getPlugin(), new Runnable()
|
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(game.Manager.getPlugin(), new Runnable()
|
||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
@ -84,7 +97,7 @@ public abstract class FireGrenadeBase extends Grenade
|
|||||||
game.Manager.GetBlockRestore().Add(block, 51, (byte)0, (long) time);
|
game.Manager.GetBlockRestore().Add(block, 51, (byte)0, (long) time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 60 - (int)(60d * blocks.get(block)));
|
}, 30 - (int)(30d * blocks.get(block)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Initial Burn Sound
|
//Initial Burn Sound
|
||||||
|
@ -7,6 +7,7 @@ import mineplex.core.common.util.UtilBlock;
|
|||||||
import mineplex.core.common.util.UtilFirework;
|
import mineplex.core.common.util.UtilFirework;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||||
import nautilus.game.arcade.game.games.minestrike.Radio;
|
import nautilus.game.arcade.game.games.minestrike.Radio;
|
||||||
@ -34,7 +35,7 @@ public class FlashBang extends Grenade
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateCustom(MineStrike game, Entity ent)
|
public boolean updateCustom(MineStrike game, Entity ent)
|
||||||
{
|
{
|
||||||
if (ent.getTicksLived() > 40)
|
if (UtilTime.elapsed(_throwTime, 2000))
|
||||||
{
|
{
|
||||||
FireworkEffect effect = FireworkEffect.builder().flicker(true).withColor(Color.WHITE).with(Type.BALL_LARGE).trail(false).build();
|
FireworkEffect effect = FireworkEffect.builder().flicker(true).withColor(Color.WHITE).with(Type.BALL_LARGE).trail(false).build();
|
||||||
UtilFirework.playFirework(ent.getLocation().add(0, 0.5, 0), effect);
|
UtilFirework.playFirework(ent.getLocation().add(0, 0.5, 0), effect);
|
||||||
@ -68,8 +69,8 @@ public class FlashBang extends Grenade
|
|||||||
double flashIntensity = 2 - UtilMath.offset(player.getEyeLocation().add(player.getLocation().getDirection()), eyeToGrenade);
|
double flashIntensity = 2 - UtilMath.offset(player.getEyeLocation().add(player.getLocation().getDirection()), eyeToGrenade);
|
||||||
|
|
||||||
//Duration
|
//Duration
|
||||||
double duration = (2 + (3 * (players.get(player)))) * flashIntensity;
|
double duration = (2 + (2 * (players.get(player)))) * flashIntensity;
|
||||||
duration += 1;
|
duration = (Math.min(5, duration));
|
||||||
|
|
||||||
//Blind
|
//Blind
|
||||||
game.Manager.GetCondition().Factory().Blind(getName(), player, _thrower, duration, 0, false, false, false);
|
game.Manager.GetCondition().Factory().Blind(getName(), player, _thrower, duration, 0, false, false, false);
|
||||||
|
@ -19,6 +19,7 @@ import mineplex.core.common.util.UtilAction;
|
|||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilInv;
|
import mineplex.core.common.util.UtilInv;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
@ -75,6 +76,8 @@ public abstract class Grenade extends StrikeItem
|
|||||||
|
|
||||||
protected int _limit;
|
protected int _limit;
|
||||||
|
|
||||||
|
protected long _throwTime = 0;
|
||||||
|
|
||||||
public Grenade(String name, String[] desc, int cost, int gemCost, Material skin, int limit)
|
public Grenade(String name, String[] desc, int cost, int gemCost, Material skin, int limit)
|
||||||
{
|
{
|
||||||
super(StrikeItemType.GRENADE, name, desc, cost, gemCost, skin);
|
super(StrikeItemType.GRENADE, name, desc, cost, gemCost, skin);
|
||||||
@ -87,7 +90,7 @@ public abstract class Grenade extends StrikeItem
|
|||||||
int alreadyHas = 0;
|
int alreadyHas = 0;
|
||||||
int bestSlot = -1;
|
int bestSlot = -1;
|
||||||
|
|
||||||
for (int i = 3 ; i < 7 ; i++)
|
for (int i = 6 ; i >= 3 ; i--)
|
||||||
{
|
{
|
||||||
if (UtilInv.IsItem(player.getInventory().getItem(i), getSkin(), (byte) -1))
|
if (UtilInv.IsItem(player.getInventory().getItem(i), getSkin(), (byte) -1))
|
||||||
alreadyHas++;
|
alreadyHas++;
|
||||||
@ -154,14 +157,19 @@ public abstract class Grenade extends StrikeItem
|
|||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
playSound(game, player);
|
playSound(game, player);
|
||||||
|
|
||||||
|
_throwTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean update(MineStrike game, Entity ent)
|
public boolean update(MineStrike game, Entity ent)
|
||||||
{
|
{
|
||||||
//Invalid
|
if (UtilTime.elapsed(_throwTime, 20000))
|
||||||
if (!ent.isValid())
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
//Invalid (Burned)
|
||||||
|
if (!ent.isValid())
|
||||||
|
return updateCustom(game, ent);
|
||||||
|
|
||||||
//Rebound Off Blocks
|
//Rebound Off Blocks
|
||||||
rebound(ent);
|
rebound(ent);
|
||||||
|
|
||||||
@ -174,9 +182,14 @@ public abstract class Grenade extends StrikeItem
|
|||||||
|
|
||||||
public void rebound(Entity ent)
|
public void rebound(Entity ent)
|
||||||
{
|
{
|
||||||
if (UtilEnt.isGrounded(ent) || ent.getVelocity().length() < 0.1 || ent.getTicksLived() < 4)
|
if (UtilEnt.isGrounded(ent) || ent.getVelocity().length() < 0.1 || !UtilTime.elapsed(_throwTime, 200))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Math.abs(_vel.getX()) < 0.1 && Math.abs(_vel.getX()) < 0.1)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* What we must do here, is record the velocity every tick.
|
* What we must do here, is record the velocity every tick.
|
||||||
* Then when it collides, we get the velocity from a few ticks before and apply it, reversing the direction of collision.
|
* Then when it collides, we get the velocity from a few ticks before and apply it, reversing the direction of collision.
|
||||||
@ -184,8 +197,8 @@ public abstract class Grenade extends StrikeItem
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//X Rebound
|
//X Rebound
|
||||||
if ((_vel.getX() > 0.05 && ent.getLocation().getX() - _lastLoc.getX() <= 0) ||
|
if ((_vel.getX() > 0.1 && ent.getLocation().getX() - _lastLoc.getX() <= 0) ||
|
||||||
(_vel.getX() < 0.05 && ent.getLocation().getX() - _lastLoc.getX() >= 0))
|
(_vel.getX() < 0.1 && ent.getLocation().getX() - _lastLoc.getX() >= 0))
|
||||||
{
|
{
|
||||||
_vel = _velHistory.get(0);
|
_vel = _velHistory.get(0);
|
||||||
_vel.setX(-_vel.getX());
|
_vel.setX(-_vel.getX());
|
||||||
@ -197,8 +210,8 @@ public abstract class Grenade extends StrikeItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Z Rebound
|
//Z Rebound
|
||||||
else if ((_vel.getZ() > 0.05 && ent.getLocation().getZ() - _lastLoc.getZ() <= 0) ||
|
else if ((_vel.getZ() > 0.1 && ent.getLocation().getZ() - _lastLoc.getZ() <= 0) ||
|
||||||
(_vel.getZ() < 0.05 && ent.getLocation().getZ() - _lastLoc.getZ() >= 0))
|
(_vel.getZ() < 0.1 && ent.getLocation().getZ() - _lastLoc.getZ() >= 0))
|
||||||
{
|
{
|
||||||
_vel = _velHistory.get(0);
|
_vel = _velHistory.get(0);
|
||||||
_vel.setZ(-_vel.getZ());
|
_vel.setZ(-_vel.getZ());
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
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.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
@ -35,7 +36,7 @@ public class HighExplosive extends Grenade
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateCustom(MineStrike game, Entity ent)
|
public boolean updateCustom(MineStrike game, Entity ent)
|
||||||
{
|
{
|
||||||
if (ent.getTicksLived() > 40)
|
if (UtilTime.elapsed(_throwTime, 2000))
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION,
|
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION,
|
||||||
ent.getLocation(), 0, 0, 0, 0, 1,
|
ent.getLocation(), 0, 0, 0, 0, 1,
|
||||||
@ -43,7 +44,7 @@ public class HighExplosive extends Grenade
|
|||||||
ent.getWorld().playSound(ent.getLocation(),
|
ent.getWorld().playSound(ent.getLocation(),
|
||||||
Sound.EXPLODE, 3f, 0.8f);
|
Sound.EXPLODE, 3f, 0.8f);
|
||||||
|
|
||||||
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 10);
|
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 9);
|
||||||
List<Player> damagedPlayers = new ArrayList<>();
|
List<Player> damagedPlayers = new ArrayList<>();
|
||||||
for (Player player : players.keySet())
|
for (Player player : players.keySet())
|
||||||
{
|
{
|
||||||
@ -51,7 +52,7 @@ public class HighExplosive extends Grenade
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Damage Event
|
// Damage Event
|
||||||
game.Manager.GetDamage().NewDamageEvent(player, _thrower, null,
|
game.Manager.GetDamage().NewDamageEvent(player, _thrower, null, ent.getLocation(),
|
||||||
DamageCause.CUSTOM, 1 + (players.get(player) * 18),
|
DamageCause.CUSTOM, 1 + (players.get(player) * 18),
|
||||||
true, true, false, _thrower.getName(), getName());
|
true, true, false, _thrower.getName(), getName());
|
||||||
|
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
package nautilus.game.arcade.game.games.minestrike.items.grenades;
|
package nautilus.game.arcade.game.games.minestrike.items.grenades;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
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 nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
@ -12,11 +17,15 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Smoke extends Grenade
|
public class Smoke extends Grenade
|
||||||
{
|
{
|
||||||
|
private boolean _createdBlocks = false;
|
||||||
|
|
||||||
public Smoke()
|
public Smoke()
|
||||||
{
|
{
|
||||||
super("Smoke", new String[]
|
super("Smoke", new String[]
|
||||||
@ -27,24 +36,56 @@ public class Smoke extends Grenade
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateCustom(MineStrike game, Entity ent)
|
public boolean updateCustom(final MineStrike game, Entity ent)
|
||||||
{
|
{
|
||||||
if (ent.getTicksLived() > 60)
|
if (UtilTime.elapsed(_throwTime, 2000) && (UtilEnt.isGrounded(ent) || !ent.isValid()))
|
||||||
{
|
{
|
||||||
UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0.3f, 0.3f, 0.3f, 0, 1,
|
// UtilParticle.PlayParticle(ParticleType.HUGE_EXPLOSION, ent.getLocation(), 0.3f, 0.3f, 0.3f, 0, 1,
|
||||||
ViewDist.MAX, UtilServer.getPlayers());
|
// ViewDist.MAX, UtilServer.getPlayers());
|
||||||
|
|
||||||
ent.getWorld().playSound(ent.getLocation(), Sound.FIZZ, 0.1f, 0.1f);
|
|
||||||
|
|
||||||
|
//Remove Fire
|
||||||
for (Location loc : game.Manager.GetBlockRestore().RestoreBlockAround(Material.FIRE, ent.getLocation(), 5))
|
for (Location loc : game.Manager.GetBlockRestore().RestoreBlockAround(Material.FIRE, ent.getLocation(), 5))
|
||||||
{
|
{
|
||||||
loc.getWorld().playSound(loc, Sound.FIZZ, 1f, 1f);
|
loc.getWorld().playSound(loc, Sound.FIZZ, 1f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Smoke Blocks
|
||||||
|
if (!_createdBlocks)
|
||||||
|
{
|
||||||
|
final HashMap<Block, Double> blocks = UtilBlock.getInRadius(ent.getLocation().add(0, 1, 0), 4d);
|
||||||
|
final int round = game.getRound();
|
||||||
|
for (final Block block : blocks.keySet())
|
||||||
|
{
|
||||||
|
if (block.getType() != Material.AIR && block.getType() != Material.PORTAL && block.getType() != Material.FIRE)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(game.Manager.getPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
if (round == game.getRound() && !game.isFreezeTime())
|
||||||
|
{
|
||||||
|
//18 seconds
|
||||||
|
long duration = (long) (15000 + blocks.get(block) * 3000);
|
||||||
|
|
||||||
|
game.registerSmokeBlock(block, System.currentTimeMillis() + duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 10 - (int)(10d * blocks.get(block)));
|
||||||
|
}
|
||||||
|
|
||||||
|
_createdBlocks = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ent.getWorld().playSound(ent.getLocation(), Sound.FIZZ, 0.1f, 0.1f);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ent.getTicksLived() > 360;
|
//18 seconds
|
||||||
|
return UtilTime.elapsed(_throwTime, 18000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,6 +48,8 @@ public class Gun extends StrikeItem
|
|||||||
|
|
||||||
protected boolean _reloading = false;
|
protected boolean _reloading = false;
|
||||||
|
|
||||||
|
protected boolean _reloadTick = false;
|
||||||
|
|
||||||
public Gun(GunStats gunStats)
|
public Gun(GunStats gunStats)
|
||||||
{
|
{
|
||||||
super(gunStats.getItemType(), gunStats.getName(), gunStats.getDesc(), gunStats.getCost(), gunStats.getGemCost(), gunStats.getSkin());
|
super(gunStats.getItemType(), gunStats.getName(), gunStats.getDesc(), gunStats.getCost(), gunStats.getGemCost(), gunStats.getSkin());
|
||||||
@ -118,22 +120,32 @@ public class Gun extends StrikeItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Recharge.Instance.use(player, getName() + " Shoot", _gunStats.getFireRate(), false, false))
|
if (!Recharge.Instance.use(player, getName() + " Shoot", _gunStats.getFireRate(), false, false))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Use Ammo
|
//Use Ammo
|
||||||
_loadedAmmo--;
|
_loadedAmmo--;
|
||||||
updateWeaponName(player);
|
//updateWeaponName(player);
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
soundFire(player.getLocation());
|
soundFire(player.getLocation());
|
||||||
|
|
||||||
//Visual
|
//Smoke
|
||||||
Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(1.2));
|
Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(1.2));
|
||||||
loc.add(UtilAlg.getRight(player.getLocation().getDirection()).multiply(0.5));
|
loc.add(UtilAlg.getRight(player.getLocation().getDirection()).multiply(0.5));
|
||||||
loc.add(UtilAlg.getDown(player.getLocation().getDirection()).multiply(0.3));
|
loc.add(UtilAlg.getDown(player.getLocation().getDirection()).multiply(0.4));
|
||||||
UtilParticle.PlayParticle(ParticleType.EXPLODE, loc, 0, 0, 0, 0, 1,
|
UtilParticle.PlayParticle(Math.random() > 0.5 ? ParticleType.ANGRY_VILLAGER : ParticleType.HEART, loc, 0, 0, 0, 0, 1,
|
||||||
ViewDist.LONG, UtilServer.getPlayers());
|
ViewDist.LONG, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
//Shell
|
||||||
|
loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(0.6));
|
||||||
|
loc.add(UtilAlg.getRight(player.getLocation().getDirection()).multiply(0.7));
|
||||||
|
loc.add(UtilAlg.getDown(player.getLocation().getDirection()).multiply(0.5));
|
||||||
|
UtilParticle.PlayParticle(ParticleType.SPLASH, loc, 0, 0, 0, 0, 1,
|
||||||
|
ViewDist.LONG, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
|
||||||
game.registerBullet(fireBullet(player, game));
|
game.registerBullet(fireBullet(player, game));
|
||||||
|
|
||||||
//Unscope
|
//Unscope
|
||||||
@ -164,6 +176,7 @@ public class Gun extends StrikeItem
|
|||||||
Vector cof = new Vector(Math.random() - 0.5, (Math.random() - 0.2) * (5d/8d), Math.random() - 0.5);
|
Vector cof = new Vector(Math.random() - 0.5, (Math.random() - 0.2) * (5d/8d), Math.random() - 0.5);
|
||||||
cof.normalize();
|
cof.normalize();
|
||||||
cof.multiply(cone);
|
cof.multiply(cone);
|
||||||
|
cof.multiply(MineStrike.CONE);
|
||||||
|
|
||||||
cof.add(player.getLocation().getDirection());
|
cof.add(player.getLocation().getDirection());
|
||||||
cof.normalize();
|
cof.normalize();
|
||||||
@ -262,7 +275,7 @@ public class Gun extends StrikeItem
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Recharge
|
//Recharge
|
||||||
Recharge.Instance.use(player, getName() + " Reload", getReloadTime(), false, true, true);
|
Recharge.Instance.use(player, getName() + " Reload", getReloadTime(), false, true);
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
soundReload(player.getLocation());
|
soundReload(player.getLocation());
|
||||||
@ -282,16 +295,35 @@ public class Gun extends StrikeItem
|
|||||||
updateWeaponName(null);
|
updateWeaponName(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void displayAmmo(Player player)
|
||||||
|
{
|
||||||
|
if (!UtilGear.isMat(player.getItemInHand(), getStack().getType()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Weapon Bob during reload
|
||||||
|
if (_reloading)
|
||||||
|
updateWeaponName(player);
|
||||||
|
|
||||||
|
if (!Recharge.Instance.usable(player, getName() + " Reload"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_loadedAmmo > 0 || _reserveAmmo > 0)
|
||||||
|
UtilTextBottom.display(C.cGreen + _loadedAmmo + ChatColor.RESET + " / " + C.cYellow + _reserveAmmo, player);
|
||||||
|
else
|
||||||
|
UtilTextBottom.display(C.cRed + "No Ammo", player);
|
||||||
|
}
|
||||||
|
|
||||||
public void updateWeaponName(Player player)
|
public void updateWeaponName(Player player)
|
||||||
{
|
{
|
||||||
ItemMeta meta = getStack().getItemMeta();
|
ItemMeta meta = getStack().getItemMeta();
|
||||||
meta.setDisplayName(ChatColor.RESET + (getOwnerName() == null ? "" : getOwnerName() + "'s ") + C.Bold + getName() + ChatColor.RESET + " " + C.cGreen + _loadedAmmo + ChatColor.RESET + " / " + C.cYellow + _reserveAmmo);
|
meta.setDisplayName(ChatColor.RESET + (getOwnerName() == null ? "" : getOwnerName() + "'s ") + C.Bold + getName() + (_reloadTick ? ChatColor.RED : ChatColor.WHITE));
|
||||||
getStack().setItemMeta(meta);
|
getStack().setItemMeta(meta);
|
||||||
|
|
||||||
getStack().setAmount(Math.max(1, _loadedAmmo));
|
|
||||||
|
|
||||||
if (player != null)
|
if (player != null)
|
||||||
|
{
|
||||||
player.getInventory().setItem(_slot, getStack());
|
player.getInventory().setItem(_slot, getStack());
|
||||||
|
_reloadTick = !_reloadTick;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDropOff()
|
public double getDropOff()
|
||||||
@ -346,7 +378,7 @@ public class Gun extends StrikeItem
|
|||||||
_reserveAmmo = Math.max(0, ammo - _gunStats.getClipSize());
|
_reserveAmmo = Math.max(0, ammo - _gunStats.getClipSize());
|
||||||
|
|
||||||
//Update
|
//Update
|
||||||
updateWeaponName(player);
|
//updateWeaponName(player);
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
player.getWorld().playSound(player.getEyeLocation(), Sound.PISTON_EXTEND, 1f, 1.6f);
|
player.getWorld().playSound(player.getEyeLocation(), Sound.PISTON_EXTEND, 1f, 1.6f);
|
||||||
@ -414,7 +446,7 @@ public class Gun extends StrikeItem
|
|||||||
_loadedAmmo = _gunStats.getClipSize();
|
_loadedAmmo = _gunStats.getClipSize();
|
||||||
_reserveAmmo = _gunStats.getClipReserve() * _gunStats.getClipSize();
|
_reserveAmmo = _gunStats.getClipReserve() * _gunStats.getClipSize();
|
||||||
|
|
||||||
updateWeaponName(player);
|
//updateWeaponName(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getDamage()
|
public double getDamage()
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package nautilus.game.arcade.game.games.minestrike.items.guns;
|
package nautilus.game.arcade.game.games.minestrike.items.guns;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||||
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -241,7 +242,6 @@ public enum GunStats
|
|||||||
|
|
||||||
private double _coneMin;
|
private double _coneMin;
|
||||||
private double _coneMax;
|
private double _coneMax;
|
||||||
private double _coneReduceRate;
|
|
||||||
private double _coneIncreaseRate;
|
private double _coneIncreaseRate;
|
||||||
|
|
||||||
private boolean _scope = false;
|
private boolean _scope = false;
|
||||||
@ -375,7 +375,7 @@ public enum GunStats
|
|||||||
|
|
||||||
public double getConeIncreaseRate()
|
public double getConeIncreaseRate()
|
||||||
{
|
{
|
||||||
return _coneIncreaseRate;
|
return _coneIncreaseRate * MineStrike.RECOIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getScope()
|
public boolean getScope()
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.minestrike.items.guns;
|
package nautilus.game.arcade.game.games.minestrike.items.guns;
|
||||||
|
|
||||||
|
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||||
|
|
||||||
public enum GunType
|
public enum GunType
|
||||||
{
|
{
|
||||||
PISTOL("Pistol", 0.01, 0.02, 0.02, 3f, 0.1),
|
PISTOL("Pistol", 0.01, 0.02, 0.02, 3f, 0.1),
|
||||||
@ -38,17 +40,17 @@ public enum GunType
|
|||||||
|
|
||||||
public double getMovePenalty()
|
public double getMovePenalty()
|
||||||
{
|
{
|
||||||
return _movePenalty;
|
return _movePenalty * MineStrike.MOVE_PENALTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getSprintPenalty()
|
public double getSprintPenalty()
|
||||||
{
|
{
|
||||||
return _sprintPentalty;
|
return _sprintPentalty * MineStrike.MOVE_PENALTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getJumpPenalty()
|
public double getJumpPenalty()
|
||||||
{
|
{
|
||||||
return _jumpPenalty;
|
return _jumpPenalty * MineStrike.MOVE_PENALTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getVolume()
|
public float getVolume()
|
||||||
|
@ -43,7 +43,7 @@ public class Shotgun extends Gun
|
|||||||
|
|
||||||
//Use Ammo
|
//Use Ammo
|
||||||
_loadedAmmo--;
|
_loadedAmmo--;
|
||||||
updateWeaponName(player);
|
//updateWeaponName(false);
|
||||||
|
|
||||||
//Effect
|
//Effect
|
||||||
soundFire(player.getLocation());
|
soundFire(player.getLocation());
|
||||||
|
@ -273,8 +273,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 4;
|
if(event.getBlock().getLocation().getBlockY() < _maxY - 4)
|
||||||
if(event.getBlock().getLocation().getBlockY() < _maxY)
|
|
||||||
{
|
{
|
||||||
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -298,7 +297,6 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
}
|
}
|
||||||
|
|
||||||
Location blockLocation = event.getBlock().getLocation();
|
Location blockLocation = event.getBlock().getLocation();
|
||||||
_maxY = GetTeamList().get(1).GetSpawn().getBlockY() - 3;
|
|
||||||
if(blockLocation.add(0,1,0).getBlock().getType() == Material.AIR)
|
if(blockLocation.add(0,1,0).getBlock().getType() == Material.AIR)
|
||||||
{
|
{
|
||||||
for(Player humans: _runners.GetPlayers(true))
|
for(Player humans: _runners.GetPlayers(true))
|
||||||
@ -317,7 +315,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(blockLocation.getBlockY() < _maxY)
|
if(blockLocation.getBlockY() < _maxY - 3)
|
||||||
{
|
{
|
||||||
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -435,6 +433,7 @@ public class WitherGame extends TeamGame implements IBlockRestorer
|
|||||||
if (event.GetState() != GameState.Live)
|
if (event.GetState() != GameState.Live)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
_maxY = GetTeamList().get(1).GetSpawn().getBlockY();
|
||||||
UtilTextMiddle.display(C.cGreen + "Humans Hiding",
|
UtilTextMiddle.display(C.cGreen + "Humans Hiding",
|
||||||
"15 Seconds until Assault", 10, 80, 10);
|
"15 Seconds until Assault", 10, 80, 10);
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user