Merge branches 'feature/report' and 'master' of ssh://184.154.0.242:7999/min/mineplex into feature/report

This commit is contained in:
Keir 2015-11-22 13:54:16 +00:00
commit dcca67e571
53 changed files with 1030 additions and 240 deletions

View 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

View File

@ -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.

View File

@ -38,9 +38,8 @@ public class PlayerTracker implements Listener, Runnable
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
_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(),
region, PlayerStatus.class, "playerStatus");
Region.currentRegion(), PlayerStatus.class, "playerStatus");
ServerCommandManager.getInstance().registerCommandType("PlayerJoinCommand", mineplex.serverdata.commands.PlayerJoinCommand.class, new PlayerJoinHandler(this));

View File

@ -29,7 +29,6 @@ import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.World;
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.entity.CraftCreature;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
@ -291,6 +290,8 @@ public class UtilEnt
creatureMap.put("WitherSkull", EntityType.WITHER_SKULL);
creatureMap.put("Wolf", EntityType.WOLF);
creatureMap.put("Zombie", EntityType.ZOMBIE);
creatureMap.put("Guardian", EntityType.GUARDIAN);
creatureMap.put("Rabbit", EntityType.RABBIT);
creatureMap.put("Item", EntityType.DROPPED_ITEM);
}
@ -457,6 +458,28 @@ public class UtilEnt
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)
{
if (disguise != null)
@ -480,7 +503,7 @@ public class UtilEnt
}
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;
}

View File

@ -27,14 +27,7 @@ public class UpdateRank extends CommandBase<CoreClientManager>
@Override
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)
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "/" + AliasUsed + " joeschmo MODERATOR"));
@ -62,79 +55,70 @@ public class UpdateRank extends CommandBase<CoreClientManager>
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)
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
{
if (!testServer && rank.has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
public void run(List<String> matches)
{
UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Insufficient privileges!"));
return;
}
Plugin.getRepository().matchPlayerName(new Callback<List<String>>()
{
public void run(List<String> matches)
boolean matchedExact = false;
for (String match : matches)
{
boolean matchedExact = false;
for (String match : matches)
if (match.equalsIgnoreCase(playerName))
{
if (match.equalsIgnoreCase(playerName))
{
matchedExact = true;
}
matchedExact = true;
}
if (matchedExact)
{
for (Iterator<String> matchIterator = matches.iterator(); matchIterator.hasNext();)
{
if (!matchIterator.next().equalsIgnoreCase(playerName))
{
matchIterator.remove();
}
}
}
if (UtilPlayer.isOnline(playerName))
{
Player p = UtilServer.getServer().getPlayer(playerName);
if (Plugin.Get(p).GetRank() != Plugin.Get(p).GetRank(true))
Plugin.Get(p).resetTemp();
OnlineRankUpdateEvent event = new OnlineRankUpdateEvent(caller, Plugin.Get(caller).GetRank(), rank, true);
Plugin.Get(p).SetRank(rank, false);
Bukkit.getPluginManager().callEvent(event);
UtilPlayer.message(p, F.main(Plugin.getName(), "Your rank has been updated to " + rank.Name + "!"));
}
UtilPlayer.searchOffline(matches, new Callback<String>()
{
public void run(final String target)
{
if (target == null)
{
return;
}
UUID uuid = Plugin.loadUUIDFromDB(playerName);
if (uuid == null)
uuid = UUIDFetcher.getUUIDOf(playerName);
Plugin.getRepository().saveRank(new Callback<Rank>()
{
public void run(Rank rank)
{
caller.sendMessage(F.main(Plugin.getName(), target + "'s rank has been updated to " + rank.Name + "!"));
}
}, target, uuid, rank, true);
}
}, caller, playerName, true);
}
}, playerName);
}
if (matchedExact)
{
for (Iterator<String> matchIterator = matches.iterator(); matchIterator.hasNext();)
{
if (!matchIterator.next().equalsIgnoreCase(playerName))
{
matchIterator.remove();
}
}
}
if (UtilPlayer.isOnline(playerName))
{
Player p = UtilServer.getServer().getPlayer(playerName);
if (Plugin.Get(p).GetRank() != Plugin.Get(p).GetRank(true))
Plugin.Get(p).resetTemp();
OnlineRankUpdateEvent event = new OnlineRankUpdateEvent(caller, Plugin.Get(caller).GetRank(), rank, true);
Plugin.Get(p).SetRank(rank, false);
Bukkit.getPluginManager().callEvent(event);
UtilPlayer.message(p, F.main(Plugin.getName(), "Your rank has been updated to " + rank.Name + "!"));
}
UtilPlayer.searchOffline(matches, new Callback<String>()
{
public void run(final String target)
{
if (target == null)
{
return;
}
UUID uuid = Plugin.loadUUIDFromDB(playerName);
if (uuid == null)
uuid = UUIDFetcher.getUUIDOf(playerName);
Plugin.getRepository().saveRank(new Callback<Rank>()
{
public void run(Rank rank)
{
caller.sendMessage(F.main(Plugin.getName(), target + "'s rank has been updated to " + rank.Name + "!"));
}
}, target, uuid, rank, true);
}
}, caller, playerName, true);
}
}, playerName);
}
}
}

View File

@ -329,6 +329,12 @@ public enum Achievement
new String[]{"Kill the Enemy Flag Carrier in Sudden Death"},
new int[]{1},
AchievementCategory.CHAMPIONS),
CHAMPIONS_SPECIAL_WIN("Champion of Champions", 3000,
new String[]{"Champions Capture the Flag.SpecialWin"},
new String[]{"Win the game with 5 more captures than the other team"},
new int[]{1},
AchievementCategory.CHAMPIONS),
//Paintball
SUPER_PAINTBALL_WINS("Paintball King", 600,

View File

@ -74,6 +74,8 @@ public abstract class Gadget extends SalesPackageBase implements Listener
return;
}
System.out.println(player.getName() + " has activated " + Name);
EnableCustom(player);
Manager.setActive(player, this);
}

View File

@ -1,5 +1,6 @@
package mineplex.core.game;
import org.bukkit.DyeColor;
import org.bukkit.Material;
public enum GameDisplay
@ -10,7 +11,6 @@ public enum GameDisplay
Bridge("The Bridges", Material.IRON_PICKAXE, (byte)0, GameCategory.SURVIVAL, 3),
CastleSiege("Castle Siege", Material.DIAMOND_CHESTPLATE, (byte)0, GameCategory.CLASSICS, 4),
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),
Christmas("Christmas Chaos", Material.SNOW_BALL, (byte)0, GameCategory.CLASSICS, 8),
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),
Draw("Draw My Thing", Material.BOOK_AND_QUILL, (byte)0, GameCategory.CLASSICS, 15),
Evolution("Evolution", Material.EMERALD, (byte)0, GameCategory.ARCADE, 16),
//FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17),
Gravity("Gravity", Material.SEA_LANTERN, (byte)0, GameCategory.EXTRA, 18),
Gravity("Gravity", Material.ENDER_PORTAL, (byte)0, GameCategory.EXTRA, 18),
Halloween("Halloween Horror", Material.PUMPKIN, (byte)0, GameCategory.CLASSICS, 19),
HideSeek("Block Hunt", Material.GRASS, (byte)0, GameCategory.CLASSICS, 20),
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),
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);

View File

@ -135,6 +135,12 @@ public class ProjectileManager extends MiniPlugin
expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
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
public void Update(UpdateEvent event)

View File

@ -269,6 +269,13 @@ public class ProjectileUser
nmsEntity.locY -= nmsEntity.motY / 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);
return true;
}

View File

@ -132,7 +132,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
itemIgnore.add("Proximity Zapper");
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");
_classManager = new ClassManager(plugin, _clientManager, donationManager, skillManager, itemFactory, webServerAddress);

View File

@ -67,7 +67,6 @@ import mineplex.hub.modules.NewsManager;
import mineplex.hub.modules.ParkourManager;
import mineplex.hub.modules.SoccerManager;
import mineplex.hub.modules.TextManager;
import mineplex.hub.modules.TrickOrTreatManager;
import mineplex.hub.modules.WorldManager;
import mineplex.hub.profile.gui.GUIProfile;
import mineplex.hub.tutorial.TutorialManager;

View File

@ -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(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);
_projectileManager.AddThrow(throwee, thrower, this, 4000, true, false, true, false, 0.5f);
@ -244,7 +246,9 @@ public class StackerManager extends MiniPlugin implements IThrown
if (!Manager.hasPlayerStackingEnabled(target))
return;
System.out.println("Stacker collide.");
//Velocity
UtilAction.velocity(target, UtilAlg.getTrajectory2d(data.GetThrown(), target), 1, true, 0.8, 0, 10, true);

View File

@ -315,6 +315,11 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
{
return _skillFactory;
}
public ItemFactory GetItemFactory()
{
return _itemFactory;
}
@Override
protected ClientClass AddPlayer(String player)

View File

@ -1,8 +1,11 @@
package mineplex.minecraft.game.classcombat.Condition;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
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.ConditionManager;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;

View File

@ -214,7 +214,7 @@ public class Immolate extends Skill
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));
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
cur.getWorld().playSound(cur.getLocation(), Sound.FIZZ, 0.2f, 1f);

View File

@ -113,7 +113,7 @@ public class Inferno extends SkillActive
itemStack.setItemMeta(meta);
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());
double x = 0.07 - (UtilMath.r(14)/100d);

View File

@ -18,17 +18,12 @@ import mineplex.core.common.util.F;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.minecraft.game.classcombat.Skill.SkillActive;
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.*;

View File

@ -153,7 +153,7 @@ public class HealingShot extends SkillActive
projectile.remove();
//Regen
if (Factory.Relation().canHurt(damager, damagee))
if (!Factory.Relation().canHurt(damager, damagee))
{
Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + level, 2, false, false, false);

View File

@ -144,19 +144,19 @@ public class NapalmShot extends SkillActive
//Damage
event.AddMod(damager.getName(), GetName(), 0, true);
//Effect
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.FIZZ, 2f, 1.5f);
//Remove
projectile.remove();
}
@EventHandler
@EventHandler(priority=EventPriority.MONITOR) //make it happen after the damage event ^
public void projectileHit(ProjectileHitEvent event)
{
Projectile proj = event.getEntity();
if (!_arrows.remove(proj))
if (!_arrows.contains(proj))
return;
if (proj.getShooter() == null)
@ -179,7 +179,7 @@ public class NapalmShot extends SkillActive
itemStack.setItemMeta(meta);
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)));
}

View File

@ -8,7 +8,6 @@ import java.util.List;
import mineplex.core.MiniPlugin;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.repository.GameSalesPackageToken;
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.ClassType;
import mineplex.minecraft.game.classcombat.Skill.ISkill.SkillType;
import mineplex.minecraft.game.classcombat.Skill.Brute.*;
import mineplex.minecraft.game.classcombat.Skill.Assassin.*;
import mineplex.minecraft.game.classcombat.Skill.Global.*;
import mineplex.minecraft.game.classcombat.Skill.Knight.*;
import mineplex.minecraft.game.classcombat.Skill.Mage.*;
import mineplex.minecraft.game.classcombat.Skill.Assassin.Assassin;
import mineplex.minecraft.game.classcombat.Skill.Assassin.BackStab;
import mineplex.minecraft.game.classcombat.Skill.Assassin.Blink;
import mineplex.minecraft.game.classcombat.Skill.Assassin.ComboAttack;
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.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.token.SkillToken;
import mineplex.minecraft.game.classcombat.item.Throwable.ProximityManager;
import mineplex.minecraft.game.core.IRelation;
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.fire.Fire;

View File

@ -28,6 +28,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
private Energy _energy;
private Fire _fire;
private ProjectileManager _projectileManager;
private ProximityManager _proxyManager;
private java.lang.reflect.Field _itemMaxDurability;
private HashMap<String, Item> _items;
private HashSet<String> _ignore;
@ -47,6 +48,7 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
_energy = energy;
_fire = fire;
_projectileManager = projectileManager;
_proxyManager = new ProximityManager();
_items = new HashMap<String, Item>();
_ignore = ignore;
@ -240,6 +242,8 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
for (Item item : _items.values())
registerEvents(item);
registerEvents(_proxyManager);
}
@Override
@ -249,5 +253,12 @@ public class ItemFactory extends MiniPlugin implements IItemFactory
for (Item item : _items.values())
HandlerList.unregisterAll(item);
HandlerList.unregisterAll(_proxyManager);
}
public ProximityManager getProximityManager()
{
return _proxyManager;
}
}

View File

@ -1,5 +1,17 @@
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.Material;
import org.bukkit.block.Block;
@ -9,21 +21,6 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
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
{
private ActionType _useAction;
@ -161,7 +158,7 @@ public abstract class ItemUsable extends Item implements IThrown
org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(GetType()));
UtilAction.velocity(ent, player.getLocation().getDirection(), _throwPower, false, 0, 0.2, 10, false);
Factory.Throw().AddThrow(ent, player, this, expire, _throwPlayer, _throwPlayer, _throwBlock, _throwIdle, _throwPickup, 0.5f);
ThrowCustom(event, ent);
}

View File

@ -2,9 +2,10 @@ package mineplex.minecraft.game.classcombat.item.Throwable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.Sound;
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.minecraft.game.classcombat.item.ItemFactory;
import mineplex.minecraft.game.classcombat.item.ItemUsable;
import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent;
public class ProximityExplosive extends ItemUsable
{
@ -63,7 +65,14 @@ public class ProximityExplosive extends ItemUsable
@Override
public void UseAction(PlayerInteractEvent event)
{
}
@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
@ -160,19 +169,22 @@ public class ProximityExplosive extends ItemUsable
{
if (event.getType() != UpdateType.FAST)
return;
Iterator<Entity> armedIter = _armed.keySet().iterator();
HashSet<Entity> expired = new HashSet<Entity>();
for (Entity ent : _armed.keySet())
while (armedIter.hasNext())
{
Entity ent = armedIter.next();
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();
}
}
}
}

View File

@ -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();
}
}
}

View File

@ -2,7 +2,9 @@ package mineplex.minecraft.game.classcombat.item.Throwable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.GameMode;
import org.bukkit.Material;
@ -31,6 +33,7 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.minecraft.game.classcombat.item.ItemFactory;
import mineplex.minecraft.game.classcombat.item.ItemUsable;
import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent;
public class ProximityZapper extends ItemUsable
{
@ -62,6 +65,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
public void Collide(LivingEntity target, Block block, ProjectileUser data)
@ -154,18 +164,21 @@ public class ProximityZapper extends ItemUsable
if (event.getType() != UpdateType.FAST)
return;
HashSet<Entity> expired = new HashSet<Entity>();
for (Entity ent : _armed.keySet())
Iterator<Entity> armedIter = _armed.keySet().iterator();
while (armedIter.hasNext())
{
Entity ent = armedIter.next();
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();
}
}
}
}

View File

@ -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;
}
}

View File

@ -61,7 +61,8 @@ public class ClassShopManager extends MiniPlugin
Achievement.CHAMPIONS_THE_LONGEST_SHOT,
Achievement.CHAMPIONS_WINS,
Achievement.CHAMPIONS_CAPTURES,
Achievement.CHAMPIONS_CLUTCH
Achievement.CHAMPIONS_CLUTCH,
Achievement.CHAMPIONS_SPECIAL_WIN
});
}
}

View File

@ -176,15 +176,7 @@ public class DamageManager extends MiniPlugin
{
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,
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor,
String source, String reason)
@ -193,6 +185,14 @@ public class DamageManager extends MiniPlugin
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)
public void CancelDamageEvent(CustomDamageEvent event)
{

View File

@ -42,9 +42,9 @@ public class Fire extends MiniPlugin
_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);
}
@ -60,13 +60,13 @@ public class Fire extends MiniPlugin
{
if (!_fire.get(fire).IsPrimed())
continue;
if (fire.getLocation().getBlock().isLiquid())
{
collided.put(fire, null);
continue;
}
for (LivingEntity ent : fire.getWorld().getEntitiesByClass(LivingEntity.class))
{
if (ent instanceof Player)
@ -75,13 +75,13 @@ public class Fire extends MiniPlugin
if (ent.hasPotionEffect(PotionEffectType.FIRE_RESISTANCE))
continue;
if (ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9)
continue;
if (ent.equals(_fire.get(fire).GetOwner()))
if (!_fire.get(fire).canHitOwner() && ent.equals(_fire.get(fire).GetOwner()))
continue;
if (_conditionManager.HasCondition(ent, ConditionType.FIRE_ITEM_IMMUNITY, null))
{
continue;
@ -111,23 +111,23 @@ public class Fire extends MiniPlugin
if (!_fire.containsKey(fire))
return;
if (_fire.get(fire).GetOwner().equals(player))
if (!_fire.get(fire).canHitOwner() && _fire.get(fire).GetOwner().equals(player))
return;
event.setCancelled(true);
if (((CraftPlayer)player).getHandle().spectating)
return;
if (player.hasPotionEffect(PotionEffectType.FIRE_RESISTANCE))
return;
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
return;
if (!_fire.get(fire).IsPrimed())
return;
if (_conditionManager.HasCondition(player, ConditionType.FIRE_ITEM_IMMUNITY, null))
{
return;

View File

@ -10,8 +10,9 @@ public class FireData
private double _burnTime;
private double _damage;
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;
_expireTime = System.currentTimeMillis() + (long)(1000 * expireTime);
@ -19,6 +20,7 @@ public class FireData
_burnTime = burnTime;
_damage = damage;
_skillName = skillName;
_hitOwner = hitSelf;
}
public LivingEntity GetOwner()
@ -50,4 +52,9 @@ public class FireData
{
return System.currentTimeMillis() > _expireTime;
}
public boolean canHitOwner()
{
return _hitOwner;
}
}

View File

@ -24,7 +24,6 @@ import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.cosmetic.CosmeticManager;
import mineplex.core.creature.Creature;
@ -41,9 +40,7 @@ import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.movement.Movement;
import mineplex.core.notifier.NotificationManager;
import mineplex.core.npc.NpcManager;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketHandler;
import mineplex.core.packethandler.PacketInfo;
import mineplex.core.party.PartyManager;
import mineplex.core.pet.PetManager;
import mineplex.core.poll.PollManager;
@ -61,7 +58,6 @@ import mineplex.core.status.ServerStatusManager;
import mineplex.core.task.TaskManager;
import mineplex.core.teleport.Teleport;
import mineplex.core.timing.TimingManager;
import mineplex.core.titangiveaway.TitanGiveawayManager;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.ClassManager;
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.GameTournamentManager;
import nautilus.game.arcade.managers.GameWorldManager;
import nautilus.game.arcade.managers.HolidayManager;
import nautilus.game.arcade.managers.IdleManager;
import nautilus.game.arcade.managers.MiscManager;
import nautilus.game.arcade.shop.ArcadeShop;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
@ -235,16 +231,19 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_explosionManager = new Explosion(plugin, _blockRestore);
_explosionManager.SetDebris(false);
if (serverConfig.GameList.contains(GameType.ChampionsDominate)
|| serverConfig.GameList.contains(GameType.ChampionsTDM)
|| serverConfig.GameList.contains(GameType.ChampionsCTF))
{
_conditionManager = new SkillConditionManager(plugin);
}
else
{
_conditionManager = new ConditionManager(plugin);
}
_conditionManager = new SkillConditionManager(plugin);
//Dont see a reason to ever just use the normal one
// if (serverConfig.GameList.contains(GameType.ChampionsDominate)
// || serverConfig.GameList.contains(GameType.ChampionsTDM)
// || serverConfig.GameList.contains(GameType.ChampionsCTF))
// {
// _conditionManager = new SkillConditionManager(plugin);
// }
// else
// {
// _conditionManager = new ConditionManager(plugin);
// }
_clientManager = clientManager;
_serverStatusManager = serverStatusManager;
@ -713,6 +712,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
{
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

View File

@ -72,7 +72,6 @@ public enum GameType
CastleSiege(CastleSiege.class, GameDisplay.CastleSiege),
ChampionsCTF(ChampionsCTF.class, GameDisplay.ChampionsCTF),
ChampionsDominate(ChampionsDominate.class, GameDisplay.ChampionsDominate),
//ChampionsMOBA(ChampionsMOBA.class, "Champions MOBA", "Champions", Material.SKULL_ITEM, (byte)0, GameCategory.CHAMPIONS, 7),
ChampionsTDM(ChampionsTDM.class, GameDisplay.ChampionsTDM),
Christmas(Christmas.class, GameDisplay.Christmas, "http://file.mineplex.com/ResChristmas.zip", true),
DeathTag(DeathTag.class, GameDisplay.DeathTag),
@ -83,7 +82,6 @@ public enum GameType
DragonsTeams(DragonsTeams.class, GameDisplay.DragonsTeams),
Draw(Draw.class, GameDisplay.Draw),
Evolution(Evolution.class, GameDisplay.Evolution),
//FlappyBird(FlappyBird.class, "Flappy Bird", Material.FEATHER, (byte)0, GameCategory.ARCADE, 17),
Gravity(Gravity.class, GameDisplay.Gravity),
Halloween(Halloween.class, GameDisplay.Halloween, "http://file.mineplex.com/ResHalloween.zip", true),
HideSeek(HideSeek.class, GameDisplay.HideSeek),
@ -92,7 +90,7 @@ public enum GameType
Lobbers(BombLobbers.class, GameDisplay.Lobbers),
Micro(Micro.class, GameDisplay.Micro),
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/file/c/ResMinestrike.zip", true),
MineWare(MineWare.class, GameDisplay.MineWare),
OldMineWare(OldMineWare.class, GameDisplay.OldMineWare),
Paintball(Paintball.class, GameDisplay.Paintball),

View File

@ -195,7 +195,8 @@ public abstract class Game implements Listener
public boolean AutomaticRespawn = true;
public double DeathSpectateSecs = 0;
public boolean DeathTeleport = true;
public boolean QuitOut = true;
public boolean QuitDropItems = false;
@ -209,6 +210,7 @@ public abstract class Game implements Listener
public int WorldWaterDamage = 0;
public boolean WorldBoundaryKill = true;
public boolean WorldBlockBurn = false;
public boolean WorldBlockGrow = false;
public boolean WorldFireSpread = false;
public boolean WorldLeavesDecay = false;
public boolean WorldSoilTrample = false;

View File

@ -1,7 +1,9 @@
package nautilus.game.arcade.game.games.champions;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.inventory.data.Item;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
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.KillReasonStatTracker;
import nautilus.game.arcade.stats.SeismicSlamStatTracker;
import nautilus.game.arcade.stats.SpecialWinStatTracker;
import nautilus.game.arcade.stats.TheLongestShotStatTracker;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -59,6 +64,8 @@ public class ChampionsCTF extends CaptureTheFlag
Manager.GetDamage().UseSimpleWeaponDamage = false;
Manager.getCosmeticManager().setHideParticles(true);
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
this.StrictAntiHack = true;
InventoryOpenChest = true;
@ -76,10 +83,11 @@ public class ChampionsCTF extends CaptureTheFlag
new TheLongestShotStatTracker(this),
new SeismicSlamStatTracker(this),
new CapturesStatTracker(this, "Captures"),
new ClutchStatTracker(this, "Clutch")
new ClutchStatTracker(this, "Clutch"),
new SpecialWinStatTracker(this, "SpecialWin")
);
new ChampsFixer(this);
new ChampionsFixes(this);
}
@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);
}
}
}

View File

@ -59,6 +59,8 @@ public class ChampionsDominate extends Domination
Manager.GetDamage().UseSimpleWeaponDamage = false;
Manager.getCosmeticManager().setHideParticles(true);
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
this.StrictAntiHack = true;
InventoryOpenChest = true;
@ -77,7 +79,7 @@ public class ChampionsDominate extends Domination
new SeismicSlamStatTracker(this)
);
new ChampsFixer(this);
new ChampionsFixes(this);
}
@Override

View File

@ -1,6 +1,9 @@
package nautilus.game.arcade.game.games.champions;
import mineplex.core.common.util.UtilEnt;
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.minecraft.game.classcombat.Skill.Skill;
import nautilus.game.arcade.events.GameStateChangeEvent;
@ -9,6 +12,8 @@ import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.Game.GameState;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
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.InventoryType;
public class ChampsFixer implements Listener
public class ChampionsFixes implements Listener
{
private Game _host;
public ChampsFixer(Game game)
public ChampionsFixes(Game game)
{
_host = game;
Bukkit.getPluginManager().registerEvents(this, _host.getArcadeManager().getPlugin());
@ -34,7 +39,7 @@ public class ChampsFixer implements Listener
if (event.GetGame() != _host)
return;
if (event.GetState() == GameState.Dead)
if (event.GetState() == GameState.End || event.GetState() == GameState.Dead)
HandlerList.unregisterAll(this);
}
@ -51,7 +56,7 @@ public class ChampsFixer implements Listener
return;
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)
@ -67,11 +72,14 @@ public class ChampsFixer implements Listener
}
@EventHandler
public void onUpdate(UpdateEvent event)
public void resetSkillsWhileInInventory(UpdateEvent event)
{
if (!_host.IsLive())
return;
if (event.getType() != UpdateType.FAST)
return;
for (Player player : UtilServer.getPlayers())
{
if (player.getOpenInventory() == null || player.getOpenInventory().getTopInventory() == null)
@ -97,5 +105,4 @@ public class ChampsFixer implements Listener
{
event.setCancelled(true);
}
}

View File

@ -59,6 +59,8 @@ public class ChampionsTDM extends TeamDeathmatch
this.Manager.GetDamage().UseSimpleWeaponDamage = false;
Manager.getCosmeticManager().setHideParticles(true);
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
this.StrictAntiHack = true;
@ -77,7 +79,7 @@ public class ChampionsTDM extends TeamDeathmatch
new SeismicSlamStatTracker(this)
);
new ChampsFixer(this);
new ChampionsFixes(this);
}
@Override

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import mineplex.core.common.Rank;
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, ItemStack> _helmets = new HashMap<Player, ItemStack>();
private boolean _redFlickerStage = false;
private boolean _blueFlickerStage = false;
private boolean _flickerStage = false;
public CaptureTheFlag(ArcadeManager manager, GameType type, Kit[] kits)
{
@ -224,8 +222,8 @@ public class CaptureTheFlag extends TeamGame
for (Resupply resupply : _resupply)
resupply.Update();
getFlag(true).handleBottomInfo(_redFlickerStage, ChatColor.RED);
getFlag(false).handleBottomInfo(_blueFlickerStage, ChatColor.AQUA);
getFlag(true).handleBottomInfo(_flickerStage, ChatColor.RED);
getFlag(false).handleBottomInfo(_flickerStage, ChatColor.AQUA);
}
else if (event.getType() == UpdateType.SEC)
for (Flag flag : _flags)
@ -407,6 +405,28 @@ public class CaptureTheFlag extends TeamGame
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
@EventHandler
public void ScoreboardUpdate(UpdateEvent event)
@ -432,22 +452,21 @@ public class CaptureTheFlag extends TeamGame
String redMessage = "Flag Dropped";
if (getFlag(true).isAtHome())
{
redMessage = "Flag Safe";
_redFlickerStage = false;
}
if (getFlag(true).getCarrier() != null)
redMessage = "Flag Taken";
if (_redFlickerStage)
if (_flickerStage)
{
Scoreboard.Write(C.cRed + redMessage);
_redFlickerStage = false;
if (!getFlag(true).isAtHome())
Scoreboard.Write(C.cRed + redMessage);
else
Scoreboard.Write(redMessage);
}
else
{
Scoreboard.Write(redMessage);
_redFlickerStage = true;
}
//Flag in play stuff
@ -457,23 +476,27 @@ public class CaptureTheFlag extends TeamGame
String blueMessage = "Flag Dropped";
if (getFlag(false).isAtHome())
{
blueMessage = "Flag Safe";
_blueFlickerStage = false;
}
if (getFlag(false).getCarrier() != null)
blueMessage = "Flag Taken";
if (_blueFlickerStage)
if (getFlag(false).getCarrier() != null)
{
Scoreboard.Write(C.cAqua + blueMessage);
_blueFlickerStage = false;
blueMessage = "Flag Taken";
}
if (_flickerStage)
{
if (!getFlag(false).isAtHome())
Scoreboard.Write(C.cAqua + blueMessage);
else
Scoreboard.Write(blueMessage);
}
else
{
Scoreboard.Write(blueMessage);
_blueFlickerStage = true;
}
_flickerStage = !_flickerStage;
//Flag in play stuff
Scoreboard.WriteBlank();

View File

@ -410,10 +410,13 @@ public class Flag
if (!_host.isAtHome(_team.GetColor() == ChatColor.RED ? ChatColor.BLUE : ChatColor.RED))
{
if (Recharge.Instance.use(player, "No Cap Message", 1000, false, false))
UtilTextMiddle.display("", C.cRed + "Your flag must be at home to capture!", player);
return;
if (_host.getArcadeManager().IsTournamentServer())
{
if (Recharge.Instance.use(player, "No Cap Message", 1000, false, false))
UtilTextMiddle.display("", C.cRed + "Your flag must be at home to capture!", player);
return;
}
}
_host.resetInventory(player);

View File

@ -129,7 +129,7 @@ public class PerkFlamingSwordEVO extends Perk
{
//Fire
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());
double x = 0.07 - (UtilMath.r(14)/100d);

View File

@ -116,6 +116,10 @@ import net.minecraft.server.v1_8_R3.EntityArrow;
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
{
private static final HandlerList handlers = new HandlerList();
@ -211,6 +215,7 @@ public class MineStrike extends TeamGame
private Bomb _bomb = null;
private Item _bombItem = null;
private Player _bombHolder = null;
private long _bombHolderLastMove = 0;
private Player _bombPlanter;
private Player _bombDefuser;
@ -261,6 +266,8 @@ public class MineStrike extends TeamGame
this.ItemDrop = true;
this.DeathTeleport = false;
this.InventoryClick = true;
this.JoinInProgress = true;
@ -280,7 +287,7 @@ public class MineStrike extends TeamGame
"Sprinting heavily decreases accuracy",
"Jumping massively decreases accuracy",
"Crouching increases accuracy",
"Left-Click to roll Grenades",
"Left-Click to drop Grenades",
"Right-Click to throw Grenades",
"Burst Fire for greater accuracy",
"Sniper Rifles are only accurate while scoped",
@ -369,7 +376,7 @@ public class MineStrike extends TeamGame
gun.giveToPlayer(event.getPlayer(), true);
//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
giveTeamArmor(event.getPlayer(), Color.fromRGB(0, 0, 255));
@ -385,6 +392,8 @@ public class MineStrike extends TeamGame
{
//Dont Get Hit By Bullets
((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)
@ -530,6 +539,7 @@ public class MineStrike extends TeamGame
player.playSound(player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
_bombHolder = player;
_bombHolderLastMove = System.currentTimeMillis();
if (_bombItem != null)
{
@ -717,6 +727,12 @@ public class MineStrike extends TeamGame
if (grenade == null)
return;
if (!UtilTime.elapsed(GetStateTime(), 15000))
{
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot throw Grenades yet."));
return;
}
grenade.throwGrenade(event.getPlayer(), UtilEvent.isAction(event, ActionType.L), this);
event.setCancelled(true);
@ -1601,7 +1617,7 @@ public class MineStrike extends TeamGame
_bombPlanter.setExp(Math.min(_bombPlanter.getExp() + 0.017f, 0.99999f));
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);
@ -2758,6 +2774,48 @@ public class MineStrike extends TeamGame
_shopManager.addMoney(event.getPlayer(), 16000, "Debug");
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"))
{
@ -2882,4 +2940,107 @@ 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;
}
}

View File

@ -87,7 +87,7 @@ public abstract class Grenade extends StrikeItem
int alreadyHas = 0;
int bestSlot = -1;
for (int i = 3 ; i < 7 ; i++)
for (int i = 5 ; i >= 3 ; i--)
{
if (UtilInv.IsItem(player.getInventory().getItem(i), getSkin(), (byte) -1))
alreadyHas++;

View File

@ -51,7 +51,7 @@ public class HighExplosive extends Grenade
continue;
// 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),
true, true, false, _thrower.getName(), getName());

View File

@ -118,7 +118,9 @@ public class Gun extends StrikeItem
}
if (!Recharge.Instance.use(player, getName() + " Shoot", _gunStats.getFireRate(), false, false))
{
return;
}
//Use Ammo
_loadedAmmo--;
@ -164,6 +166,7 @@ public class Gun extends StrikeItem
Vector cof = new Vector(Math.random() - 0.5, (Math.random() - 0.2) * (5d/8d), Math.random() - 0.5);
cof.normalize();
cof.multiply(cone);
cof.multiply(MineStrike.CONE);
cof.add(player.getLocation().getDirection());
cof.normalize();

View File

@ -1,5 +1,6 @@
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 org.bukkit.Material;
@ -241,7 +242,6 @@ public enum GunStats
private double _coneMin;
private double _coneMax;
private double _coneReduceRate;
private double _coneIncreaseRate;
private boolean _scope = false;
@ -375,7 +375,7 @@ public enum GunStats
public double getConeIncreaseRate()
{
return _coneIncreaseRate;
return _coneIncreaseRate * MineStrike.RECOIL;
}
public boolean getScope()

View File

@ -1,5 +1,7 @@
package nautilus.game.arcade.game.games.minestrike.items.guns;
import nautilus.game.arcade.game.games.minestrike.MineStrike;
public enum GunType
{
PISTOL("Pistol", 0.01, 0.02, 0.02, 3f, 0.1),
@ -38,17 +40,17 @@ public enum GunType
public double getMovePenalty()
{
return _movePenalty;
return _movePenalty * MineStrike.MOVE_PENALTY;
}
public double getSprintPenalty()
{
return _sprintPentalty;
return _sprintPentalty * MineStrike.MOVE_PENALTY;
}
public double getJumpPenalty()
{
return _jumpPenalty;
return _jumpPenalty * MineStrike.MOVE_PENALTY;
}
public float getVolume()

View File

@ -111,7 +111,7 @@ public class PerkFlamingSword extends Perk
//Fire
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER));
Manager.GetFire().Add(fire, cur, 0.7, 0, 0.5, 1, "Inferno");
Manager.GetFire().Add(fire, cur, 0.7, 0, 0.5, 1, "Inferno", false);
fire.teleport(cur.getEyeLocation());
double x = 0.07 - (UtilMath.r(14)/100d);

View File

@ -106,7 +106,7 @@ public class PerkInferno extends SmashPerk
//Fire
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER));
Manager.GetFire().Add(fire, cur, 0.7, 0, 0.5, 1.25, "Inferno");
Manager.GetFire().Add(fire, cur, 0.7, 0, 0.5, 1.25, "Inferno", false);
fire.teleport(cur.getEyeLocation());
double x = 0.07 - (UtilMath.r(14)/100d);

View File

@ -86,7 +86,7 @@ public class PerkInfernoFinn extends Perk
//Fire
Item fire = cur.getWorld().dropItem(cur.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.BLAZE_POWDER));
Manager.GetFire().Add(fire, cur, 0.7, 0, 2, 2, "Inferno");
Manager.GetFire().Add(fire, cur, 0.7, 0, 2, 2, "Inferno", false);
fire.teleport(cur.getEyeLocation());
double x = 0.07 - (UtilMath.r(14)/100d);

View File

@ -47,6 +47,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.LeavesDecayEvent;
@ -675,7 +676,7 @@ public class GameFlagManager implements Listener
final Player player = event.getEntity();
//Visual
Manager.GetCondition().Factory().Blind("Ghost", player, player, 2, 0, false, false, false);
Manager.GetCondition().Factory().Blind("Ghost", player, player, 2.5, 0, false, false, false);
player.setFireTicks(0);
player.setFallDistance(0);
@ -709,7 +710,7 @@ public class GameFlagManager implements Listener
}
else
{
Manager.addSpectator(player, true);
Manager.addSpectator(player, game.DeathTeleport);
}
Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
@ -730,7 +731,6 @@ public class GameFlagManager implements Listener
time = game.GetTeam(player).GetRespawnTime();
UtilInv.Clear(player);
Manager.GetCondition().Factory().Blind("Ghost", player, player, 1.5, 0, false, false, false);
Manager.GetCondition().Factory().Cloak("Ghost", player, player, time, false, false);
player.setAllowFlight(true);
player.setFlying(true);
@ -745,7 +745,7 @@ public class GameFlagManager implements Listener
if (!game.IsAlive(player))
{
Manager.addSpectator(player, true);
Manager.addSpectator(player, game.DeathTeleport);
return;
}
@ -766,7 +766,7 @@ public class GameFlagManager implements Listener
}
else
{
Manager.addSpectator(player, true);
Manager.addSpectator(player, game.DeathTeleport);
}
player.setFireTicks(0);
@ -1096,6 +1096,18 @@ public class GameFlagManager implements Listener
event.setCancelled(true);
}
@EventHandler
public void WorldBlockBurn(BlockGrowEvent event)
{
Game game = Manager.GetGame();
if (game == null) return;
if (game.WorldBlockGrow)
return;
event.setCancelled(true);
}
@EventHandler
public void WorldFireSpread(BlockIgniteEvent event)
{

View File

@ -0,0 +1,46 @@
package nautilus.game.arcade.stats;
import java.util.List;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.common.CaptureTheFlag;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
public class SpecialWinStatTracker extends StatTracker<CaptureTheFlag>
{
private final String _stat;
public SpecialWinStatTracker(CaptureTheFlag game, String stat)
{
super(game);
_stat = stat;
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onGameStateChange(GameStateChangeEvent event)
{
if (event.GetState() == Game.GameState.End)
{
if (getGame().getScoreDifference() < 5)
return;
List<Player> winners = getGame().getWinners();
if (winners != null)
{
for (Player winner : winners)
addStat(winner, _stat, 1, false, false);
}
}
}
public String getStat()
{
return _stat;
}
}