Merge branch 'develop' into thanos-mineware

This commit is contained in:
Thanos Paravantis 2016-07-13 13:28:03 +03:00
commit 179b59af2c
113 changed files with 4645 additions and 2407 deletions

View File

@ -1 +0,0 @@
{}

View File

@ -1,5 +1,6 @@
package mineplex.bungee.motd; package mineplex.bungee.motd;
import java.awt.Color;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -7,12 +8,13 @@ import java.util.Random;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import mineplex.serverdata.Region; import mineplex.serverdata.Region;
import mineplex.serverdata.data.BungeeServer;
import mineplex.serverdata.data.DataRepository; import mineplex.serverdata.data.DataRepository;
import mineplex.serverdata.redis.RedisDataRepository; import mineplex.serverdata.redis.RedisDataRepository;
import mineplex.serverdata.servers.ConnectionData; import mineplex.serverdata.servers.ConnectionData;
import mineplex.serverdata.servers.ConnectionData.ConnectionType;
import mineplex.serverdata.servers.ServerManager; import mineplex.serverdata.servers.ServerManager;
import net.md_5.bungee.api.ServerPing; import mineplex.serverdata.servers.ConnectionData.ConnectionType;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.event.ProxyPingEvent; import net.md_5.bungee.api.event.ProxyPingEvent;
import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.api.plugin.Plugin;
@ -67,7 +69,7 @@ public class MotdManager implements Listener, Runnable
@EventHandler @EventHandler
public void serverPing(ProxyPingEvent event) public void serverPing(ProxyPingEvent event)
{ {
ServerPing serverPing = event.getResponse(); net.md_5.bungee.api.ServerPing serverPing = event.getResponse();
String motd = _firstLine; String motd = _firstLine;
if (_motdLines != null && _motdLines.size() > 0) if (_motdLines != null && _motdLines.size() > 0)

View File

@ -1617,4 +1617,35 @@ public class UtilBlock
} }
} }
public static boolean water(Material type)
{
return type == Material.WATER || type == Material.STATIONARY_WATER;
}
public static boolean lava(Material type)
{
return type == Material.LAVA || type == Material.STATIONARY_LAVA;
}
public static boolean liquid(Material type)
{
return water(type) || lava(type);
}
public static boolean water(Block block)
{
return water(block.getType());
}
public static boolean lava(Block block)
{
return lava(block.getType());
}
public static boolean liquid(Block block)
{
return liquid(block.getType());
}
} }

View File

@ -22,9 +22,9 @@ public class TestRank 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(Rank.JNR_DEV)) if (!Plugin.Get(caller).GetRank(true).has(Rank.SNR_MODERATOR))
{ {
UtilPlayer.message(caller, F.main("Permissions", "This requires Permission Rank [" + Rank.JNR_DEV.getTag(false, true) + C.cGray + "].")); UtilPlayer.message(caller, F.main("Permissions", "This requires Permission Rank [" + Rank.SNR_MODERATOR.getTag(false, true) + C.cGray + "]."));
return; return;
} }
@ -65,6 +65,14 @@ public class TestRank extends CommandBase<CoreClientManager>
UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Invalid rank!")); UtilPlayer.message(caller, F.main(Plugin.getName(), ChatColor.RED + "" + ChatColor.BOLD + "Invalid rank!"));
return; return;
} }
if (Plugin.Get(caller).GetRank(true) == Rank.SNR_MODERATOR)
{
if (tempRank.has(Rank.TWITCH))
{
UtilPlayer.message(caller, F.main("Command", "You can only test Player ranks!"));
return;
}
}
Plugin.Get(caller).SetRank(tempRank, true); Plugin.Get(caller).SetRank(tempRank, true);
UtilPlayer.message(caller, F.main(Plugin.getName(), "Your rank has been set to " + tempRank.getTag(false, false) + C.cGray + "!")); UtilPlayer.message(caller, F.main(Plugin.getName(), "Your rank has been set to " + tempRank.getTag(false, false) + C.cGray + "!"));

View File

@ -71,7 +71,7 @@ public class YoutubeButton implements GuiItem
message = "Click here to visit our YouTube page!"; message = "Click here to visit our YouTube page!";
} }
new JsonMessage(C.cAquaB + message).click(ClickEvent.OPEN_URL, "https://www.youtube.com/embed/RW3sOmkiEG-A?list=UU1MtBclG_aHPd0nLmUupCKg&controls=0&showinfo=0").sendToPlayer(_player); new JsonMessage(C.cAquaB + message).click(ClickEvent.OPEN_URL, "http://youtube.com/mineplexgamesofficial?sub_confirmation=1").sendToPlayer(_player);
} }
@Override @Override

View File

@ -9,8 +9,6 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import com.google.common.cache.CacheBuilder;
import mineplex.core.MiniPlugin; import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;

View File

@ -13,10 +13,9 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.globalpacket.command.GlobalPacketCommand; import mineplex.core.globalpacket.command.GlobalPacketCommand;
// import mineplex.core.globalpacket.listeners.GlobalGiveCoins; import mineplex.core.globalpacket.listeners.GlobalGiveCoins;
// import mineplex.core.globalpacket.listeners.GlobalGiveGems; import mineplex.core.globalpacket.listeners.GlobalGiveGems;
// import mineplex.core.globalpacket.listeners.GlobalGiveItem; import mineplex.core.globalpacket.listeners.GlobalGiveItem;
// import mineplex.core.globalpacket.listeners.GlobalRawr;
import mineplex.core.globalpacket.redis.GlobalPacketHandler; import mineplex.core.globalpacket.redis.GlobalPacketHandler;
import mineplex.core.globalpacket.redis.GlobalPacketMessage; import mineplex.core.globalpacket.redis.GlobalPacketMessage;
import mineplex.core.inventory.InventoryManager; import mineplex.core.inventory.InventoryManager;
@ -46,10 +45,9 @@ public class GlobalPacketManager extends MiniPlugin
ServerCommandManager.getInstance().registerCommandType("GlobalPacketMessage", GlobalPacketMessage.class, new GlobalPacketHandler(statusManager)); ServerCommandManager.getInstance().registerCommandType("GlobalPacketMessage", GlobalPacketMessage.class, new GlobalPacketHandler(statusManager));
// getPluginManager().registerEvents(new GlobalGiveItem(inventoryManager, _rewardManager), getPlugin()); getPluginManager().registerEvents(new GlobalGiveItem(inventoryManager, _rewardManager), getPlugin());
// getPluginManager().registerEvents(new GlobalGiveGems(donationManager), getPlugin()); getPluginManager().registerEvents(new GlobalGiveGems(donationManager), getPlugin());
// getPluginManager().registerEvents(new GlobalGiveCoins(donationManager, clientManager), getPlugin()); getPluginManager().registerEvents(new GlobalGiveCoins(donationManager, clientManager), getPlugin());
// getPluginManager().registerEvents(new GlobalRawr(), getPlugin());
} }
public void callGlobalCommand(Player caller, String[] args) public void callGlobalCommand(Player caller, String[] args)

View File

@ -1,50 +0,0 @@
package mineplex.core.globalpacket.listeners;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.globalpacket.event.GlobalPacketEvent;
/**
* Created by William (WilliamTiger).
* 18/11/15
*/
public class GlobalRawr implements Listener
{
@EventHandler
public void globalRawr(GlobalPacketEvent e)
{
if (e.getParts() == null || e.getParts().length < 1)
return;
if (!e.getParts()[0].equalsIgnoreCase("rawr"))
return;
if (e.getParts().length < 2)
{
if (e.getCaller() != null)
UtilPlayer.message(e.getCaller(), F.main("Global", "/global rawr <msg>"));
return;
}
String msg = "";
for (int i = 1; i < e.getParts().length; i++)
{
msg += e.getParts()[i] + " ";
}
msg = msg.trim();
for (Player p : UtilServer.getPlayers())
{
UtilTextMiddle.display("§6§lRAWR!", "§e" + msg, p);
}
}
}

View File

@ -159,7 +159,7 @@ public class PersonalServerManager extends MiniPlugin
} }
} }
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers, final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, null, true, "arcade.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
true, false, false, games, "", "", "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", ""); true, false, false, games, "", "", "Player", true, event, false, true, false, true, true, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()

View File

@ -88,6 +88,15 @@ public class ProjectileManager extends MiniPlugin
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult)); sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, double charge)
{
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, charge));
}
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult) Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult)
@ -133,14 +142,14 @@ public class ProjectileManager extends MiniPlugin
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, List<Player> canHit) Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult, List<Player> canHit)
{ {
_thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback,
expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false, expireTime, hitPlayer, hitNonPlayerEntity, hitBlock, idle, false,
sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, canHit)); sound, soundVolume, soundPitch, null, 0, effectRate, particle, 0F, 0F, 0F, 0F, 1, hitboxMult, canHit));
} }
public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle,
Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult, List<Player> canHit) Sound sound, float soundVolume, float soundPitch, ParticleType particle, float pX, float pY, float pZ, float pS, int pC, UpdateType effectRate, float hitboxMult, List<Player> canHit)

View File

@ -62,6 +62,8 @@ public class ProjectileUser
private UpdateType _effectRate = UpdateType.TICK; private UpdateType _effectRate = UpdateType.TICK;
private double _hitboxGrow; private double _hitboxGrow;
private double _charge;
private List<Player> _canHit; private List<Player> _canHit;
@ -104,6 +106,47 @@ public class ProjectileUser
_canHit = null; _canHit = null;
} }
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup,
Sound sound, float soundVolume, float soundPitch,
Effect effect, int effectData, UpdateType effectRate,
ParticleType particle, float particleX, float particleY,
float particleZ, float particleS, int particleC, double hitboxMult, double charge)
{
Throw = throwInput;
_thrown = thrown;
_thrower = thrower;
_callback = callback;
_expireTime = expireTime;
_startTime = System.currentTimeMillis();
_hitPlayer = hitPlayer;
_hitNonPlayerEntity = hitNonPlayerEntity;
_hitBlock = hitBlock;
_idle = idle;
_pickup = pickup;
_sound = sound;
_soundVolume = soundVolume;
_soundPitch = soundPitch;
_particle = particle;
_particleX = particleX;
_particleY = particleY;
_particleZ = particleZ;
_particleS = particleS;
_particleC = particleC;
_effect = effect;
_effectData = effectData;
_effectRate = effectRate;
_hitboxGrow = hitboxMult;
_canHit = null;
_charge = charge;
}
public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback, public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback,
long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup, long expireTime, boolean hitPlayer, boolean hitNonPlayerEntity, boolean hitBlock, boolean idle, boolean pickup,
Sound sound, float soundVolume, float soundPitch, Sound sound, float soundVolume, float soundPitch,
@ -142,6 +185,7 @@ public class ProjectileUser
_hitboxGrow = hitboxMult; _hitboxGrow = hitboxMult;
_canHit = canHit; _canHit = canHit;
} }
public void effect(UpdateEvent event) public void effect(UpdateEvent event)
{ {
@ -311,6 +355,11 @@ public class ProjectileUser
return false; return false;
} }
public double getCharge()
{
return _charge;
}
public IThrown getIThrown() public IThrown getIThrown()
{ {

View File

@ -887,7 +887,6 @@ public class HubManager extends MiniClientPlugin<HubClient>
// return _halloweenManager; // return _halloweenManager;
// } // }
// >>>>>>> 1c1184d58ea4230a6b4a57eaef685192207f3c77
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void gadgetCollide(GadgetCollideEntityEvent event) public void gadgetCollide(GadgetCollideEntityEvent event)
{ {

View File

@ -39,7 +39,6 @@ public class JumpManager extends MiniPlugin
Manager = manager; Manager = manager;
} }
@SuppressWarnings("deprecation")
@EventHandler @EventHandler
public void FlightHop(PlayerToggleFlightEvent event) public void FlightHop(PlayerToggleFlightEvent event)
{ {

View File

@ -1,3 +1,4 @@
package mineplex.hub.server.ui; package mineplex.hub.server.ui;
import java.util.ArrayList; import java.util.ArrayList;
@ -33,7 +34,7 @@ import mineplex.serverdata.data.ServerGroup;
public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop> public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
{ {
private ServerGroup _serverGroup; private ServerGroup _serverGroup;
public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager,
DonationManager donationManager, Player player, ServerGroup serverGroup) DonationManager donationManager, Player player, ServerGroup serverGroup)
@ -42,37 +43,11 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
_serverGroup = serverGroup; _serverGroup = serverGroup;
_serverGroup = serverGroup; buildPage();
}
buildPage(); @Override
} protected void buildPage()
@Override
protected void buildPage()
{
String friendlyName = _serverGroup.getServerNpcName();
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte) 3, 1, ChatColor.RESET + C.cYellow + "Solo "
+ friendlyName, new String[]
{ ChatColor.RESET + "", ChatColor.RESET + C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "Teaming in Solo Mode is bannable!",
ChatColor.RESET + "", ChatColor.RESET + C.cGreen + "Click to Play", }));
setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte) 3, 2, ChatColor.RESET + C.cYellow + "Team "
+ friendlyName, new String[]
{ ChatColor.RESET + "", ChatColor.RESET + C.cGray + "2 Player Teams", ChatColor.RESET + "", ChatColor.RESET + C.cGreen + "Click to Play" }));
getButtonMap().put(12, new SelectTypeButton(this, false));
getButtonMap().put(14, new SelectTypeButton(this, true));
}
public void Update()
{
getButtonMap().clear();
buildPage();
}
public void selectServer(Player player, boolean team)
{
if(team)
{ {
String friendlyName = _serverGroup.getServerNpcName(); String friendlyName = _serverGroup.getServerNpcName();
@ -97,12 +72,24 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
getButtonMap().put(12, new SelectTypeButton(this, false)); getButtonMap().put(12, new SelectTypeButton(this, false));
getButtonMap().put(14, new SelectTypeButton(this, true)); getButtonMap().put(14, new SelectTypeButton(this, true));
} }
else
public void Update()
{ {
getShop().openPageForPlayer( getButtonMap().clear();
player, buildPage();
new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Solo", }
player, _serverGroup.getPrefix()));
public void selectServer(Player player, boolean team)
{
if (team)
{
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey()));
}
else
{
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix()));
}
} }
}
} }

View File

@ -33,7 +33,7 @@ public class Blink extends SkillActive
{ {
private HashMap<Player, Location> _loc = new HashMap<Player, Location>(); private HashMap<Player, Location> _loc = new HashMap<Player, Location>();
private HashMap<Player, Long> _blinkTime = new HashMap<Player, Long>(); private HashMap<Player, Long> _blinkTime = new HashMap<Player, Long>();
public Blink(SkillFactory skills, String name, ClassType classType, SkillType skillType, public Blink(SkillFactory skills, String name, ClassType classType, SkillType skillType,
int cost, int levels, int cost, int levels,
int energy, int energyMod, int energy, int energyMod,
@ -206,6 +206,9 @@ public class Blink extends SkillActive
done = true; done = true;
} }
target.setYaw(player.getLocation().getYaw());
target.setPitch(player.getLocation().getPitch());
player.teleport(target); player.teleport(target);
player.setFallDistance(0); player.setFallDistance(0);

View File

@ -29,6 +29,7 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime; 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.recharge.Recharge;
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;
@ -213,10 +214,11 @@ public class Evade extends SkillActive
{ {
Player player = activeIter.next(); Player player = activeIter.next();
if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 750)) if (!player.isOnline() || !player.isBlocking() || UtilTime.elapsed(_active.get(player), 1000))
{ {
activeIter.remove(); activeIter.remove();
UtilPlayer.message(player, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + ".")); UtilPlayer.message(player, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + "."));
Recharge.Instance.useForce(player, GetName(), 10000l, true);
} }
} }
} }

View File

@ -14,6 +14,7 @@ import org.bukkit.event.player.PlayerDropItemEvent;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
@ -28,7 +29,6 @@ import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent; import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
import net.minecraft.server.v1_8_R3.Material;
public class Recall extends Skill public class Recall extends Skill
{ {
@ -69,6 +69,12 @@ public class Recall extends Skill
event.setCancelled(true); event.setCancelled(true);
if (UtilBlock.water(player.getLocation().getBlock()))
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
return;
}
//Check Allowed //Check Allowed
SkillTriggerEvent trigger = new SkillTriggerEvent(player, GetName(), GetClassType()); SkillTriggerEvent trigger = new SkillTriggerEvent(player, GetName(), GetClassType());
Bukkit.getServer().getPluginManager().callEvent(trigger); Bukkit.getServer().getPluginManager().callEvent(trigger);

View File

@ -6,12 +6,14 @@ 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.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilGear;
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.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class ViperStrikes extends Skill public class ViperStrikes extends Skill
{ {
@ -21,8 +23,8 @@ public class ViperStrikes extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"Your attacks give enemies", "Your attacks give",
"Shock, Slow 1 and Poison 1", "enemies Poison 1",
"for #0#1 seconds." "for #0#1 seconds."
}); });
} }
@ -47,10 +49,9 @@ public class ViperStrikes extends Skill
LivingEntity damagee = event.GetDamageeEntity(); LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null) return; if (damagee == null) return;
//Confuse Factory.Damage().NewDamageEvent(damagee, damager, null, DamageCause.POISON, 0, false, true, true, damager.getName(), GetName());
Factory.Condition().Factory().PoisonShock(GetName(), damagee, damager, level, false); damagee.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 20 * (2 + level), 0));
Factory.Condition().Factory().Slow(GetName(), damagee, damager, level, 0, false, false, true, false);
//Sound //Sound
damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f); damager.getWorld().playSound(damager.getLocation(), Sound.SPIDER_IDLE, 1f, 2f);

View File

@ -9,32 +9,34 @@ import org.bukkit.Effect;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock; import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
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.entity.EntityChangeBlockEvent; import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilGear;
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.UtilServer;
import mineplex.core.projectile.IThrown;
import mineplex.core.projectile.ProjectileUser;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.SkillCharge; import mineplex.minecraft.game.classcombat.Skill.SkillCharge;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent; import mineplex.minecraft.game.classcombat.Skill.event.BlockTossExpireEvent;
@ -90,7 +92,7 @@ public class BlockToss extends SkillCharge implements IThrown
@Override @Override
public String GetRechargeString() public String GetRechargeString()
{ {
return "Recharge: " + "#4#-0.5 Seconds"; return "Recharge: " + "#5.5#-0.5 Seconds";
} }
@EventHandler @EventHandler
@ -193,7 +195,22 @@ public class BlockToss extends SkillCharge implements IThrown
//Effect //Effect
player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, block.getMaterial().getId()); player.getWorld().playEffect(event.getClickedBlock().getLocation(), Effect.STEP_SOUND, block.getMaterial().getId());
} }
@EventHandler
public void Damage(EntityDamageByEntityEvent event)
{
Entity vehicle = event.getEntity().getVehicle();
if (_holding.containsKey(vehicle))
{
Player attacker = (Player) event.getDamager();
//Forward Damage
Factory.Damage().NewDamageEvent((Player) vehicle, attacker, Factory.Damage().GetProjectile(event),
event.getCause(), event.getDamage(), true, false, false, null, null, event.isCancelled());
}
}
@EventHandler @EventHandler
public void Throw(UpdateEvent event) public void Throw(UpdateEvent event)
{ {
@ -224,7 +241,7 @@ public class BlockToss extends SkillCharge implements IThrown
} }
//Throw //Throw
if (!cur.isBlocking()) if (!cur.isBlocking() || (_charge.containsKey(cur) && _charge.get(cur) >= 1))
throwSet.add(cur); throwSet.add(cur);
//Charged Tick //Charged Tick
@ -241,7 +258,7 @@ public class BlockToss extends SkillCharge implements IThrown
for (Player cur : throwSet) for (Player cur : throwSet)
{ {
Recharge.Instance.recharge(cur, GetName()); Recharge.Instance.recharge(cur, GetName());
Recharge.Instance.use(cur, GetName(), 4000 - (500 * getLevel(cur)), false, true); Recharge.Instance.use(cur, GetName(), 5500 - (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);

View File

@ -24,7 +24,7 @@ public class CripplingBlow extends Skill
{ {
"Your powerful axe attacks give", "Your powerful axe attacks give",
"targets Slow 2 for 1.5 second,", "targets Slow 2 for 1.5 second,",
"as well as 50% less knockback." "as well as 25% less knockback."
}); });
} }
@ -57,7 +57,7 @@ public class CripplingBlow extends Skill
//Damage //Damage
event.AddMod(damager.getName(), GetName(), 0, true); event.AddMod(damager.getName(), GetName(), 0, true);
event.AddKnockback(GetName(), 0.5); event.AddKnockback(GetName(), 0.75);
//Event //Event
UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(damager, GetName(), ClassType.Brute, damagee)); UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(damager, GetName(), ClassType.Brute, damagee));

View File

@ -73,7 +73,7 @@ public class DwarfToss extends SkillActive
{ {
if (_used.contains(player)) if (_used.contains(player))
return false; return false;
return true; return true;
} }
@ -96,7 +96,13 @@ public class DwarfToss extends SkillActive
{ {
int level = getLevel(player); int level = getLevel(player);
if (level == 0) return false; if (level == 0) return false;
if (player.getLocation().getBlock().getTypeId() == 8 || player.getLocation().getBlock().getTypeId() == 9)
{
UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water."));
return false;
}
//Check Material //Check Material
if (player.getItemInHand() != null) if (player.getItemInHand() != null)
if (!_itemSet.contains(player.getItemInHand().getType())) if (!_itemSet.contains(player.getItemInHand().getType()))
@ -337,6 +343,9 @@ public class DwarfToss extends SkillActive
target.leaveVehicle(); target.leaveVehicle();
final double mult = (1.8) * timeScale; final double mult = (1.8) * timeScale;
//Protection
Factory.Condition().Factory().Invulnerable(GetName(), target, target, 1.25, false, false);
//Delay //Delay
Bukkit.getScheduler().scheduleSyncDelayedTask(Factory.getPlugin(), new Runnable() Bukkit.getScheduler().scheduleSyncDelayedTask(Factory.getPlugin(), new Runnable()
{ {

View File

@ -101,16 +101,16 @@ public class FleshHook extends SkillActiveCharge implements IThrown
//Release Charge //Release Charge
else if (_charge.containsKey(cur)) else if (_charge.containsKey(cur))
{ {
float charge = _charge.remove(cur); double charge = _charge.remove(cur);
//Action //Action
Item item = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(131)); Item item = cur.getWorld().dropItem(cur.getEyeLocation().add(cur.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(131));
UtilAction.velocity(item, cur.getLocation().getDirection(), UtilAction.velocity(item, cur.getLocation().getDirection(),
1 + charge , false, 0, 0.2, 20, false); 1 + charge, false, 0, 0.2, 20, false);
Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true, true, Factory.Projectile().AddThrow(item, cur, this, -1, true, true, true, true,
Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f); Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, UpdateType.TICK, 0.6f, charge);
//Inform //Inform
UtilPlayer.message(cur, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); UtilPlayer.message(cur, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + "."));
@ -148,14 +148,14 @@ public class FleshHook extends SkillActiveCharge implements IThrown
//Pull //Pull
UtilAction.velocity(target, UtilAction.velocity(target,
UtilAlg.getTrajectory(target.getLocation(), player.getLocation()), UtilAlg.getTrajectory(target.getLocation(), player.getLocation()),
1.2 + (0.3 * level), false, 0, 0.7, 1.2, true); velocity, false, 0, 0.7, 1.2, true);
//Condition //Condition
Factory.Condition().Factory().Falling(GetName(), target, player, 10, false, true); Factory.Condition().Factory().Falling(GetName(), target, player, 10, false, true);
//Damage Event //Damage Event
Factory.Damage().NewDamageEvent(target, player, null, Factory.Damage().NewDamageEvent(target, player, null,
DamageCause.CUSTOM, 5 + level, false, true, false, DamageCause.CUSTOM, (5 + level) * data.getCharge(), false, true, false,
player.getName(), GetName()); player.getName(), GetName());

View File

@ -21,7 +21,7 @@ public class Intimidation extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"You intimidate nearby enemies;", "You intimidate nearby enemies;",
"Enemies within #3#3 blocks receive Slow 1.", "Enemies within #4#2 blocks receive Slow 1.",
}); });
} }
@ -36,7 +36,7 @@ public class Intimidation extends Skill
int level = getLevel(cur); int level = getLevel(cur);
if (level == 0) continue; if (level == 0) continue;
HashMap<Player, Double> targets = UtilPlayer.getInRadius(cur.getLocation(), 3 + (level * 3)); HashMap<Player, Double> targets = UtilPlayer.getInRadius(cur.getLocation(), 3 + (level * 2));
for (Player other : targets.keySet()) for (Player other : targets.keySet())
if (!other.equals(cur)) if (!other.equals(cur))
if (Factory.Relation().canHurt(cur, other)) if (Factory.Relation().canHurt(cur, other))

View File

@ -52,7 +52,7 @@ public class AxeThrow extends SkillActive implements IThrown
SetDesc(new String[] SetDesc(new String[]
{ {
"Throw your axe with #0.7#0.1 velocity, ", "Throw your axe with #0.7#0.1 velocity, ",
"dealing #5.5#0.5 damage.", "dealing #4.5#0.5 damage.",
"", "",
"You pull your axe back to you when it", "You pull your axe back to you when it",
"collides with anything.", "collides with anything.",
@ -107,7 +107,7 @@ public class AxeThrow extends SkillActive implements IThrown
if (level <= 0) if (level <= 0)
return; return;
double damage = 5.5 + 0.5 * level; double damage = 4.5 + 0.5 * level;
//Damage Event //Damage Event
Factory.Damage().NewDamageEvent(target, data.getThrower(), null, Factory.Damage().NewDamageEvent(target, data.getThrower(), null,

View File

@ -46,7 +46,7 @@ public class HiltSmash extends SkillActive
SetDesc(new String[] SetDesc(new String[]
{ {
"Smash the hilt of your sword into", "Smash the hilt of your sword into",
"your opponent, dealing #2#1 damage", "your opponent, dealing #1#1 damage",
"and Slow 3 for #0.5#0.5 seconds." "and Slow 3 for #0.5#0.5 seconds."
}); });
} }
@ -153,7 +153,7 @@ public class HiltSmash extends SkillActive
//Damage Event //Damage Event
Factory.Damage().NewDamageEvent((LivingEntity)ent, player, null, Factory.Damage().NewDamageEvent((LivingEntity)ent, player, null,
DamageCause.CUSTOM, 2 + level, false, true, false, DamageCause.CUSTOM, 1 + level, false, true, false,
player.getName(), GetName()); player.getName(), GetName());
//Sound //Sound

View File

@ -30,7 +30,7 @@ public class Swordsmanship extends Skill
{ {
"Prepare a powerful sword attack;", "Prepare a powerful sword attack;",
"You gain 1 Charge every #5#-1 seconds.", "You gain 1 Charge every #5#-1 seconds.",
"You can store a maximum of #0#1 Charges.", "You can store a maximum of #1#1 Charges.",
"", "",
"When you next attack, your damage is", "When you next attack, your damage is",
"increased by the number of your Charges,", "increased by the number of your Charges,",
@ -79,7 +79,7 @@ public class Swordsmanship extends Skill
if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false)) if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false))
continue; continue;
int max = level; int max = 1 + level;
int charge = 1; int charge = 1;
if (_charges.containsKey(cur)) if (_charges.containsKey(cur))

View File

@ -67,7 +67,7 @@ public class Blizzard extends SkillActive
@Override @Override
public String GetEnergyString() public String GetEnergyString()
{ {
return "Energy: #34#-2 per Second"; return "Energy: #42#-2 per Second";
} }
@Override @Override
@ -114,7 +114,7 @@ public class Blizzard extends SkillActive
} }
//Energy //Energy
if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, true)) if (!Factory.Energy().Use(cur, GetName(), 2.1 - (0.1 * level), true, true))
{ {
_active.remove(cur); _active.remove(cur);
continue; continue;

View File

@ -48,7 +48,7 @@ public class IcePrison extends SkillActive implements IThrown
{ {
"Launch an icy orb. When it collides,", "Launch an icy orb. When it collides,",
"it creates a hollow sphere of ice", "it creates a hollow sphere of ice",
"thats lasts for #3#1.5 seconds.", "thats lasts for #3#1 seconds.",
}); });
} }
@ -171,7 +171,7 @@ public class IcePrison extends SkillActive implements IThrown
if (!UtilBlock.airFoliage(freeze)) if (!UtilBlock.airFoliage(freeze))
return; return;
long time = 3500 + (1500 * level); long time = 3500 + (1000 * level);
int yDiff = freeze.getY() - mid.getY(); int yDiff = freeze.getY() - mid.getY();

View File

@ -152,6 +152,12 @@ public class Immolate extends Skill
Remove(cur); Remove(cur);
continue; continue;
} }
if (cur.getLocation().getBlock().getType() == Material.WATER || cur.getLocation().getBlock().getType() == Material.STATIONARY_WATER)
{
Remove(cur);
continue;
}
//Energy //Energy
if (!Factory.Energy().Use(cur, GetName(), 0.65 - (level * 0.05), true, true)) if (!Factory.Energy().Use(cur, GetName(), 0.65 - (level * 0.05), true, true))

View File

@ -53,7 +53,7 @@ public class Inferno extends SkillActive
@Override @Override
public String GetEnergyString() public String GetEnergyString()
{ {
return "Energy: #34#-2 per Second"; return "Energy: #42#-2 per Second";
} }
@Override @Override
@ -100,7 +100,7 @@ public class Inferno extends SkillActive
} }
//Energy //Energy
if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, false)) if (!Factory.Energy().Use(cur, GetName(), 2.1 - (0.1 * level), true, false))
{ {
_active.remove(cur); _active.remove(cur);
continue; continue;
@ -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(), false); Factory.Fire().Add(fire, cur, 0.7, 0, 0.3 + (0.1 * level), .25, 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);

View File

@ -42,8 +42,8 @@ public class LifeBonds extends Skill
{ {
"Drop Axe/Sword to Toggle.", "Drop Axe/Sword to Toggle.",
"", "",
"Transfers life from healthy allies", "Transfers life from yourself to",
"to nearby allies with less health.", "nearby allies with less health.",
"", "",
"Transfers #0.5#0.5 health every second.", "Transfers #0.5#0.5 health every second.",
"Maximum range of #3#3 Blocks from user." "Maximum range of #3#3 Blocks from user."
@ -188,9 +188,6 @@ public class LifeBonds extends Skill
int level = getLevel(cur); int level = getLevel(cur);
//Bonds //Bonds
Player highest = null;
double highestHp = 0;
Player lowest = null; Player lowest = null;
double lowestHp = 20; double lowestHp = 20;
@ -199,12 +196,6 @@ public class LifeBonds extends Skill
if (Factory.Relation().canHurt(cur, other) && !other.equals(cur)) if (Factory.Relation().canHurt(cur, other) && !other.equals(cur))
continue; continue;
if (highest == null || other.getHealth() > highestHp)
{
highest = other;
highestHp = other.getHealth();
}
if (lowest == null || other.getHealth() < lowestHp) if (lowest == null || other.getHealth() < lowestHp)
{ {
lowest = other; lowest = other;
@ -213,18 +204,18 @@ public class LifeBonds extends Skill
} }
//Nothing to Transfer //Nothing to Transfer
if (highest == null || lowest == null || highest.equals(lowest) || highestHp - lowestHp < 2) if (cur.equals(lowest) || cur.getHealth() - lowestHp < 2)
continue; continue;
double amount = 0.5 + (0.5 * level); double amount = 0.5 + (0.5 * level);
amount = Math.min((double)(highestHp - lowestHp) / 2d, amount); amount = Math.min((double)(cur.getHealth() - lowestHp) / 2d, amount);
//Steal //Steal
UtilPlayer.health(highest, -amount); UtilPlayer.health(cur, -amount);
//Hearts //Hearts
_hearts.add(new LifeBondsData(highest.getLocation().add(0, 0.8, 0), lowest, amount)); _hearts.add(new LifeBondsData(cur.getLocation().add(0, 0.8, 0), lowest, amount));
//Effect //Effect
//highest.getWorld().playEffect(highest.getLocation(), Effect.STEP_SOUND, 18); //highest.getWorld().playEffect(highest.getLocation(), Effect.STEP_SOUND, 18);

View File

@ -22,7 +22,7 @@ public class MagmaBlade extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"Your sword deals an additional,", "Your sword deals an additional,",
"#0.5#0.5 damage to burning opponents,", "#0.25#0.25 damage to burning opponents,",
"but also extinguishes them.", "but also extinguishes them.",
}); });
} }
@ -54,7 +54,7 @@ public class MagmaBlade extends Skill
if (level == 0) return; if (level == 0) return;
//Damage //Damage
event.AddMod(damager.getName(), GetName(), 0.5 + 0.5 * level, true); event.AddMod(damager.getName(), GetName(), 0.25 + 0.25 * level, true);
//Effect //Effect
damager.getWorld().playSound(damager.getLocation(), Sound.FIZZ, 0.8f, 0f); damager.getWorld().playSound(damager.getLocation(), Sound.FIZZ, 0.8f, 0f);

View File

@ -18,18 +18,24 @@ import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile; import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.EntityShootBowEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.util.BlockIterator;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
public class Sharpshooter extends Skill public class Sharpshooter extends Skill
{ {
private WeakHashMap<Player, Integer> _missedCount = new WeakHashMap<Player, Integer>();
private WeakHashMap<Player, Integer> _hitCount = new WeakHashMap<Player, Integer>(); private WeakHashMap<Player, Integer> _hitCount = new WeakHashMap<Player, Integer>();
private HashMap<Entity, Player> _arrows = new HashMap<Entity, Player>(); private HashMap<Arrow, Player> _arrows = new HashMap<Arrow, Player>();
public Sharpshooter(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels) public Sharpshooter(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
{ {
@ -53,9 +59,15 @@ public class Sharpshooter extends Skill
int level = getLevel((Player)event.getEntity()); int level = getLevel((Player)event.getEntity());
if (level == 0) return; if (level == 0) return;
if (!(event.getProjectile() instanceof Arrow))
{
System.out.println(GetName() + " : " + event.getEntity().getName() + " shot bow but resulting projectile was now Arrow?!?!?!?");
return;
}
//Store //Store
_arrows.put(event.getProjectile(), (Player)event.getEntity()); _arrows.put((Arrow) event.getProjectile(), (Player)event.getEntity());
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
@ -98,9 +110,46 @@ public class Sharpshooter extends Skill
projectile.remove(); projectile.remove();
_missedCount.remove(player);
Recharge.Instance.useForce(player, GetName() + " Timer", 5000); Recharge.Instance.useForce(player, GetName() + " Timer", 5000);
} }
@EventHandler
public void missReset(ProjectileHitEvent event)
{
final Projectile projectile = event.getEntity();
Factory.runSyncLater(() -> {
if (!projectile.isDead() && _arrows.containsKey(projectile))
{
Player shooter = (Player) projectile.getShooter();
if (!_hitCount.containsKey(shooter))
{
return;
}
if (!_missedCount.containsKey(shooter))
{
_missedCount.put(shooter, Integer.valueOf(1));
}
else
{
_missedCount.put(shooter, Integer.valueOf(_missedCount.get(shooter).intValue() + 1));
// Reset
if (_missedCount.get(shooter).intValue() >= 2)
{
_hitCount.remove(shooter);
_missedCount.remove(shooter);
UtilPlayer.message(shooter, F.main(GetClassType().name(), GetName() + " : " + F.elem("Damage Bonus Reset")));
shooter.playSound(shooter.getLocation(), Sound.NOTE_PLING, 1f, 0.75f);
}
}
}
}, 3l);
}
@EventHandler @EventHandler
public void resetViaTime(UpdateEvent event) public void resetViaTime(UpdateEvent event)
{ {
@ -148,5 +197,6 @@ public class Sharpshooter extends Skill
public void Reset(Player player) public void Reset(Player player)
{ {
_hitCount.remove(player); _hitCount.remove(player);
_missedCount.remove(player);
} }
} }

View File

@ -1,28 +1,26 @@
package mineplex.minecraft.game.classcombat.Skill.Ranger; package mineplex.minecraft.game.classcombat.Skill.Ranger;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.core.common.util.F;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
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.common.util.UtilParticle.ParticleType; import mineplex.core.updater.UpdateType;
import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.Skill; import mineplex.minecraft.game.classcombat.Skill.Skill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory; import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
public class VitalitySpores extends Skill public class VitalitySpores extends Skill
{ {
private HashMap<Player, Long> _lastMove = new HashMap<Player, Long>(); private HashMap<Player, Long> _lastDamage = new HashMap<>();
public VitalitySpores(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels) public VitalitySpores(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
{ {
@ -30,47 +28,52 @@ public class VitalitySpores extends Skill
SetDesc(new String[] SetDesc(new String[]
{ {
"While standing still, forest spores", "After getting hit, if no damage is taken",
"heal you for #0#0.5 health per 2 seconds." "for 10 Seconds then you will receive",
"Regeneration #2#0 for #5#1 Seconds",
}); });
} }
@EventHandler @EventHandler
public void playerMove(PlayerMoveEvent event) public void damage(CustomDamageEvent event)
{ {
if (doesUserHaveSkill(event.getPlayer()) && UtilMath.offset(event.getFrom(), event.getTo()) > 0) if (doesUserHaveSkill(event.GetDamageePlayer()))
_lastMove.put(event.getPlayer(), System.currentTimeMillis()); {
if (event.GetDamageePlayer().hasPotionEffect(PotionEffectType.REGENERATION))
{
event.GetDamageePlayer().removePotionEffect(PotionEffectType.REGENERATION);
}
else
{
_lastDamage.put(event.GetDamageePlayer(), Long.valueOf(System.currentTimeMillis()));
}
}
} }
@EventHandler @EventHandler
public void update(UpdateEvent event) public void update(UpdateEvent event)
{ {
if (event.getType() != UpdateType.TICK) if (event.getType() != UpdateType.TICK)
{
return; return;
}
for (Player cur : GetUsers())
{ Iterator<Entry<Player, Long>> iterator = _lastDamage.entrySet().iterator();
int level = getLevel(cur); while (iterator.hasNext())
if (level == 0) continue; {
Entry<Player, Long> entry = iterator.next();
if (!_lastMove.containsKey(cur))
continue; if (UtilTime.elapsed(entry.getValue().longValue(), 10000))
if (UtilTime.elapsed(_lastMove.get(cur), 2000))
{ {
UtilPlayer.health(cur, 0.5 * level); iterator.remove();
entry.getKey().addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, (20 * (5 + getLevel(entry.getKey()))), 1));
UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation().add(UtilAlg.getBehind(cur.getLocation().getDirection().multiply(0.5))), 0, 0.2f, 0, 0, 1, }
ViewDist.LONG, UtilServer.getPlayers());
_lastMove.put(cur, System.currentTimeMillis());
}
} }
} }
@Override @Override
public void Reset(Player player) public void Reset(Player player)
{ {
_lastMove.remove(player); _lastDamage.remove(player);
} }
} }

View File

@ -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 #4#1 damage", "mid-air deals up to #2#1 damage",
"and Slow 2 for 3 seconds." "and Slow 2 for 3 seconds."
}); });
@ -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)((4 + getLevel(damager)) * charge); int damage = (int)((2 + getLevel(damager)) * charge);
//Damage Event //Damage Event
Factory.Damage().NewDamageEvent(damagee, damager, null, Factory.Damage().NewDamageEvent(damagee, damager, null,

View File

@ -221,10 +221,6 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 1, 3)); AddSkill(new Fitness(this, "Mana Pool", ClassType.Mage, SkillType.GlobalPassive, 1, 3));
AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 1, 3)); AddSkill(new Recharge(this, "Mana Regeneration", ClassType.Mage, SkillType.GlobalPassive, 1, 3));
AddSkill(new Fitness(this, "Fitness", ClassType.Assassin, SkillType.GlobalPassive, 1, 3));
AddSkill(new Recharge(this, "Rest", ClassType.Assassin, SkillType.GlobalPassive, 1, 3));
//AddSkill(new Stamina(this, "Stamina", ClassType.Global, SkillType.GlobalPassive, 1, 1)); //AddSkill(new Stamina(this, "Stamina", ClassType.Global, SkillType.GlobalPassive, 1, 1));
//AddSkill(new Swim(this, "Swim", ClassType.Global, SkillType.GlobalPassive, 1, 1)); //AddSkill(new Swim(this, "Swim", ClassType.Global, SkillType.GlobalPassive, 1, 1));
} }
@ -235,9 +231,9 @@ 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, 2, 1,
0, 0, 0, 0,
6500, -500, true, 2500, -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}));
@ -337,7 +333,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
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,
21000, -1000, true, 17000, -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}));
@ -374,7 +370,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
AddSkill(new Riposte(this, "Riposte", ClassType.Knight, SkillType.Sword, AddSkill(new Riposte(this, "Riposte", ClassType.Knight, SkillType.Sword,
1, 5, 1, 5,
0, 0, 0, 0,
11000, -1000, false, 15000, -1000, false,
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}));
@ -411,7 +407,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,
3300, -300, true, 4300, -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}));

View File

@ -32,9 +32,6 @@ public class ClassCombatShop extends ShopBase<ClassShopManager>
private boolean _skillsOnly; private boolean _skillsOnly;
private boolean _hub; private boolean _hub;
private String _serverName = getPlugin().getPlugin().getConfig().getString("serverstatus.name");
public ClassCombatShop(ClassShopManager plugin, CoreClientManager clientManager, DonationManager donationManager, boolean skillsOnly, String name) public ClassCombatShop(ClassShopManager plugin, CoreClientManager clientManager, DonationManager donationManager, boolean skillsOnly, String name)
{ {
super(plugin, clientManager, donationManager, name, CurrencyType.GEM); super(plugin, clientManager, donationManager, name, CurrencyType.GEM);
@ -68,8 +65,6 @@ public class ClassCombatShop extends ShopBase<ClassShopManager>
public boolean attemptShopOpen(Player player) public boolean attemptShopOpen(Player player)
{ {
_serverName = _serverName.substring(0, Math.min(16, _serverName.length()));
if (!getOpenedShop().contains(player.getName())) if (!getOpenedShop().contains(player.getName()))
{ {
if (!canOpenShop(player)) if (!canOpenShop(player))
@ -95,7 +90,7 @@ public class ClassCombatShop extends ShopBase<ClassShopManager>
} }
getOpenedShop().add(player.getName()); getOpenedShop().add(player.getName());
openShopForPlayer(player); openShopForPlayer(player);
if (!getPlayerPageMap().containsKey(player.getName())) if (!getPlayerPageMap().containsKey(player.getName()))
{ {

View File

@ -72,7 +72,9 @@ public class Condition
protected boolean _add = false; protected boolean _add = false;
protected boolean _live = false; protected boolean _live = false;
protected boolean _cancelPotion;
protected boolean _showIndicator = true; protected boolean _showIndicator = true;
public Condition(ConditionManager manager, String reason, LivingEntity ent, LivingEntity source, public Condition(ConditionManager manager, String reason, LivingEntity ent, LivingEntity source,
@ -101,6 +103,35 @@ public class Condition
//Live if NOT Additive //Live if NOT Additive
_live = !add; _live = !add;
} }
public Condition(ConditionManager manager, String reason, LivingEntity ent, LivingEntity source,
ConditionType type, int mult, int ticks, boolean add, Material visualType, byte visualData, boolean showIndicator, boolean ambient, boolean cancelPotion)
{
Manager = manager;
_time = System.currentTimeMillis();
_reason = reason;
_ent = ent;
_source = source;
_type = type;
_mult = mult;
_ticks = ticks;
_ticksTotal = ticks;
_ambient = ambient;
_indicatorType = visualType;
_indicatorData = visualData;
_showIndicator = showIndicator;
_cancelPotion = cancelPotion;
_add = add;
//Live if NOT Additive
_live = !add;
}
public boolean Tick() public boolean Tick()
{ {
@ -124,6 +155,11 @@ public class Condition
public void Add() public void Add()
{ {
if (_cancelPotion)
{
return;
}
try try
{ {
PotionEffectType type = PotionEffectType.getByName(_type.toString()); PotionEffectType type = PotionEffectType.getByName(_type.toString());

View File

@ -239,10 +239,16 @@ public class ConditionFactory
public Condition Poison(String reason, LivingEntity ent, LivingEntity source, public Condition Poison(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)
{
return Poison(reason, ent, source, duration, mult, extend, showIndicator, ambient, false);
}
public Condition Poison(String reason, LivingEntity ent, LivingEntity source,
double duration, int mult, boolean extend, boolean showIndicator, boolean ambient, boolean cancelPotion)
{ {
return Manager.AddCondition(new Condition(Manager, reason, ent, source, return Manager.AddCondition(new Condition(Manager, reason, ent, source,
ConditionType.POISON, mult, (int)(20 * duration), extend, ConditionType.POISON, mult, (int)(20 * duration), extend,
Material.SLIME_BALL, (byte)14, showIndicator, ambient)); Material.SLIME_BALL, (byte)14, showIndicator, ambient, cancelPotion));
} }
public Condition PoisonShock(String reason, LivingEntity ent, LivingEntity source, public Condition PoisonShock(String reason, LivingEntity ent, LivingEntity source,

View File

@ -44,6 +44,7 @@ public class CustomDamageEvent extends Event implements Cancellable
private boolean _damageeBrute = false; private boolean _damageeBrute = false;
private boolean _damageToLevel = true; private boolean _damageToLevel = true;
private boolean _arrowShow = true; private boolean _arrowShow = true;
private boolean _projectileDamageSelf = false;
public CustomDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile projectile, Location knockbackOrigin, public CustomDamageEvent(LivingEntity damagee, LivingEntity damager, Projectile projectile, Location knockbackOrigin,
DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor, String initialSource, DamageCause cause, double damage, boolean knockback, boolean ignoreRate, boolean ignoreArmor, String initialSource,
@ -169,6 +170,27 @@ public class CustomDamageEvent extends Event implements Cancellable
return _projectile; return _projectile;
} }
public boolean getProjectileDamageSelf()
{
return _projectileDamageSelf;
}
public void setProjectileDamageSelf(boolean projectileDamageSelf)
{
_projectileDamageSelf = projectileDamageSelf;
if(!projectileDamageSelf)
{
_cancellers.remove("Self Projectile Damage");
}
else
{
if(!_cancellers.contains("Self Projectile Damage"))
{
_cancellers.add("Self Projectile Damage");
}
}
}
public void setShowArrows(boolean show) public void setShowArrows(boolean show)
{ {
_arrowShow = show; _arrowShow = show;

View File

@ -8,24 +8,6 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import mineplex.core.MiniPlugin;
import mineplex.core.common.util.F;
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.UtilGear;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.npc.NpcManager;
import mineplex.minecraft.game.core.combat.CombatManager;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.compatibility.NpcProtectListener;
import net.minecraft.server.v1_8_R3.DamageSource;
import net.minecraft.server.v1_8_R3.EntityHuman;
import net.minecraft.server.v1_8_R3.EntityLiving;
import org.bukkit.EntityEffect; import org.bukkit.EntityEffect;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
@ -48,6 +30,24 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.MiniPlugin;
import mineplex.core.common.util.F;
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.UtilGear;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.npc.NpcManager;
import mineplex.minecraft.game.core.combat.CombatManager;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.compatibility.NpcProtectListener;
import net.minecraft.server.v1_8_R3.DamageSource;
import net.minecraft.server.v1_8_R3.EntityHuman;
import net.minecraft.server.v1_8_R3.EntityLiving;
public class DamageManager extends MiniPlugin public class DamageManager extends MiniPlugin
{ {
private CombatManager _combatManager; private CombatManager _combatManager;
@ -240,18 +240,33 @@ public class DamageManager extends MiniPlugin
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler(priority = EventPriority.HIGHEST) /**
public void removeDemArrowsCrazyMan(EntityDamageEvent event) * Removes arrows after hit, especially in cases where arrows may bounce, like if the damage was cancelled.
*/
@EventHandler(priority = EventPriority.MONITOR)
public void removeArrows(EntityDamageEvent event)
{ {
if (event.isCancelled()) Projectile projectile = GetProjectile(event);
{
Projectile projectile = GetProjectile(event);
if (projectile instanceof Arrow) if (projectile instanceof Arrow)
{ {
projectile.teleport(new Location(projectile.getWorld(), 0, 0, 0)); projectile.teleport(new Location(projectile.getWorld(), 0, 0, 0));
projectile.remove(); projectile.remove();
} }
}
/**
* Removes arrows after hit, especially in cases where arrows may bounce, like if the damage was cancelled.
*/
@EventHandler(priority = EventPriority.MONITOR)
public void removeArrows(CustomDamageEvent event)
{
Projectile projectile = event.GetProjectile();
if (projectile instanceof Arrow)
{
projectile.teleport(new Location(projectile.getWorld(), 0, 0, 0));
projectile.remove();
} }
} }
/* /*
@ -318,6 +333,12 @@ public class DamageManager extends MiniPlugin
event.SetCancelled("0 Health"); event.SetCancelled("0 Health");
return; return;
} }
if (event.GetProjectile() != null && event.GetDamageeEntity().equals(event.GetProjectile().getShooter()) && !event.getProjectileDamageSelf())
{
event.SetCancelled("Self Projectile Damage");
return;
}
if (event.GetDamageePlayer() != null) if (event.GetDamageePlayer() != null)
{ {
@ -378,6 +399,10 @@ public class DamageManager extends MiniPlugin
Player damagee = event.GetDamageePlayer(); Player damagee = event.GetDamageePlayer();
if (damagee != null) if (damagee != null)
{ {
if (event.GetDamage() <= 0)
{
return;
}
if (getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()) > 0) if (getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()) > 0)
{ {
event.AddMult("Ench Prot", damagee.getName(), getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()), false); event.AddMult("Ench Prot", damagee.getName(), getTotalEnchantReduction(damagee.getInventory().getArmorContents(), event.GetCause()), false);
@ -435,6 +460,8 @@ public class DamageManager extends MiniPlugin
Player player = event.GetDamagerPlayer(true); Player player = event.GetDamagerPlayer(true);
if (player != null) if (player != null)
{ {
if (player.equals(event.GetDamageeEntity()) && !event.getProjectileDamageSelf()) return;
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 0.5f, 0.5f); player.playSound(player.getLocation(), Sound.ORB_PICKUP, 0.5f, 0.5f);
} }
} }
@ -459,6 +486,11 @@ public class DamageManager extends MiniPlugin
if (event.GetDamageeEntity().getHealth() <= 0) if (event.GetDamageeEntity().getHealth() <= 0)
return; return;
if (event.GetProjectile() != null &&
event.GetDamageeEntity().equals(event.GetProjectile().getShooter()) &&
!event.getProjectileDamageSelf())
return;
//Player Conditions //Player Conditions
if (event.GetDamageePlayer() != null) if (event.GetDamageePlayer() != null)
{ {
@ -513,14 +545,21 @@ public class DamageManager extends MiniPlugin
origin = event.GetDamagerEntity(true).getLocation(); origin = event.GetDamagerEntity(true).getLocation();
if (event.getKnockbackOrigin() != null) if (event.getKnockbackOrigin() != null)
origin = event.getKnockbackOrigin(); origin = event.getKnockbackOrigin();
else if (event.GetProjectile() != null)
origin = event.GetProjectile().getLocation();
//Vec //Vec
Vector trajectory = UtilAlg.getTrajectory2d(origin, event.GetDamageeEntity().getLocation()); Vector trajectory = UtilAlg.getTrajectory2d(origin, event.GetDamageeEntity().getLocation());
trajectory.multiply(0.6 * knockback); trajectory.multiply(0.6 * knockback);
trajectory.setY(Math.abs(trajectory.getY())); trajectory.setY(Math.abs(trajectory.getY()));
//Special handling for projectiles
if(event.GetProjectile() != null && event.getKnockbackOrigin() == null)
{
trajectory = event.GetProjectile().getVelocity();
trajectory.setY(0);
trajectory.multiply(0.6 * knockback / trajectory.length());
trajectory.setY(0.5);
}
//Apply //Apply
double vel = 0.2 + trajectory.length() * 0.8; double vel = 0.2 + trajectory.length() * 0.8;

View File

@ -1,12 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -24,6 +24,8 @@ public class ServerGroup
private int _requiredTotalServers; private int _requiredTotalServers;
private int _requiredJoinableServers; private int _requiredJoinableServers;
private String _uptimes;
private boolean _arcadeGroup; private boolean _arcadeGroup;
private String _worldZip; private String _worldZip;
private String _plugin; private String _plugin;
@ -78,6 +80,7 @@ public class ServerGroup
_requiredTotalServers = Integer.valueOf(data.get("totalServers")); _requiredTotalServers = Integer.valueOf(data.get("totalServers"));
_requiredJoinableServers = Integer.valueOf(data.get("joinableServers")); _requiredJoinableServers = Integer.valueOf(data.get("joinableServers"));
_portSection = Integer.valueOf(data.get("portSection")); _portSection = Integer.valueOf(data.get("portSection"));
_uptimes = data.get("uptimes");
_arcadeGroup = Boolean.valueOf(data.get("arcadeGroup")); _arcadeGroup = Boolean.valueOf(data.get("arcadeGroup"));
_worldZip = data.get("worldZip"); _worldZip = data.get("worldZip");
_plugin = data.get("plugin"); _plugin = data.get("plugin");
@ -120,7 +123,7 @@ public class ServerGroup
parseServers(serverStatuses); parseServers(serverStatuses);
} }
public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, boolean arcade, String worldZip, String plugin, String configPath public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, String uptimes, boolean arcade, String worldZip, String plugin, String configPath
, int minPlayers, int maxPlayers, boolean pvp, boolean tournament, boolean tournamentPoints, String games, String modes, String boosterGroup, String serverType, boolean noCheat, boolean worldEdit, boolean teamRejoin , int minPlayers, int maxPlayers, boolean pvp, boolean tournament, boolean tournamentPoints, String games, String modes, String boosterGroup, String serverType, boolean noCheat, boolean worldEdit, boolean teamRejoin
, boolean teamAutoJoin, boolean teamForceBalance, boolean gameAutoStart, boolean gameTimeout, boolean rewardGems, boolean rewardItems, boolean rewardStats , boolean teamAutoJoin, boolean teamForceBalance, boolean gameAutoStart, boolean gameTimeout, boolean rewardGems, boolean rewardItems, boolean rewardStats
, boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region , boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region
@ -134,6 +137,7 @@ public class ServerGroup
_requiredTotalServers = totalServers; _requiredTotalServers = totalServers;
_requiredJoinableServers = joinable; _requiredJoinableServers = joinable;
_portSection = portSection; _portSection = portSection;
_uptimes = uptimes;
_arcadeGroup = arcade; _arcadeGroup = arcade;
_worldZip = worldZip; _worldZip = worldZip;
_plugin = plugin; _plugin = plugin;
@ -232,6 +236,7 @@ public class ServerGroup
public String getServerNpcName() { return _npcName; } public String getServerNpcName() { return _npcName; }
public String getPortalBottomCornerLocation() { return _portalBottomCornerLocation; } public String getPortalBottomCornerLocation() { return _portalBottomCornerLocation; }
public String getPortalTopCornerLocation() { return _portalTopCornerLocation; } public String getPortalTopCornerLocation() { return _portalTopCornerLocation; }
public String getUptimes() { return _uptimes; }
public Set<MinecraftServer> getServers() { return _servers; } public Set<MinecraftServer> getServers() { return _servers; }
@ -358,6 +363,7 @@ public class ServerGroup
_dataMap.put("totalServers", _requiredTotalServers + ""); _dataMap.put("totalServers", _requiredTotalServers + "");
_dataMap.put("joinableServers", _requiredJoinableServers + ""); _dataMap.put("joinableServers", _requiredJoinableServers + "");
_dataMap.put("portSection", _portSection + ""); _dataMap.put("portSection", _portSection + "");
_dataMap.put("uptimes", _uptimes);
_dataMap.put("arcadeGroup", _arcadeGroup + ""); _dataMap.put("arcadeGroup", _arcadeGroup + "");
_dataMap.put("worldZip", _worldZip); _dataMap.put("worldZip", _worldZip);
_dataMap.put("plugin", _plugin); _dataMap.put("plugin", _plugin);
@ -368,6 +374,7 @@ public class ServerGroup
_dataMap.put("tournament", _tournament + ""); _dataMap.put("tournament", _tournament + "");
_dataMap.put("tournamentPoints", _tournamentPoints + ""); _dataMap.put("tournamentPoints", _tournamentPoints + "");
_dataMap.put("games", _games); _dataMap.put("games", _games);
_dataMap.put("modes", _modes);
_dataMap.put("serverType", _serverType); _dataMap.put("serverType", _serverType);
_dataMap.put("addNoCheat", _addNoCheat + ""); _dataMap.put("addNoCheat", _addNoCheat + "");
_dataMap.put("teamRejoin", _teamRejoin + ""); _dataMap.put("teamRejoin", _teamRejoin + "");

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,298 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=52
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=false
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=150
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=1
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=false
org.eclipse.jdt.core.formatter.join_wrapped_lines=false
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=300
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter

View File

@ -1,3 +0,0 @@
eclipse.preferences.version=1
formatter_profile=_Thanos
formatter_settings_version=12

View File

@ -216,6 +216,7 @@ public class Arcade extends JavaPlugin
config.ServerType = _serverConfiguration.getServerGroup().getServerType(); config.ServerType = _serverConfiguration.getServerGroup().getServerType();
config.MinPlayers = _serverConfiguration.getServerGroup().getMinPlayers(); config.MinPlayers = _serverConfiguration.getServerGroup().getMinPlayers();
config.MaxPlayers = _serverConfiguration.getServerGroup().getMaxPlayers(); config.MaxPlayers = _serverConfiguration.getServerGroup().getMaxPlayers();
config.Uptimes = _serverConfiguration.getServerGroup().getUptimes();
config.Tournament = _serverConfiguration.getServerGroup().getTournament(); config.Tournament = _serverConfiguration.getServerGroup().getTournament();
config.TournamentPoints = _serverConfiguration.getServerGroup().getTournamentPoints(); config.TournamentPoints = _serverConfiguration.getServerGroup().getTournamentPoints();
config.TeamRejoin = _serverConfiguration.getServerGroup().getTeamRejoin(); config.TeamRejoin = _serverConfiguration.getServerGroup().getTeamRejoin();

View File

@ -173,7 +173,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private ProgressingKitManager _progressionKitManager; private ProgressingKitManager _progressionKitManager;
private BoosterManager _boosterManager; private BoosterManager _boosterManager;
private GameSpectatorManager _spectatorManager; private GameSpectatorManager _spectatorManager;
private ServerUptimeManager _serverUptimeManager;
private IncognitoManager _incognitoManager; private IncognitoManager _incognitoManager;
private TaskManager _taskManager; private TaskManager _taskManager;
@ -331,7 +332,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_kitProgressionManager = new KitProgressionManager(getPlugin(), clientManager); _kitProgressionManager = new KitProgressionManager(getPlugin(), clientManager);
_progressionKitManager = new ProgressingKitManager(this); _progressionKitManager = new ProgressingKitManager(this);
_serverUptimeManager = new ServerUptimeManager(this);
if (GetHost() != null && !GetHost().isEmpty()) if (GetHost() != null && !GetHost().isEmpty())
{ {
Bukkit.getScheduler().runTaskLater(plugin, () -> Portal.transferPlayer(GetHost(), _serverStatusManager.getCurrentServerName()), 80L); Bukkit.getScheduler().runTaskLater(plugin, () -> Portal.transferPlayer(GetHost(), _serverStatusManager.getCurrentServerName()), 80L);

View File

@ -1,5 +1,7 @@
package nautilus.game.arcade; package nautilus.game.arcade;
import mineplex.core.common.MinecraftVersion;
import mineplex.core.common.Pair;
import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game;
/** /**
@ -14,16 +16,34 @@ public class GameMode
private GameType _gameType; private GameType _gameType;
private String _name; private String _name;
private Pair<MinecraftVersion, String>[] _resourcePackUrls;
private boolean _enforceResourcePack;
/** /**
* *
* @param gameMode Game class that in most cases extends the host game class * @param gameMode Game class that in most cases extends the host game class
* @param name Gamemode name * @param name Gamemode name
*/ */
public GameMode(Class<? extends Game> gameMode, GameType gameType, String name) public GameMode(Class<? extends Game> gameMode, GameType gameType, String name)
{
this(gameMode, gameType, name, null, false);
}
/**
*
* @param gameMode Game class that in most cases extends the host game class
* @param gameType original GameType of modded game
* @param name Gamemode name
* @param resourcePackUrls URLs to 1.8/1.9 resource pack
* @param enforceResourcePack enforece resource pack on players
*/
public GameMode(Class<? extends Game> gameMode, GameType gameType, String name, Pair<MinecraftVersion, String>[] resourcePackUrls, boolean enforceResourcePack)
{ {
_gameMode = gameMode; _gameMode = gameMode;
_gameType = gameType; _gameType = gameType;
_name = name; _name = name;
_resourcePackUrls = resourcePackUrls;
_enforceResourcePack = enforceResourcePack;
} }
/** /**
@ -52,5 +72,23 @@ public class GameMode
{ {
return _gameType; return _gameType;
} }
/**
*
* @return Gamemode resource pack URLs
*/
public Pair<MinecraftVersion, String>[] getResPackURLs()
{
return _resourcePackUrls;
}
/**
*
* @return Gamemode enforcing of resource packs
*/
public boolean enforceResourcePack()
{
return _enforceResourcePack;
}
} }

View File

@ -12,6 +12,7 @@ import nautilus.game.arcade.game.games.barbarians.Barbarians;
import nautilus.game.arcade.game.games.bossbattles.BossBattles; import nautilus.game.arcade.game.games.bossbattles.BossBattles;
import nautilus.game.arcade.game.games.bouncyballs.BouncyBalls; import nautilus.game.arcade.game.games.bouncyballs.BouncyBalls;
import nautilus.game.arcade.game.games.bridge.Bridge; import nautilus.game.arcade.game.games.bridge.Bridge;
import nautilus.game.arcade.game.games.bridge.modes.LuckyBridges;
import nautilus.game.arcade.game.games.bridge.modes.OverpoweredBridge; import nautilus.game.arcade.game.games.bridge.modes.OverpoweredBridge;
import nautilus.game.arcade.game.games.bridge.modes.SpeedBridges ; import nautilus.game.arcade.game.games.bridge.modes.SpeedBridges ;
import nautilus.game.arcade.game.games.build.Build; import nautilus.game.arcade.game.games.build.Build;
@ -22,6 +23,7 @@ import nautilus.game.arcade.game.games.castlesiege.CastleSiege;
import nautilus.game.arcade.game.games.champions.ChampionsCTF; import nautilus.game.arcade.game.games.champions.ChampionsCTF;
import nautilus.game.arcade.game.games.champions.ChampionsDominate; import nautilus.game.arcade.game.games.champions.ChampionsDominate;
import nautilus.game.arcade.game.games.champions.ChampionsTDM; import nautilus.game.arcade.game.games.champions.ChampionsTDM;
import nautilus.game.arcade.game.games.champions.modes.SmashDom;
import nautilus.game.arcade.game.games.christmas.Christmas; import nautilus.game.arcade.game.games.christmas.Christmas;
import nautilus.game.arcade.game.games.deathtag.DeathTag; import nautilus.game.arcade.game.games.deathtag.DeathTag;
import nautilus.game.arcade.game.games.dragonescape.DragonEscape; import nautilus.game.arcade.game.games.dragonescape.DragonEscape;
@ -35,6 +37,7 @@ import nautilus.game.arcade.game.games.evolution.Evolution;
import nautilus.game.arcade.game.games.gladiators.Gladiators; import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.game.games.gladiators.modes.ChampionsGladiators; import nautilus.game.arcade.game.games.gladiators.modes.ChampionsGladiators;
import nautilus.game.arcade.game.games.gladiators.modes.OverpoweredGladiators; import nautilus.game.arcade.game.games.gladiators.modes.OverpoweredGladiators;
import nautilus.game.arcade.game.games.gladiators.modes.SmashGladiators;
import nautilus.game.arcade.game.games.gravity.Gravity; import nautilus.game.arcade.game.games.gravity.Gravity;
import nautilus.game.arcade.game.games.halloween.Halloween; import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.hideseek.HideSeek; import nautilus.game.arcade.game.games.hideseek.HideSeek;
@ -43,10 +46,13 @@ import nautilus.game.arcade.game.games.holeinwall.HoleInTheWall;
import nautilus.game.arcade.game.games.horsecharge.Horse; import nautilus.game.arcade.game.games.horsecharge.Horse;
import nautilus.game.arcade.game.games.lobbers.BombLobbers; import nautilus.game.arcade.game.games.lobbers.BombLobbers;
import nautilus.game.arcade.game.games.micro.Micro; import nautilus.game.arcade.game.games.micro.Micro;
import nautilus.game.arcade.game.games.micro.modes.CookieFight;
import nautilus.game.arcade.game.games.micro.modes.OverpoweredMicroBattles;
import nautilus.game.arcade.game.games.micro.modes.TinySmash;
import nautilus.game.arcade.game.games.micro.modes.TinyWinners; import nautilus.game.arcade.game.games.micro.modes.TinyWinners;
import nautilus.game.arcade.game.games.milkcow.MilkCow; import nautilus.game.arcade.game.games.milkcow.MilkCow;
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague; import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.Minestrike;
import nautilus.game.arcade.game.games.mineware.BawkBawkBattles; import nautilus.game.arcade.game.games.mineware.BawkBawkBattles;
import nautilus.game.arcade.game.games.monsterleague.MonsterLeague; import nautilus.game.arcade.game.games.monsterleague.MonsterLeague;
import nautilus.game.arcade.game.games.monstermaze.MonsterMaze; import nautilus.game.arcade.game.games.monstermaze.MonsterMaze;
@ -61,9 +67,12 @@ import nautilus.game.arcade.game.games.runner.modes.FasterThanLight;
import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy; import nautilus.game.arcade.game.games.searchanddestroy.SearchAndDestroy;
import nautilus.game.arcade.game.games.sheep.SheepGame; import nautilus.game.arcade.game.games.sheep.SheepGame;
import nautilus.game.arcade.game.games.sheep.modes.EweHeroes; import nautilus.game.arcade.game.games.sheep.modes.EweHeroes;
import nautilus.game.arcade.game.games.sheep.modes.OverpoweredSheepQuest;
import nautilus.game.arcade.game.games.sheep.modes.SmashSheep;
import nautilus.game.arcade.game.games.skywars.SoloSkywars; import nautilus.game.arcade.game.games.skywars.SoloSkywars;
import nautilus.game.arcade.game.games.skywars.TeamSkywars; import nautilus.game.arcade.game.games.skywars.TeamSkywars;
import nautilus.game.arcade.game.games.skywars.modes.OverpoweredSkywars; import nautilus.game.arcade.game.games.skywars.modes.OverpoweredSkywars;
import nautilus.game.arcade.game.games.skywars.modes.SkySmash;
import nautilus.game.arcade.game.games.skywars.modes.UHCSkywars; import nautilus.game.arcade.game.games.skywars.modes.UHCSkywars;
import nautilus.game.arcade.game.games.smash.SoloSuperSmash; import nautilus.game.arcade.game.games.smash.SoloSuperSmash;
import nautilus.game.arcade.game.games.smash.SuperSmashDominate; import nautilus.game.arcade.game.games.smash.SuperSmashDominate;
@ -80,7 +89,9 @@ import nautilus.game.arcade.game.games.squidshooter.SquidShooter;
import nautilus.game.arcade.game.games.stacker.Stacker; import nautilus.game.arcade.game.games.stacker.Stacker;
import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames; import nautilus.game.arcade.game.games.survivalgames.SoloSurvivalGames;
import nautilus.game.arcade.game.games.survivalgames.TeamSurvivalGames; import nautilus.game.arcade.game.games.survivalgames.TeamSurvivalGames;
import nautilus.game.arcade.game.games.survivalgames.modes.ChangingKits;
import nautilus.game.arcade.game.games.survivalgames.modes.OverpoweredSurvival; import nautilus.game.arcade.game.games.survivalgames.modes.OverpoweredSurvival;
import nautilus.game.arcade.game.games.survivalgames.modes.StrikeGames;
import nautilus.game.arcade.game.games.survivalgames.modes.UHCSurvivalgames; import nautilus.game.arcade.game.games.survivalgames.modes.UHCSurvivalgames;
import nautilus.game.arcade.game.games.tug.Tug; import nautilus.game.arcade.game.games.tug.Tug;
import nautilus.game.arcade.game.games.turfforts.TurfForts; import nautilus.game.arcade.game.games.turfforts.TurfForts;
@ -94,6 +105,7 @@ import nautilus.game.arcade.game.games.valentines.Valentines;
import nautilus.game.arcade.game.games.wither.WitherGame; import nautilus.game.arcade.game.games.wither.WitherGame;
import nautilus.game.arcade.game.games.wizards.Wizards; import nautilus.game.arcade.game.games.wizards.Wizards;
import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival; import nautilus.game.arcade.game.games.zombiesurvival.ZombieSurvival;
public enum GameType public enum GameType
{ {
//Mini //Mini
@ -132,7 +144,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, new Pair[] MineStrike(Minestrike.class, GameDisplay.MineStrike, new Pair[]
{ {
Pair.create(MinecraftVersion.Version1_8, "http://file.mineplex.com/ResMinestrike.zip"), Pair.create(MinecraftVersion.Version1_8, "http://file.mineplex.com/ResMinestrike.zip"),
Pair.create(MinecraftVersion.Version1_9, "http://file.mineplex.com/ResMinestrike19.zip") Pair.create(MinecraftVersion.Version1_9, "http://file.mineplex.com/ResMinestrike19.zip")
@ -195,20 +207,42 @@ public enum GameType
GameType.WitherAssault, GameType.Wizards, GameType.ZombieSurvival}, true), GameType.WitherAssault, GameType.Wizards, GameType.ZombieSurvival}, true),
Brawl(null, new GameMode[]{ Brawl(null, new GameMode[]{
new GameMode(OverpoweredBridge.class, GameType.Bridge, "OP Bridges"), new GameMode(SpeedBridges.class, GameType.Bridge, "Speed Bridges"), new GameMode(OverpoweredBridge.class, GameType.Bridge, "OP Bridges"),
new GameMode(OverpoweredGladiators.class, GameType.Gladiators, "OP Gladiators"), new GameMode(ChampionsGladiators.class, GameType.Gladiators, "Champions Gladiators"), new GameMode(SpeedBridges.class, GameType.Bridge, "Speed Bridges"),
new GameMode(OverpoweredSkywars.class, GameType.Skywars, "OP Skywars"), new GameMode(UHCSkywars.class, GameType.Skywars, "UHC Skywars"), new GameMode(LuckyBridges.class, GameType.Bridge, "Lucky Bridges"),
new GameMode(TeamBuild.class, GameType.Build, "Team Master Builders"), new GameMode(DukesOfDecoration.class, GameType.Build, "Dukes Of Decoration"), new GameMode(OverpoweredGladiators.class, GameType.Gladiators, "OP Gladiators"),
new GameMode(CutClean.class, GameType.UHC, "Cut Clean"), new GameMode(GodBattles.class, GameType.UHC, "God Battles"), new GameMode(ChampionsGladiators.class, GameType.Gladiators, "Champions Gladiators"),
new GameMode(BloodDiamonds.class, GameType.UHC, "Blood Diamonds"), new GameMode(Assassins.class, GameType.UHC, "Assassins"), new GameMode(SmashGladiators.class, GameType.Gladiators, "Smash Gladiators"),
new GameMode(OverpoweredSurvival.class, GameType.SurvivalGames, "OP Survival Games"), new GameMode(UHCSurvivalgames.class, GameType.SurvivalGames, "UHC Survivalgames"), new GameMode(OverpoweredSkywars.class, GameType.Skywars, "OP Skywars"),
new GameMode(UltraSpleef.class, GameType.Spleef, "Ultra Spleef"), new GameMode(UHCSkywars.class, GameType.Skywars, "UHC Skywars"),
new GameMode(RandomKitSSM.class, GameType.Smash, "Random Kit SSM"), new GameMode(SkySmash.class, GameType.Skywars, "Sky Smash"),
new GameMode(EweHeroes.class, GameType.Sheep, "Heroes Of The Ewe"), new GameMode(TeamBuild.class, GameType.Build, "Team Master Builders"),
new GameMode(FasterThanLight.class, GameType.Runner, "Faster Than Light"), new GameMode(DukesOfDecoration.class, GameType.Build, "Dukes Of Decoration"),
new GameMode(BunnyHop.class, GameType.Quiver, "Bunny Hop"), new GameMode(CutClean.class, GameType.UHC, "Cut Clean"),
new GameMode(GodBattles.class, GameType.UHC, "God Battles"),
new GameMode(BloodDiamonds.class, GameType.UHC, "Blood Diamonds"),
new GameMode(Assassins.class, GameType.UHC, "Assassins"),
new GameMode(OverpoweredSurvival.class, GameType.SurvivalGames, "OP Survival Games"),
new GameMode(UHCSurvivalgames.class, GameType.SurvivalGames, "UHC Survivalgames"),
new GameMode(ChangingKits.class, GameType.SurvivalGames, "Changing Kits"),
new GameMode(StrikeGames.class, GameType.SurvivalGames, "Strike Games", new Pair[]
{
Pair.create(MinecraftVersion.Version1_8, "http://file.mineplex.com/ResStrikeGames18.zip"),
Pair.create(MinecraftVersion.Version1_9, "http://file.mineplex.com/ResStrikeGames19.zip")
}, true),
new GameMode(TinyWinners.class, GameType.Micro, "Tiny Winners"), new GameMode(TinyWinners.class, GameType.Micro, "Tiny Winners"),
new GameMode(Countdown.class, GameType.HideSeek, "Countdown"), new GameMode(OverpoweredMicroBattles.class, GameType.Micro, "OP Micro Battles"),
new GameMode(CookieFight.class, GameType.Micro, "Cookie Fight"),
new GameMode(TinySmash.class, GameType.Micro, "Tiny Smash"),
new GameMode(UltraSpleef.class, GameType.Spleef, "Ultra Spleef"),
new GameMode(RandomKitSSM.class, GameType.Smash, "Random Kit SSM"),
new GameMode(EweHeroes.class, GameType.Sheep, "Heroes Of The Ewe"),
new GameMode(SmashSheep.class, GameType.Sheep, "Smash Sheep"),
new GameMode(OverpoweredSheepQuest.class, GameType.Sheep, "OP Sheep Quest"),
new GameMode(FasterThanLight.class, GameType.Runner, "Faster Than Light"),
new GameMode(BunnyHop.class, GameType.Quiver, "Bunny Hop"),
new GameMode(Countdown.class, GameType.HideSeek, "Countdown"),
new GameMode(SmashDom.class, GameType.ChampionsDominate, "Smash Dominate"),
}, GameDisplay.Brawl, null, false, null, false, true); }, GameDisplay.Brawl, null, false, null, false, true);
GameDisplay _display; GameDisplay _display;
@ -277,13 +311,21 @@ public enum GameType
return _gameModes; return _gameModes;
} }
public boolean isEnforceResourcePack() public boolean isEnforceResourcePack(Game game)
{ {
if (hasGamemodes())
{
return getGameMode(game.getClass()).enforceResourcePack();
}
return _enforceResourcePack; return _enforceResourcePack;
} }
public Pair<MinecraftVersion, String>[] getResourcePackUrls() public Pair<MinecraftVersion, String>[] getResourcePackUrls(Game game)
{ {
if (hasGamemodes())
{
return getGameMode(game.getClass()).getResPackURLs();
}
return _resourcePacks; return _resourcePacks;
} }
@ -331,18 +373,28 @@ public enum GameType
return _display.getKitGameName(); return _display.getKitGameName();
} }
public GameType getModeGameType(Class<? extends Game> game) public boolean isUsingGameModes()
{
return _gameMaps;
}
public GameMode getGameMode(Class<? extends Game> game)
{ {
for (GameMode mode : getGameModes()) for (GameMode mode : getGameModes())
{ {
if (mode.getGameClass() != null && mode.getGameClass().getName().contentEquals(game.getName())) if (mode.getGameClass() != null && mode.getGameClass().getName().contentEquals(game.getName()))
{ {
return mode.getType(); return mode;
} }
} }
return null; return null;
} }
public GameType getModeGameType(Class<? extends Game> game)
{
return getGameMode(game).getType();
}
public boolean isUsingGameModesMaps() public boolean isUsingGameModesMaps()
{ {
return _gameMaps; return _gameMaps;

View File

@ -2,10 +2,12 @@ package nautilus.game.arcade.game;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import mineplex.core.common.util.*; import mineplex.core.common.util.*;
import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.elo.EloPlayer; import mineplex.core.elo.EloPlayer;
import mineplex.core.elo.EloTeam; import mineplex.core.elo.EloTeam;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo; import mineplex.core.packethandler.PacketInfo;
@ -33,6 +35,7 @@ import nautilus.game.arcade.world.WorldData;
import net.minecraft.server.v1_8_R3.EntityItem; import net.minecraft.server.v1_8_R3.EntityItem;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import net.minecraft.server.v1_8_R3.WorldServer; import net.minecraft.server.v1_8_R3.WorldServer;
import org.bukkit.*; import org.bukkit.*;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@ -398,7 +401,7 @@ public abstract class Game implements Listener
new ExperienceStatTracker(this), new WinStatTracker(this), new LoseStatTracker(this), new DamageDealtStatTracker( new ExperienceStatTracker(this), new WinStatTracker(this), new LoseStatTracker(this), new DamageDealtStatTracker(
this), new DamageTakenStatTracker(this), new GamesPlayedStatTracker(this)); this), new DamageTakenStatTracker(this), new GamesPlayedStatTracker(this));
Manager.getResourcePackManager().setResourcePack(gameType.getResourcePackUrls(), gameType.isEnforceResourcePack()); Manager.getResourcePackManager().setResourcePack(gameType.getResourcePackUrls(this), gameType.isEnforceResourcePack(this));
_useEntityPacketHandler = new IPacketHandler() _useEntityPacketHandler = new IPacketHandler()
{ {
@ -867,6 +870,11 @@ public abstract class Game implements Listener
} }
public void SetKit(Player player, Kit kit, boolean announce) public void SetKit(Player player, Kit kit, boolean announce)
{
SetKit(player, kit, announce, true);
}
public void SetKit(Player player, Kit kit, boolean announce, boolean apply)
{ {
GameTeam team = GetTeam(player); GameTeam team = GetTeam(player);
if (team != null) if (team != null)
@ -897,7 +905,7 @@ public abstract class Game implements Listener
UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + ".")); UtilPlayer.message(player, F.main("Kit", "You equipped " + F.elem(kit.GetFormattedName() + " Kit") + "."));
} }
if (InProgress()) if (InProgress() && apply)
{ {
kit.ApplyKit(player); kit.ApplyKit(player);
} }
@ -1673,6 +1681,18 @@ public abstract class Game implements Listener
// End // End
SetState(GameState.End); SetState(GameState.End);
} }
@EventHandler
public void disableParticles(GameStateChangeEvent event)
{
if (event.GetState() == GameState.Prepare && Manager.getCosmeticManager().getGadgetManager().hideParticles())
{
for (Player player : GetPlayers(false))
{
getArcadeManager().getCosmeticManager().getGadgetManager().removeGadgetType(player, GadgetType.PARTICLE);
}
}
}
@EventHandler @EventHandler
public void onGameStart(GameStateChangeEvent event) public void onGameStart(GameStateChangeEvent event)

View File

@ -12,6 +12,9 @@ public class GameServerConfig
public String BoosterGroup = null; public String BoosterGroup = null;
public int MinPlayers = -1; public int MinPlayers = -1;
public int MaxPlayers = -1; public int MaxPlayers = -1;
public String Uptimes;
public ArrayList<GameType> GameList = new ArrayList<GameType>(); public ArrayList<GameType> GameList = new ArrayList<GameType>();
public ArrayList<String> GameModeList = new ArrayList<String>(); public ArrayList<String> GameModeList = new ArrayList<String>();

View File

@ -0,0 +1,74 @@
package nautilus.game.arcade.game.games.bridge.modes;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.AbsorptionFix;
import nautilus.game.arcade.game.games.bridge.Bridge;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
/**
* LuckyBridges gamemode for Bridges
*
* @author xXVevzZXx
*/
public class LuckyBridges extends Bridge
{
private HashMap<Material, List<Material>> _drops;
public LuckyBridges(ArcadeManager manager)
{
super(manager, GameType.Brawl);
_drops = new HashMap<>();
_drops.put(Material.DIAMOND_ORE, Arrays.asList(
Material.DIAMOND_HELMET, Material.DIAMOND_CHESTPLATE, Material.DIAMOND_LEGGINGS, Material.DIAMOND_BOOTS,
Material.DIAMOND_PICKAXE, Material.DIAMOND_AXE, Material.DIAMOND_SWORD));
_drops.put(Material.IRON_ORE, Arrays.asList(
Material.IRON_HELMET, Material.IRON_CHESTPLATE, Material.IRON_LEGGINGS, Material.IRON_BOOTS,
Material.IRON_PICKAXE, Material.IRON_AXE, Material.IRON_SWORD));
_drops.put(Material.GOLD_ORE, Arrays.asList(
Material.GOLD_HELMET, Material.GOLD_CHESTPLATE, Material.GOLD_LEGGINGS, Material.GOLD_BOOTS,
Material.GOLD_PICKAXE, Material.GOLD_AXE, Material.GOLD_SWORD, Material.GOLDEN_APPLE));
new AbsorptionFix(this);
}
@EventHandler
public void mine(BlockBreakEvent event)
{
List<Material> blockDrops = _drops.get(event.getBlock().getType());
if (blockDrops != null)
{
event.setCancelled(true);
event.getBlock().setType(Material.AIR);
Bukkit.getScheduler().runTask(Manager.getPlugin(), () ->
event.getBlock().getWorld().dropItem(
event.getBlock().getLocation().add(0.5, 0.2, 0.5),
new ItemStack(blockDrops.get(UtilMath.r(blockDrops.size()))))
);
}
}
@Override
public String GetMode()
{
return "Lucky Bridges";
}
}

View File

@ -54,12 +54,6 @@ public class OverpoweredBridge extends Bridge
Manager.GetDamage().SetEnabled(false); Manager.GetDamage().SetEnabled(false);
new AbsorptionFix(this); new AbsorptionFix(this);
}
@Override
public void ParseData()
{
_starterChests = new HashMap<>();
_starterItems = new HashMap<>(); _starterItems = new HashMap<>();
_starterItems.put(Material.WOOD, 64); _starterItems.put(Material.WOOD, 64);
@ -72,6 +66,12 @@ public class OverpoweredBridge extends Bridge
_starterItems.put(Material.EXP_BOTTLE, 64); _starterItems.put(Material.EXP_BOTTLE, 64);
_starterItems.put(Material.COOKED_BEEF, 64); _starterItems.put(Material.COOKED_BEEF, 64);
_starterItems.put(Material.DIAMOND, 300); _starterItems.put(Material.DIAMOND, 300);
}
@Override
public void ParseData()
{
_starterChests = new HashMap<>();
ParseLavaBridge(); ParseLavaBridge();
ParseWoodBridge(); ParseWoodBridge();

View File

@ -1,9 +1,7 @@
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;
@ -28,7 +26,6 @@ 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.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;

View File

@ -16,7 +16,6 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage;
import nautilus.game.arcade.game.games.champions.kits.KitRanger; import nautilus.game.arcade.game.games.champions.kits.KitRanger;
import nautilus.game.arcade.game.games.common.Domination; import nautilus.game.arcade.game.games.common.Domination;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
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;

View File

@ -16,7 +16,6 @@ import nautilus.game.arcade.game.games.champions.kits.KitMage;
import nautilus.game.arcade.game.games.champions.kits.KitRanger; import nautilus.game.arcade.game.games.champions.kits.KitRanger;
import nautilus.game.arcade.game.games.common.TeamDeathmatch; import nautilus.game.arcade.game.games.common.TeamDeathmatch;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.ElectrocutionStatTracker; import nautilus.game.arcade.stats.ElectrocutionStatTracker;
import nautilus.game.arcade.stats.KillAllOpposingStatTracker; import nautilus.game.arcade.stats.KillAllOpposingStatTracker;
import nautilus.game.arcade.stats.KillReasonStatTracker; import nautilus.game.arcade.stats.KillReasonStatTracker;

View File

@ -0,0 +1,109 @@
package nautilus.game.arcade.game.games.champions.modes;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.common.Domination;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze;
import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem;
import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube;
import nautilus.game.arcade.game.games.smash.kits.KitPig;
import nautilus.game.arcade.game.games.smash.kits.KitSheep;
import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse;
import nautilus.game.arcade.game.games.smash.kits.KitSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitSkySquid;
import nautilus.game.arcade.game.games.smash.kits.KitSlime;
import nautilus.game.arcade.game.games.smash.kits.KitSnowman;
import nautilus.game.arcade.game.games.smash.kits.KitSpider;
import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.kit.Kit;
/**
* SmashDom
*
* @author xXVevzZXx
*/
public class SmashDom extends Domination
{
public SmashDom(ArcadeManager manager)
{
super(manager, GameType.Brawl, new Kit[]
{
new KitSkeleton(manager),
new KitGolem(manager),
new KitSpider(manager),
new KitSlime(manager),
new KitCreeper(manager),
new KitEnderman(manager),
new KitSnowman(manager),
new KitWolf(manager),
new KitBlaze(manager),
new KitWitch(manager),
new KitChicken(manager),
new KitSkeletalHorse(manager),
new KitPig(manager),
new KitSkySquid(manager),
new KitWitherSkeleton(manager),
new KitMagmaCube(manager),
new KitZombie(manager),
new KitCow(manager),
new KitSheep(manager)
});
Manager.GetDamage().UseSimpleWeaponDamage = false;
Manager.getCosmeticManager().setHideParticles(true);
Manager.getClassManager().GetItemFactory().getProximityManager().setProxyLimit(6);
Manager.getClassManager().deregisterSelf();
StrictAntiHack = true;
InventoryOpenChest = true;
EnableSupply = false;
}
@EventHandler(priority = EventPriority.LOWEST)
public void noFallDamage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() == DamageCause.FALL)
event.SetCancelled("No Fall Damage");
}
@EventHandler(priority = EventPriority.HIGH)
public void customKnockback(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetDamageePlayer() != null)
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
}
@Override
public String GetMode()
{
return "Smash Dominate";
}
}

View File

@ -48,6 +48,10 @@ import nautilus.game.arcade.kit.Kit;
public class Domination extends TeamGame public class Domination extends TeamGame
{ {
//Configuration
public boolean EnableEmerald = true;
public boolean EnableSupply = true;
//Map Data //Map Data
private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>(); private ArrayList<CapturePoint> _points = new ArrayList<CapturePoint>();
private ArrayList<Emerald> _emerald = new ArrayList<Emerald>(); private ArrayList<Emerald> _emerald = new ArrayList<Emerald>();
@ -179,10 +183,20 @@ public class Domination extends TeamGame
public void PowerupPickup(PlayerPickupItemEvent event) public void PowerupPickup(PlayerPickupItemEvent event)
{ {
for (Emerald cur : _emerald) for (Emerald cur : _emerald)
cur.Pickup(event.getPlayer(), event.getItem()); {
if (EnableEmerald)
cur.Pickup(event.getPlayer(), event.getItem());
else
return;
}
for (Resupply cur : _resupply) for (Resupply cur : _resupply)
cur.Pickup(event.getPlayer(), event.getItem()); {
if (EnableSupply)
cur.Pickup(event.getPlayer(), event.getItem());
else
return;
}
} }
@EventHandler @EventHandler

View File

@ -0,0 +1,109 @@
package nautilus.game.arcade.game.games.gladiators.modes;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.gladiators.ArenaType;
import nautilus.game.arcade.game.games.gladiators.Gladiators;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze;
import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem;
import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube;
import nautilus.game.arcade.game.games.smash.kits.KitPig;
import nautilus.game.arcade.game.games.smash.kits.KitSheep;
import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse;
import nautilus.game.arcade.game.games.smash.kits.KitSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitSkySquid;
import nautilus.game.arcade.game.games.smash.kits.KitSlime;
import nautilus.game.arcade.game.games.smash.kits.KitSnowman;
import nautilus.game.arcade.game.games.smash.kits.KitSpider;
import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.kit.Kit;
/**
* SmashGladiators
*
* @author xXVevzZXx
*/
public class SmashGladiators extends Gladiators
{
public SmashGladiators(ArcadeManager manager)
{
super(manager, new Kit[]
{
new KitSkeleton(manager),
new KitGolem(manager),
new KitSpider(manager),
new KitSlime(manager),
new KitCreeper(manager),
new KitEnderman(manager),
new KitSnowman(manager),
new KitWolf(manager),
new KitBlaze(manager),
new KitWitch(manager),
new KitChicken(manager),
new KitSkeletalHorse(manager),
new KitPig(manager),
new KitSkySquid(manager),
new KitWitherSkeleton(manager),
new KitMagmaCube(manager),
new KitZombie(manager),
new KitCow(manager),
new KitSheep(manager)
}, GameType.Brawl);
}
@EventHandler(priority = EventPriority.LOWEST)
public void noFallDamage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() == DamageCause.FALL)
event.SetCancelled("No Fall Damage");
}
@EventHandler(priority = EventPriority.HIGH)
public void customKnockback(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetDamageePlayer() != null)
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
}
@Override
protected void giveLoadout(Player p, ArenaType type)
{
if (!GetPlayers(true).contains(p))
return;
GetKit(p).ApplyKit(p);
p.playSound(p.getLocation(), Sound.LEVEL_UP, 1f, 1f);
}
@Override
public String GetMode()
{
return "Smash Gladiators";
}
}

View File

@ -4,6 +4,15 @@ import mineplex.core.common.util.*;
import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilEvent.ActionType;
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.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo; import mineplex.core.packethandler.PacketInfo;
@ -311,13 +320,14 @@ public class HideSeek extends TeamGame
{ {
if (event.GetState() == GameState.Prepare) if (event.GetState() == GameState.Prepare)
{ {
System.out.println("prep");
this.getArcadeManager().getPacketHandler().addPacketHandler(_blockDisguise, PacketPlayOutSpawnEntityLiving.class, PacketPlayOutEntityDestroy.class); this.getArcadeManager().getPacketHandler().addPacketHandler(_blockDisguise, PacketPlayOutSpawnEntityLiving.class, PacketPlayOutEntityDestroy.class);
this.getArcadeManager().getPacketHandler().addPacketHandler(_useEntity, true, PacketPlayInUseEntity.class); this.getArcadeManager().getPacketHandler().addPacketHandler(_useEntity, true, PacketPlayInUseEntity.class);
} }
else if (event.GetState() == GameState.Dead) else if (event.GetState() == GameState.Dead)
{ {
this.getArcadeManager().getPacketHandler().removePacketHandler(_blockDisguise); this.getArcadeManager().getPacketHandler().removePacketHandler(_blockDisguise);
this.getArcadeManager().getPacketHandler().removePacketHandler(_useEntity); this.getArcadeManager().getPacketHandler().removePacketHandler(_useEntity);
} }
} }

View File

@ -28,40 +28,6 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
//<<<<<<< HEAD
//import nautilus.game.arcade.world.WorldData;
//import net.minecraft.server.v1_7_R4.DataWatcher;
//import net.minecraft.server.v1_7_R4.Packet;
//import net.minecraft.server.v1_7_R4.PacketPlayOutAttachEntity;
//import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
//import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove;
//import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity;
//import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
//=======
//import net.minecraft.server.v1_8_R3.DataWatcher;
//import net.minecraft.server.v1_8_R3.Packet;
//import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
//import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
//import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove;
//import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
//import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity;
//import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
//>>>>>>> 6983af944fff04c5910f789266ae46b9eca4cc8d
//
//import org.bukkit.Bukkit;
//import org.bukkit.Location;
//import org.bukkit.Material;
//<<<<<<< HEAD
//import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
//import org.bukkit.entity.Entity;
//=======
//import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
//>>>>>>> 6983af944fff04c5910f789266ae46b9eca4cc8d
//import org.bukkit.entity.EntityType;
//import org.bukkit.entity.Player;
//import org.bukkit.util.Vector;
//
//import sun.security.krb5.internal.HostAddress;
public class Wall public class Wall
{ {

View File

@ -30,6 +30,19 @@ public class Micro extends TeamGame
private ArrayList<Block> _blocks = new ArrayList<Block>(); private ArrayList<Block> _blocks = new ArrayList<Block>();
private ArrayList<Block> _glass = new ArrayList<Block>(); private ArrayList<Block> _glass = new ArrayList<Block>();
public Micro(ArcadeManager manager, GameType type)
{
this(manager,
new Kit[]
{
new KitArcher(manager),
new KitWorker(manager),
new KitFighter(manager)
},
GameType.Micro);
}
public Micro(ArcadeManager manager, Kit[] kits, GameType type) public Micro(ArcadeManager manager, Kit[] kits, GameType type)
{ {
super(manager, type, kits, super(manager, type, kits,
@ -54,16 +67,8 @@ public class Micro extends TeamGame
public Micro(ArcadeManager manager) public Micro(ArcadeManager manager)
{ {
this(manager, this(manager, GameType.Micro);
new Kit[]
{
new KitArcher(manager),
new KitWorker(manager),
new KitFighter(manager)
},
GameType.Micro);
registerStatTrackers( registerStatTrackers(
new KillsWithinGameStatTracker(this, 8, "Annihilation") new KillsWithinGameStatTracker(this, 8, "Annihilation")
); );

View File

@ -0,0 +1,55 @@
package nautilus.game.arcade.game.games.micro.modes;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.games.micro.Micro;
/**
* CookieFight
*
* @author xXVevzZXx
*/
public class CookieFight extends Micro
{
private int _enchantmentLevel;
public CookieFight(ArcadeManager manager)
{
super(manager, GameType.Brawl);
_enchantmentLevel = 250;
}
@EventHandler
public void cookie(GameStateChangeEvent event)
{
if (event.GetState() != GameState.Live)
return;
for (Player player : GetPlayers(true))
{
ItemStack item = new ItemStack(Material.COOKIE);
item.addUnsafeEnchantment(Enchantment.KNOCKBACK, _enchantmentLevel);
player.getInventory().addItem(item);
UtilPlayer.message(player, F.main("Game", "Oh look, you got a Cookie!"));
}
}
@Override
public String GetMode()
{
return "Cookie Fight";
}
}

View File

@ -0,0 +1,38 @@
package nautilus.game.arcade.game.games.micro.modes;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.AbsorptionFix;
import nautilus.game.arcade.game.games.micro.Micro;
import nautilus.game.arcade.game.games.micro.modes.kits.KitOverlord;
import nautilus.game.arcade.kit.Kit;
/**
* OPMicroBattles
*
* @author xXVevzZXx
*/
public class OverpoweredMicroBattles extends Micro
{
public OverpoweredMicroBattles(ArcadeManager manager)
{
super(manager,
new Kit[]
{
new KitOverlord(manager)
},
GameType.Brawl);
TeamArmor = false;
new AbsorptionFix(this);
}
@Override
public String GetMode()
{
return "OP Micro Battles";
}
}

View File

@ -0,0 +1,96 @@
package nautilus.game.arcade.game.games.micro.modes;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.micro.Micro;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze;
import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem;
import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube;
import nautilus.game.arcade.game.games.smash.kits.KitPig;
import nautilus.game.arcade.game.games.smash.kits.KitSheep;
import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse;
import nautilus.game.arcade.game.games.smash.kits.KitSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitSkySquid;
import nautilus.game.arcade.game.games.smash.kits.KitSlime;
import nautilus.game.arcade.game.games.smash.kits.KitSnowman;
import nautilus.game.arcade.game.games.smash.kits.KitSpider;
import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.kit.Kit;
/**
* TinySmash
*
* @author xXVevzZXx
*/
public class TinySmash extends Micro
{
public TinySmash(ArcadeManager manager)
{
super(manager, new Kit[]
{
new KitSkeleton(manager),
new KitGolem(manager),
new KitSpider(manager),
new KitSlime(manager),
new KitCreeper(manager),
new KitEnderman(manager),
new KitSnowman(manager),
new KitWolf(manager),
new KitBlaze(manager),
new KitWitch(manager),
new KitChicken(manager),
new KitSkeletalHorse(manager),
new KitPig(manager),
new KitSkySquid(manager),
new KitWitherSkeleton(manager),
new KitMagmaCube(manager),
new KitZombie(manager),
new KitCow(manager),
new KitSheep(manager)
}, GameType.Brawl);
}
@EventHandler(priority = EventPriority.LOWEST)
public void noFallDamage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() == DamageCause.FALL)
event.SetCancelled("No Fall Damage");
}
@EventHandler(priority = EventPriority.HIGH)
public void customKnockback(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetDamageePlayer() != null)
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
}
@Override
public String GetMode()
{
return "Tiny Smash";
}
}

View File

@ -0,0 +1,49 @@
package nautilus.game.arcade.game.games.micro.modes.kits;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.ProgressingKit;
import nautilus.game.arcade.kit.perks.PerkFletcher;
public class KitOverlord extends ProgressingKit
{
private static final String[] DESCRIPTION = {
"You tell me I'm OP?!",
};
private static final Perk[] PERKS = {
new PerkFletcher(3, 16, true)
};
private static final ItemStack IN_HAND = new ItemStack(Material.GOLDEN_APPLE);
private static final ItemStack[] PLAYER_ITEMS = {
ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD),
ItemStackFactory.Instance.CreateStack(Material.DIAMOND_PICKAXE),
ItemStackFactory.Instance.CreateStack(Material.BOW),
ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE, 5)
};
public KitOverlord(ArcadeManager manager)
{
super(manager, "Overlord", "microoverlord", KitAvailability.Free, DESCRIPTION, PERKS, EntityType.ZOMBIE, IN_HAND);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(PLAYER_ITEMS);
player.getInventory().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
player.getInventory().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
player.getInventory().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
}
}

View File

@ -0,0 +1,59 @@
package nautilus.game.arcade.game.games.minestrike;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.game.games.minestrike.data.Bullet;
public class CustomGunDamageEvent extends PlayerEvent
{
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList()
{
return handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
private Bullet _bullet;
private final boolean _headshot;
private CustomDamageEvent _damageEvent;
private GunModule _game;
public CustomGunDamageEvent(Bullet _bullet, Player _target, boolean _headshot, CustomDamageEvent _damageEvent, GunModule game)
{
super(_target);
this._bullet = _bullet;
this._headshot = _headshot;
this._damageEvent = _damageEvent;
this._game = game;
}
public Bullet getBullet()
{
return _bullet;
}
public boolean isHeadshot()
{
return _headshot;
}
public CustomDamageEvent getDamageEvent()
{
return _damageEvent;
}
public GunModule getGame()
{
return _game;
}
}

View File

@ -0,0 +1,35 @@
package nautilus.game.arcade.game.games.minestrike;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
public class PlayerHeadshotEvent extends PlayerEvent
{
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList()
{
return handlers;
}
@Override
public HandlerList getHandlers()
{
return getHandlerList();
}
private final Player _shooter;
public PlayerHeadshotEvent(Player who, Player shooter)
{
super(who);
_shooter = shooter;
}
public Player getShooter()
{
return _shooter;
}
}

View File

@ -35,15 +35,15 @@ import org.bukkit.event.inventory.InventoryClickEvent;
public class ShopManager public class ShopManager
{ {
private MineStrike Host; private Minestrike Host;
private HashMap<Player, HashMap<Integer, StrikeItem>> _shop = new HashMap<Player, HashMap<Integer, StrikeItem>>(); private HashMap<Player, HashMap<Integer, StrikeItem>> _shop = new HashMap<Player, HashMap<Integer, StrikeItem>>();
private HashMap<Player, Integer> _money = new HashMap<Player, Integer>(); private HashMap<Player, Integer> _money = new HashMap<Player, Integer>();
private HashSet<Player> _inShop = new HashSet<Player>(); private HashSet<Player> _inShop = new HashSet<Player>();
public ShopManager(MineStrike host) public ShopManager(Minestrike minestrike)
{ {
Host = host; Host = minestrike;
} }
public void enterShop(Player player) public void enterShop(Player player)
@ -60,27 +60,27 @@ public class ShopManager
//Pistols //Pistols
slot = 9; slot = 9;
addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.GLOCK_18) : new Gun(GunStats.P2000), player, slot++); addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.GLOCK_18, Host.getGunModule()) : new Gun(GunStats.P2000, Host.getGunModule()), player, slot++);
addItem(new Gun(GunStats.P250), player, slot++); addItem(new Gun(GunStats.P250, Host.getGunModule()), player, slot++);
addItem(new Gun(GunStats.CZ75), player, slot++); addItem(new Gun(GunStats.CZ75, Host.getGunModule()), player, slot++);
addItem(new Gun(GunStats.DEAGLE), player, slot++); addItem(new Gun(GunStats.DEAGLE, Host.getGunModule()), player, slot++);
//Shotgun //Shotgun
slot = 18; slot = 18;
addItem(new Shotgun(GunStats.NOVA), player, slot++); addItem(new Shotgun(GunStats.NOVA, Host.getGunModule()), player, slot++);
addItem(new Shotgun(GunStats.XM1014), player, slot++); addItem(new Shotgun(GunStats.XM1014, Host.getGunModule()), player, slot++);
//SMG //SMG
addItem(new Gun(GunStats.PPBIZON), player, slot++); addItem(new Gun(GunStats.PPBIZON, Host.getGunModule()), player, slot++);
addItem(new Gun(GunStats.P90), player, slot++); addItem(new Gun(GunStats.P90, Host.getGunModule()), player, slot++);
//Rifles //Rifles
slot = 27; slot = 27;
addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.GALIL) : new Gun(GunStats.FAMAS), player, slot++); addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.GALIL, Host.getGunModule()) : new Gun(GunStats.FAMAS, Host.getGunModule()), player, slot++);
addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.AK47) : new Gun(GunStats.M4A4), player, slot++); addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.AK47, Host.getGunModule()) : new Gun(GunStats.M4A4, Host.getGunModule()), player, slot++);
addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.SG553) : new Gun(GunStats.AUG), player, slot++); addItem(team.GetColor() == ChatColor.RED ? new Gun(GunStats.SG553, Host.getGunModule()) : new Gun(GunStats.AUG, Host.getGunModule()), player, slot++);
addItem(new Gun(GunStats.SSG08), player, slot++); addItem(new Gun(GunStats.SSG08, Host.getGunModule()), player, slot++);
addItem(new Gun(GunStats.AWP), player, slot++); addItem(new Gun(GunStats.AWP, Host.getGunModule()), player, slot++);
//Grenades //Grenades
addItem(new FlashBang(), player, 14); addItem(new FlashBang(), player, 14);
@ -203,10 +203,11 @@ public class ShopManager
if (item == null) if (item == null)
return; return;
if (hasItem(player, item)) if (hasItem(player, item))
return; return;
if (getMoney(player) < item.getCost()) if (getMoney(player) < item.getCost())
{ {
player.playSound(player.getLocation(), Sound.NOTE_BASS, 1f, 1f); player.playSound(player.getLocation(), Sound.NOTE_BASS, 1f, 1f);
@ -217,11 +218,11 @@ public class ShopManager
if (item instanceof Gun) if (item instanceof Gun)
{ {
Gun gun = (Gun)item; Gun gun = (Gun)item;
Host.dropSlotItem(player, gun.getSlot()); Host.getGunModule().dropSlotItem(player, gun.getSlot());
gun.giveToPlayer(player, true); gun.giveToPlayer(player, true);
gun.updateWeaponName(player, Host); gun.updateWeaponName(player, Host.getGunModule());
gun.updateSkin(player, Host.getArcadeManager().getCosmeticManager().getGadgetManager()); gun.updateSkin(player, Host.getArcadeManager().getCosmeticManager().getGadgetManager());
Host.registerGun(gun, player); Host.getGunModule().registerGun(gun, player);
} }
//Grenade //Grenade
@ -235,7 +236,7 @@ public class ShopManager
return; return;
} }
Host.registerGrenade(grenade, player); Host.getGunModule().registerGrenade(grenade, player);
} }
//Use 250 instead of 255, to show that its kevlar/helmet //Use 250 instead of 255, to show that its kevlar/helmet

View File

@ -2,7 +2,7 @@ package nautilus.game.arcade.game.games.minestrike.data;
import java.util.HashSet; import java.util.HashSet;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun; import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
import org.bukkit.Location; import org.bukkit.Location;
@ -25,7 +25,7 @@ public class Bullet
public HashSet<Player> WhizzSound = new HashSet<Player>(); public HashSet<Player> WhizzSound = new HashSet<Player>();
public Bullet(Entity bullet, Gun gun, Player shooter, MineStrike game) public Bullet(Entity bullet, Gun gun, Player shooter, GunModule game)
{ {
Bullet = bullet; Bullet = bullet;
Gun = gun; Gun = gun;

View File

@ -1,6 +1,7 @@
package nautilus.game.arcade.game.games.minestrike.items; package nautilus.game.arcade.game.games.minestrike.items;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -17,9 +18,10 @@ import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction; 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.UtilMath;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
import nautilus.game.arcade.game.games.minestrike.items.grenades.Grenade; import nautilus.game.arcade.game.games.minestrike.items.grenades.Grenade;
import nautilus.game.arcade.game.games.minestrike.items.guns.Gun; import nautilus.game.arcade.game.games.minestrike.items.guns.Gun;
@ -36,6 +38,8 @@ public abstract class StrikeItem
private String _ownerName; private String _ownerName;
private ItemStack _stack = null; private ItemStack _stack = null;
private int _identifier;
public StrikeItem(StrikeItemType type, String name, String[] desc, int cost, int gemCost, Material skin) public StrikeItem(StrikeItemType type, String name, String[] desc, int cost, int gemCost, Material skin)
{ {
@ -48,6 +52,11 @@ public abstract class StrikeItem
//Make Stack //Make Stack
_stack = new ItemStack(skin); _stack = new ItemStack(skin);
_identifier = UtilMath.r(9000) + 1000;
addID();
fixStackName(); fixStackName();
} }
@ -86,12 +95,20 @@ public abstract class StrikeItem
return _skinData; return _skinData;
} }
public void addID()
{
ItemMeta meta = _stack.getItemMeta();
meta.setLore(Arrays.asList(ChatColor.RED + "" + ChatColor.BOLD + "Identifier: " + _identifier));
_stack.setItemMeta(meta);
}
public void setSkin(Material skinMaterial, byte skinData) public void setSkin(Material skinMaterial, byte skinData)
{ {
_skinMaterial = skinMaterial; _skinMaterial = skinMaterial;
_skinData = skinData; _skinData = skinData;
_stack = new ItemStack(skinMaterial, 1, (short) 0, skinData); _stack = new ItemStack(skinMaterial, 1, (short) 0, skinData);
addID();
} }
public String getOwnerName() public String getOwnerName()
@ -104,7 +121,7 @@ public abstract class StrikeItem
_ownerName = ownerName; _ownerName = ownerName;
} }
public void drop(MineStrike game, Player player, boolean natural, boolean onlyDeregisterAndRemove) public void drop(GunModule game, Player player, boolean natural, boolean onlyDeregisterAndRemove)
{ {
_stack.setAmount(1); _stack.setAmount(1);
@ -160,6 +177,22 @@ public abstract class StrikeItem
public boolean isStack(ItemStack stack) public boolean isStack(ItemStack stack)
{ {
if (stack.hasItemMeta())
{
if (stack.getItemMeta().hasLore())
{
if (getStack().hasItemMeta())
{
if (getStack().getItemMeta().hasLore())
{
if (UtilGear.isMat(stack, _skinMaterial))
return stack.getItemMeta().getLore().get(0).equalsIgnoreCase(getStack().getItemMeta().getLore().get(0));
else
return false;
}
}
}
}
return UtilGear.isMat(stack, _skinMaterial); return UtilGear.isMat(stack, _skinMaterial);
} }
@ -184,7 +217,7 @@ public abstract class StrikeItem
_stack.setItemMeta(meta); _stack.setItemMeta(meta);
} }
public abstract boolean pickup(MineStrike game, Player player); public abstract boolean pickup(GunModule game, Player player);
public ItemStack getShopItem(int money, boolean alreadyHas) public ItemStack getShopItem(int money, boolean alreadyHas)
{ {

View File

@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
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.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
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;
@ -24,7 +24,7 @@ public class DefusalKit extends StrikeItem
} }
@Override @Override
public boolean pickup(MineStrike game, Player player) public boolean pickup(GunModule game, Player player)
{ {
return false; return false;
} }

View File

@ -11,7 +11,7 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
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.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
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;
@ -23,7 +23,7 @@ public class Armor extends StrikeItem
} }
@Override @Override
public boolean pickup(MineStrike game, Player player) public boolean pickup(GunModule game, Player player)
{ {
return false; return false;
} }

View File

@ -2,16 +2,6 @@ package nautilus.game.arcade.game.games.minestrike.items.grenades;
import java.util.HashMap; import java.util.HashMap;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.minestrike.MineStrike;
import nautilus.game.arcade.game.games.minestrike.Radio;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -21,6 +11,15 @@ 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;
import mineplex.core.common.util.UtilBlock;
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.UtilServer;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.minestrike.GunModule;
import nautilus.game.arcade.game.games.minestrike.Radio;
public abstract class FireGrenadeBase extends Grenade public abstract class FireGrenadeBase extends Grenade
{ {
private long _baseTime; private long _baseTime;
@ -37,7 +36,7 @@ public abstract class FireGrenadeBase extends Grenade
} }
@Override @Override
public boolean updateCustom(MineStrike game, Entity ent) public boolean updateCustom(GunModule game, Entity ent)
{ {
// Fixed grenade effect not being activated when thrown in the ground. // Fixed grenade effect not being activated when thrown in the ground.
// Looks like ent.isOnGround() worked, while we previously used UtilEnt.isGrounded(ent). // Looks like ent.isOnGround() worked, while we previously used UtilEnt.isGrounded(ent).
@ -52,7 +51,7 @@ public abstract class FireGrenadeBase extends Grenade
return false; return false;
} }
private void createFire(final MineStrike game, final Location loc) private void createFire(final GunModule game, final Location loc)
{ {
//Sound //Sound
loc.getWorld().playSound(loc, Sound.IRONGOLEM_THROW, 1f, 1f); loc.getWorld().playSound(loc, Sound.IRONGOLEM_THROW, 1f, 1f);
@ -114,9 +113,9 @@ public abstract class FireGrenadeBase extends Grenade
} }
@Override @Override
public void playSound(MineStrike game, Player player) public void playSound(GunModule game, Player player)
{ {
GameTeam team = game.GetTeam(player); GameTeam team = game.getHost().GetTeam(player);
if (team == null) if (team == null)
return; return;

View File

@ -9,7 +9,7 @@ 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 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.GunModule;
import nautilus.game.arcade.game.games.minestrike.Radio; import nautilus.game.arcade.game.games.minestrike.Radio;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -33,7 +33,7 @@ public class FlashBang extends Grenade
} }
@Override @Override
public boolean updateCustom(MineStrike game, Entity ent) public boolean updateCustom(GunModule game, Entity ent)
{ {
if (UtilTime.elapsed(_throwTime, 2000)) if (UtilTime.elapsed(_throwTime, 2000))
{ {
@ -43,7 +43,7 @@ public class FlashBang extends Grenade
HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 48); HashMap<Player, Double> players = UtilPlayer.getInRadius(ent.getLocation(), 48);
for (Player player : players.keySet()) for (Player player : players.keySet())
{ {
if (!game.IsAlive(player)) if (!game.getHost().IsAlive(player))
continue; continue;
//Line of Sight //Line of Sight
@ -83,9 +83,9 @@ public class FlashBang extends Grenade
} }
@Override @Override
public void playSound(MineStrike game, Player player) public void playSound(GunModule game, Player player)
{ {
GameTeam team = game.GetTeam(player); GameTeam team = game.getHost().GetTeam(player);
if (team == null) if (team == null)
return; return;

View File

@ -11,6 +11,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
@ -20,7 +21,7 @@ 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 mineplex.core.common.util.UtilTime;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
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;
@ -132,9 +133,20 @@ public abstract class Grenade extends StrikeItem
return true; return true;
} }
public void throwGrenade(Player player, boolean wasLeftClick, MineStrike game) public void throwGrenade(Player player, boolean wasLeftClick, GunModule game)
{ {
player.setItemInHand(null);
if (player.getItemInHand().getAmount() < 2)
{
player.setItemInHand(null);
}
else
{
int amount = player.getItemInHand().getAmount();
ItemStack stack = getStack();
stack.setAmount(amount - 1);
player.setItemInHand(stack);
}
_thrower = player; _thrower = player;
@ -151,9 +163,13 @@ public abstract class Grenade extends StrikeItem
_lastLoc = ent.getLocation(); _lastLoc = ent.getLocation();
UtilPlayer.message(player, F.main("Game", "You threw " + getName() + ".")); UtilPlayer.message(player, F.main("Game", "You threw " + getName() + "."));
game.registerThrownGrenade(ent, this); game.registerThrownGrenade(ent, this);
game.deregisterGrenade(this);
if (player.getItemInHand().getAmount() < 2)
{
game.deregisterGrenade(this);
}
//Sound //Sound
playSound(game, player); playSound(game, player);
@ -161,7 +177,7 @@ public abstract class Grenade extends StrikeItem
_throwTime = System.currentTimeMillis(); _throwTime = System.currentTimeMillis();
} }
public boolean update(MineStrike game, Entity ent) public boolean update(GunModule game, Entity ent)
{ {
if (UtilTime.elapsed(_throwTime, 20000)) if (UtilTime.elapsed(_throwTime, 20000))
return true; return true;
@ -233,10 +249,10 @@ public abstract class Grenade extends StrikeItem
_lastLoc = ent.getLocation(); _lastLoc = ent.getLocation();
} }
public abstract boolean updateCustom(MineStrike game, Entity ent); public abstract boolean updateCustom(GunModule game, Entity ent);
@Override @Override
public boolean pickup(MineStrike game, Player player) public boolean pickup(GunModule game, Player player)
{ {
if (giveToPlayer(player, false)) if (giveToPlayer(player, false))
{ {
@ -255,5 +271,5 @@ public abstract class Grenade extends StrikeItem
return C.cDGreen + C.Bold + "Grenade" + ChatColor.RESET; return C.cDGreen + C.Bold + "Grenade" + ChatColor.RESET;
} }
public abstract void playSound(MineStrike game, Player player); public abstract void playSound(GunModule game, Player player);
} }

View File

@ -11,7 +11,7 @@ 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;
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.GunModule;
import nautilus.game.arcade.game.games.minestrike.Radio; import nautilus.game.arcade.game.games.minestrike.Radio;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -34,7 +34,7 @@ public class HighExplosive extends Grenade
} }
@Override @Override
public boolean updateCustom(MineStrike game, Entity ent) public boolean updateCustom(GunModule game, Entity ent)
{ {
if (UtilTime.elapsed(_throwTime, 2000)) if (UtilTime.elapsed(_throwTime, 2000))
{ {
@ -48,12 +48,12 @@ public class HighExplosive extends Grenade
List<Player> damagedPlayers = new ArrayList<>(); List<Player> damagedPlayers = new ArrayList<>();
for (Player player : players.keySet()) for (Player player : players.keySet())
{ {
if (!game.IsAlive(player)) if (!game.getHost().IsAlive(player))
continue; continue;
// Damage Event // Damage Event
Player damager = null; Player damager = null;
if (game.IsAlive(_thrower)) if (game.getHost().IsAlive(_thrower))
{ {
damager = _thrower; damager = _thrower;
} }
@ -74,9 +74,9 @@ public class HighExplosive extends Grenade
} }
@Override @Override
public void playSound(MineStrike game, Player player) public void playSound(GunModule game, Player player)
{ {
GameTeam team = game.GetTeam(player); GameTeam team = game.getHost().GetTeam(player);
if (team == null) if (team == null)
return; return;

View File

@ -10,7 +10,7 @@ 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;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
import nautilus.game.arcade.game.games.minestrike.Radio; import nautilus.game.arcade.game.games.minestrike.Radio;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -36,7 +36,7 @@ public class Smoke extends Grenade
} }
@Override @Override
public boolean updateCustom(final MineStrike game, Entity ent) public boolean updateCustom(final GunModule game, Entity ent)
{ {
if (UtilTime.elapsed(_throwTime, 2000) && (UtilEnt.isGrounded(ent) || !ent.isValid())) if (UtilTime.elapsed(_throwTime, 2000) && (UtilEnt.isGrounded(ent) || !ent.isValid()))
{ {
@ -95,9 +95,9 @@ public class Smoke extends Grenade
} }
@Override @Override
public void playSound(MineStrike game, Player player) public void playSound(GunModule game, Player player)
{ {
GameTeam team = game.GetTeam(player); GameTeam team = game.getHost().GetTeam(player);
if (team == null) if (team == null)
return; return;

View File

@ -1,5 +1,6 @@
package nautilus.game.arcade.game.games.minestrike.items.guns; package nautilus.game.arcade.game.games.minestrike.items.guns;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -32,10 +33,11 @@ import mineplex.core.common.util.UtilTime;
import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType; import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.GameModifierMineStrikeSkin; import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.GameModifierMineStrikeSkin;
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import mineplex.core.recharge.RechargedEvent; import mineplex.core.recharge.RechargedEvent;
import mineplex.core.stats.PlayerStats; import mineplex.core.stats.PlayerStats;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
import nautilus.game.arcade.game.games.minestrike.data.Bullet; import nautilus.game.arcade.game.games.minestrike.data.Bullet;
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;
@ -59,11 +61,15 @@ public class Gun extends StrikeItem
protected int _kills = -1; protected int _kills = -1;
protected String _activeSkinName = "Default"; protected String _activeSkinName = "Default";
protected GunModule _module;
public Gun(GunStats gunStats) public Gun(GunStats gunStats, GunModule module)
{ {
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());
_module = module;
_gunStats = gunStats; _gunStats = gunStats;
if (gunStats.getItemType() == StrikeItemType.PRIMARY_WEAPON) if (gunStats.getItemType() == StrikeItemType.PRIMARY_WEAPON)
@ -75,11 +81,11 @@ public class Gun extends StrikeItem
_loadedAmmo = gunStats.getClipSize(); _loadedAmmo = gunStats.getClipSize();
_reserveAmmo = gunStats.getClipReserve() * gunStats.getClipSize(); _reserveAmmo = gunStats.getClipReserve() * gunStats.getClipSize();
updateWeaponName(null, null); updateWeaponName(null, null);
} }
public void shoot(final Player player, final MineStrike game) public void shoot(final Player player, final GunModule game)
{ {
if (_reloading) if (_reloading)
return; return;
@ -94,7 +100,7 @@ public class Gun extends StrikeItem
{ {
public void run() public void run()
{ {
if (game.IsAlive(player)) if (game.getHost().IsAlive(player))
shootOnce(player, game); shootOnce(player, game);
} }
}, 2); }, 2);
@ -109,7 +115,7 @@ public class Gun extends StrikeItem
{ {
public void run() public void run()
{ {
if (game.IsAlive(player)) if (game.getHost().IsAlive(player))
shootOnce(player, game); shootOnce(player, game);
} }
}, i); }, i);
@ -117,7 +123,7 @@ public class Gun extends StrikeItem
} }
} }
public void shootOnce(Player player, MineStrike game) public void shootOnce(Player player, GunModule game)
{ {
if (_reloading) if (_reloading)
return; return;
@ -167,7 +173,7 @@ public class Gun extends StrikeItem
reload(player); reload(player);
} }
public Bullet fireBullet(Player player, MineStrike game) public Bullet fireBullet(Player player, GunModule game)
{ {
//Instant? //Instant?
boolean instant = game.getBulletType() == 1 || (game.getBulletType() == 2 && _gunStats.getGunType() == GunType.SNIPER); boolean instant = game.getBulletType() == 1 || (game.getBulletType() == 2 && _gunStats.getGunType() == GunType.SNIPER);
@ -186,7 +192,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.multiply(_module.CONE);
cof.add(player.getLocation().getDirection()); cof.add(player.getLocation().getDirection());
cof.normalize(); cof.normalize();
@ -307,12 +313,12 @@ public class Gun extends StrikeItem
public void displayAmmo(Player player) public void displayAmmo(Player player)
{ {
if (!UtilGear.isMat(player.getItemInHand(), getStack().getType())) if (_module.getGunInHand(player, null) != this)
return; return;
//Weapon Bob during reload //Weapon Bob during reload
if (_reloading) if (_reloading)
updateWeaponName(player, null); updateWeaponName(player, null, false);
if (!Recharge.Instance.usable(player, getName() + " Reload")) if (!Recharge.Instance.usable(player, getName() + " Reload"))
return; return;
@ -323,7 +329,7 @@ public class Gun extends StrikeItem
UtilTextBottom.display(C.cRed + "No Ammo", player); UtilTextBottom.display(C.cRed + "No Ammo", player);
} }
public void updateWeaponName(Player player, MineStrike game) public void updateWeaponName(Player player, GunModule game, boolean setItem)
{ {
if(game != null) if(game != null)
{ {
@ -331,24 +337,24 @@ public class Gun extends StrikeItem
{ {
new BukkitRunnable() { new BukkitRunnable() {
public void run() { public void run() {
PlayerStats remoteStats = game.getArcadeManager().GetStatsManager().Get(player); PlayerStats remoteStats = game.getHost().getArcadeManager().GetStatsManager().Get(player);;
_kills = (int) remoteStats.getStat(game.GetName() + "." + getStatNameKills(true)); _kills = (int) remoteStats.getStat(game.getHost().GetName() + "." + getStatNameKills(true));
Player owner = UtilPlayer.searchExact(getOwnerName()); Player owner = UtilPlayer.searchExact(getOwnerName());
if(owner != null) { if(owner != null) {
HashMap<String, Integer> localStatsMap = game.GetStats().get(owner); HashMap<String, Integer> localStatsMap = game.getHost().GetStats().get(owner);
if(localStatsMap != null) if(localStatsMap != null)
{ {
Integer kills = localStatsMap.get(game.GetName() + "." + getStatNameKills(true)); Integer kills = localStatsMap.get(game.getHost().GetName() + "." + getStatNameKills(true));
if(kills != null) if(kills != null)
{ {
_kills += kills.intValue(); _kills += kills.intValue();
} }
} }
} }
updateWeaponName(player, null); updateWeaponName(player, null, setItem);
} }
}.runTaskAsynchronously(game.getArcadeManager().getPlugin()); }.runTaskAsynchronously(game.getHost().getArcadeManager().getPlugin());
} }
} }
int kls = _kills; int kls = _kills;
@ -368,11 +374,18 @@ public class Gun extends StrikeItem
if (player != null) if (player != null)
{ {
player.getInventory().setItem(_slot, getStack()); if (setItem)
player.getInventory().setItem(_slot, getStack());
_reloadTick = !_reloadTick; _reloadTick = !_reloadTick;
} }
} }
public void updateWeaponName(Player player, GunModule module)
{
updateWeaponName(player, module, true);
}
public void incrementKill() { public void incrementKill() {
_kills++; _kills++;
} }
@ -399,7 +412,7 @@ public class Gun extends StrikeItem
loc.getWorld().playSound(loc, Sound.PISTON_RETRACT, 1f, 0.8f); loc.getWorld().playSound(loc, Sound.PISTON_RETRACT, 1f, 0.8f);
} }
public void cancelReloadCheck(Player player, MineStrike game) public void cancelReloadCheck(Player player, GunModule game)
{ {
if (!_reloading) if (!_reloading)
return; return;
@ -457,6 +470,19 @@ public class Gun extends StrikeItem
owner.getInventory().setItem(_slot, getStack()); owner.getInventory().setItem(_slot, getStack());
} }
public void enableSkin()
{
MineStrikeSkin skin = null;
for (MineStrikeSkin otherSkin : MineStrikeSkin.values())
{
if (otherSkin.getWeaponName().equalsIgnoreCase(_gunStats.getName()))
skin = otherSkin;
}
setSkin(skin.getSkinMaterial(), skin.getSkinData());
_activeSkinName = skin.getSkinName();
}
public int getSlot() public int getSlot()
{ {
@ -492,7 +518,7 @@ public class Gun extends StrikeItem
} }
@Override @Override
public boolean pickup(MineStrike game, Player player) public boolean pickup(GunModule game, Player player)
{ {
if (player.getInventory().getItem(_slot) != null && player.getInventory().getItem(_slot).getType() != Material.AIR) if (player.getInventory().getItem(_slot) != null && player.getInventory().getItem(_slot).getType() != Material.AIR)
return false; return false;

View File

@ -1,12 +1,14 @@
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.GunModule;
public class GunFactory public class GunFactory
{ {
public Gun createGun(GunStats gun) public Gun createGun(GunStats gun, GunModule module)
{ {
if (gun.getGunType() == GunType.SHOTGUN) if (gun.getGunType() == GunType.SHOTGUN)
return new Shotgun(gun); return new Shotgun(gun, module);
return new Gun(gun); return new Gun(gun, module);
} }
} }

View File

@ -1,6 +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.GunModule;
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;
@ -375,7 +375,7 @@ public enum GunStats
public double getConeIncreaseRate() public double getConeIncreaseRate()
{ {
return _coneIncreaseRate * MineStrike.RECOIL; return _coneIncreaseRate * GunModule.RECOIL;
} }
public boolean getScope() public boolean getScope()

View File

@ -1,6 +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.GunModule;
public enum GunType public enum GunType
{ {
@ -40,17 +40,17 @@ public enum GunType
public double getMovePenalty() public double getMovePenalty()
{ {
return _movePenalty * MineStrike.MOVE_PENALTY; return _movePenalty * GunModule.MOVE_PENALTY;
} }
public double getSprintPenalty() public double getSprintPenalty()
{ {
return _sprintPentalty * MineStrike.MOVE_PENALTY; return _sprintPentalty * GunModule.MOVE_PENALTY;
} }
public double getJumpPenalty() public double getJumpPenalty()
{ {
return _jumpPenalty * MineStrike.MOVE_PENALTY; return _jumpPenalty * GunModule.MOVE_PENALTY;
} }
public float getVolume() public float getVolume()

View File

@ -5,7 +5,7 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.recharge.Recharge; import mineplex.core.recharge.Recharge;
import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.minestrike.GunModule;
import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType; import nautilus.game.arcade.game.games.minestrike.items.StrikeItemType;
import org.bukkit.Location; import org.bukkit.Location;
@ -18,15 +18,15 @@ public class Shotgun extends Gun
{ {
private int _pellets; private int _pellets;
public Shotgun(GunStats gunStats) public Shotgun(GunStats gunStats, GunModule module)
{ {
super(gunStats); super(gunStats, module);
_pellets = gunStats.getPellets(); _pellets = gunStats.getPellets();
} }
@Override @Override
public void shoot(Player player, MineStrike game) public void shoot(Player player, GunModule game)
{ {
if (_reloading) if (_reloading)
return; return;

View File

@ -59,6 +59,9 @@ public class EweHeroes extends SheepGame
{ {
if (event.getType() != UpdateType.FASTER) if (event.getType() != UpdateType.FASTER)
return; return;
if (!IsLive())
return;
for (Player player : GetPlayers(true)) for (Player player : GetPlayers(true))
{ {

View File

@ -0,0 +1,36 @@
package nautilus.game.arcade.game.games.sheep.modes;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.AbsorptionFix;
import nautilus.game.arcade.game.games.sheep.SheepGame;
import nautilus.game.arcade.game.games.sheep.modes.kits.KitShepherd;
import nautilus.game.arcade.kit.Kit;
/**
* OverpoweredSheepQuest
*
* @author xXVevzZXx
*/
public class OverpoweredSheepQuest extends SheepGame
{
public OverpoweredSheepQuest(ArcadeManager manager)
{
super(manager, new Kit[]
{
new KitShepherd(manager)
}, GameType.Brawl);
TeamArmor = false;
new AbsorptionFix(this);
}
@Override
public String GetMode()
{
return "OP Sheep Quest";
}
}

View File

@ -0,0 +1,116 @@
package nautilus.game.arcade.game.games.sheep.modes;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.sheep.SheepGame;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze;
import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem;
import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube;
import nautilus.game.arcade.game.games.smash.kits.KitPig;
import nautilus.game.arcade.game.games.smash.kits.KitSheep;
import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse;
import nautilus.game.arcade.game.games.smash.kits.KitSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitSkySquid;
import nautilus.game.arcade.game.games.smash.kits.KitSlime;
import nautilus.game.arcade.game.games.smash.kits.KitSnowman;
import nautilus.game.arcade.game.games.smash.kits.KitSpider;
import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.kit.Kit;
/**
* SheepSmash
*
* @author xXVevzZXx
*/
public class SmashSheep extends SheepGame
{
public SmashSheep(ArcadeManager manager)
{
super(manager, new Kit[]
{
new KitSkeleton(manager),
new KitGolem(manager),
new KitSpider(manager),
new KitSlime(manager),
new KitCreeper(manager),
new KitEnderman(manager),
new KitSnowman(manager),
new KitWolf(manager),
new KitBlaze(manager),
new KitWitch(manager),
new KitChicken(manager),
new KitSkeletalHorse(manager),
new KitPig(manager),
new KitSkySquid(manager),
new KitWitherSkeleton(manager),
new KitMagmaCube(manager),
new KitZombie(manager),
new KitCow(manager),
new KitSheep(manager)
}, GameType.Brawl);
}
@EventHandler
public void saddle(UpdateEvent event)
{
if (event.getType() != UpdateType.FASTER)
return;
if (!IsLive())
return;
for (Player player : GetPlayers(true))
{
player.getInventory().setItem(7, new ItemStack(Material.SADDLE));
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void noFallDamage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() == DamageCause.FALL)
event.SetCancelled("No Fall Damage");
}
@EventHandler(priority = EventPriority.HIGH)
public void customKnockback(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetDamageePlayer() != null)
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
}
@Override
public String GetMode()
{
return "Smash Sheep";
}
}

View File

@ -0,0 +1,65 @@
package nautilus.game.arcade.game.games.sheep.modes.kits;
import mineplex.core.common.util.C;
import mineplex.core.itemstack.ItemStackFactory;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.KitAvailability;
import nautilus.game.arcade.kit.Perk;
import nautilus.game.arcade.kit.ProgressingKit;
import nautilus.game.arcade.kit.perks.PerkDoubleJump;
import nautilus.game.arcade.kit.perks.PerkFletcher;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class KitShepherd extends ProgressingKit
{
private static final String[] DESCRIPTION = {
"Most skilled Shepherd from all over the World",
"",
C.cYellow + "Double tap " + C.cWhite + "your jump key to " + C.cGreen + "Double Jump"
};
private static final Perk[] PERKS = {
new PerkDoubleJump("Double Jump", 1.2, 1.2, true, 8000, true),
new PerkFletcher(4, 10, true)
};
private static final ItemStack IN_HAND = new ItemStack(Material.IRON_AXE);
private static final ItemStack[] PLAYER_ITEMS = {
ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD),
ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE, 2),
ItemStackFactory.Instance.CreateStack(Material.BOW),
ItemStackFactory.Instance.CreateStack(Material.SADDLE, (byte) 0, 1,
C.cYellow + C.Bold + "Hold This" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Grab/Hold Sheep")
};
public KitShepherd(ArcadeManager manager)
{
super(manager, "Shepherd of the gods", "sheepsheperd", KitAvailability.Free, DESCRIPTION, PERKS, EntityType.ZOMBIE, IN_HAND);
}
@Override
public void GiveItems(Player player)
{
player.getInventory().addItem(PLAYER_ITEMS);
player.getInventory().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
player.getInventory().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
player.getInventory().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
}
@Override
public void SpawnCustom(LivingEntity ent)
{
ent.getEquipment().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
ent.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
ent.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
ent.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
}
}

View File

@ -133,17 +133,22 @@ public abstract class Skywars extends Game
private ChestLoot _middleProjectile = new ChestLoot(); private ChestLoot _middleProjectile = new ChestLoot();
private ChestLoot _middleBlock = new ChestLoot(); private ChestLoot _middleBlock = new ChestLoot();
@SuppressWarnings("unchecked")
public Skywars(ArcadeManager manager, GameType type, String[] description) public Skywars(ArcadeManager manager, GameType type, String[] description)
{ {
super(manager, type, new Kit[] this(manager, new Kit[]
{ {
new KitChicken(manager), new KitChicken(manager),
new KitMiner(manager), new KitMiner(manager),
new KitMadScientist(manager), new KitMadScientist(manager),
new KitDestructor(manager), new KitDestructor(manager),
}, description); }, type, description);
}
@SuppressWarnings("unchecked")
public Skywars(ArcadeManager manager, Kit[] kits, GameType type, String[] description)
{
super(manager, type, kits, description);
PrepareFreeze = true; PrepareFreeze = true;

View File

@ -17,7 +17,7 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.stats.DeathBomberStatTracker; import nautilus.game.arcade.stats.DeathBomberStatTracker;
import nautilus.game.arcade.stats.SkywarsKillZombieStatTracker; import nautilus.game.arcade.stats.SkywarsKillZombieStatTracker;
import nautilus.game.arcade.stats.SkywarsTNTStatTracker; import nautilus.game.arcade.stats.SkywarsTNTStatTracker;
@ -61,25 +61,20 @@ public class SoloSkywars extends Skywars
"Last player alive wins!" "Last player alive wins!"
}); });
this.DamageTeamSelf = true; this.DamageTeamSelf = true;
}
registerStatTrackers(
new SkywarsTNTStatTracker(this), public SoloSkywars(ArcadeManager manager, Kit[] kits, GameType type)
new DeathBomberStatTracker(this, 3), //TNT Kills {
new SkywarsKillZombieStatTracker(this), super(manager, kits, type,
new WinWithoutOpeningChestStatTracker(this), new String[]
new WinWithoutWearingArmorStatTracker(this)); {
"Free for all battle in the sky!",
registerChatStats( "Craft or loot gear for combat",
Kills, "Last player alive wins!"
Deaths, });
KDRatio,
BlankLine,
Assists,
DamageTaken,
DamageDealt
);
this.DamageTeamSelf = true;
} }
@EventHandler @EventHandler

View File

@ -7,8 +7,14 @@ import org.bukkit.block.Block;
import org.bukkit.block.Chest; import org.bukkit.block.Chest;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilMath;
import mineplex.core.loot.ChestLoot; import mineplex.core.loot.ChestLoot;
import mineplex.core.loot.RandomItem; import mineplex.core.loot.RandomItem;

View File

@ -0,0 +1,121 @@
package nautilus.game.arcade.game.games.skywars.modes;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.recharge.Recharge;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.game.games.skywars.SoloSkywars;
import nautilus.game.arcade.game.games.smash.kits.KitBlaze;
import nautilus.game.arcade.game.games.smash.kits.KitChicken;
import nautilus.game.arcade.game.games.smash.kits.KitCow;
import nautilus.game.arcade.game.games.smash.kits.KitCreeper;
import nautilus.game.arcade.game.games.smash.kits.KitEnderman;
import nautilus.game.arcade.game.games.smash.kits.KitGolem;
import nautilus.game.arcade.game.games.smash.kits.KitMagmaCube;
import nautilus.game.arcade.game.games.smash.kits.KitPig;
import nautilus.game.arcade.game.games.smash.kits.KitSheep;
import nautilus.game.arcade.game.games.smash.kits.KitSkeletalHorse;
import nautilus.game.arcade.game.games.smash.kits.KitSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitSkySquid;
import nautilus.game.arcade.game.games.smash.kits.KitSlime;
import nautilus.game.arcade.game.games.smash.kits.KitSnowman;
import nautilus.game.arcade.game.games.smash.kits.KitSpider;
import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.kit.Kit;
/**
* SkySmash
*
* @author xXVevzZXx
*/
public class SkySmash extends SoloSkywars
{
public SkySmash(ArcadeManager manager)
{
super(manager, new Kit[]
{
new KitSkeleton(manager),
new KitGolem(manager),
new KitSpider(manager),
new KitSlime(manager),
new KitCreeper(manager),
new KitEnderman(manager),
new KitSnowman(manager),
new KitWolf(manager),
new KitBlaze(manager),
new KitWitch(manager),
new KitChicken(manager),
new KitSkeletalHorse(manager),
new KitPig(manager),
new KitSkySquid(manager),
new KitWitherSkeleton(manager),
new KitMagmaCube(manager),
new KitZombie(manager),
new KitCow(manager),
new KitSheep(manager)
}, GameType.Brawl);
}
@EventHandler(priority = EventPriority.LOWEST)
public void noFallDamage(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetCause() == DamageCause.FALL)
event.SetCancelled("No Fall Damage");
}
@EventHandler(priority = EventPriority.HIGH)
public void customKnockback(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
if (event.GetDamageePlayer() != null)
event.AddKnockback("Smash Knockback", 1 + 0.1 * (20 - event.GetDamageePlayer().getHealth()));
}
@EventHandler(priority = EventPriority.MONITOR)
public void hungerOnHit(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damager = event.GetDamagerPlayer(true);
if (damager == null)
return;
if (damager.equals(event.GetDamageeEntity()))
return;
if (!(event.GetDamageeEntity() instanceof Player))
return;
if (!Recharge.Instance.use(damager, "Hunger Restore", 250, false, false))
return;
int amount = Math.max(1, (int)(event.GetDamage()/2));
UtilPlayer.hunger(damager, amount);
}
@Override
public String GetMode()
{
return "Sky Smash";
}
}

View File

@ -31,7 +31,7 @@ import nautilus.game.arcade.game.games.smash.kits.KitWitch;
import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton; import nautilus.game.arcade.game.games.smash.kits.KitWitherSkeleton;
import nautilus.game.arcade.game.games.smash.kits.KitWolf; import nautilus.game.arcade.game.games.smash.kits.KitWolf;
import nautilus.game.arcade.game.games.smash.kits.KitZombie; import nautilus.game.arcade.game.games.smash.kits.KitZombie;
import nautilus.game.arcade.game.games.smash.modes.kits.KitPlayer; import nautilus.game.arcade.game.games.smash.modes.kits.KitHipster;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.Perk;
@ -49,7 +49,7 @@ public class RandomKitSSM extends SoloSuperSmash
public RandomKitSSM(ArcadeManager manager) public RandomKitSSM(ArcadeManager manager)
{ {
super(manager, new Kit[]{new KitPlayer(manager)}, GameType.Brawl); super(manager, new Kit[]{new KitHipster(manager)}, GameType.Brawl);
_maxLives = 5; _maxLives = 5;

View File

@ -16,10 +16,10 @@ import nautilus.game.arcade.kit.SmashKit;
* *
* @author xXVevzZXx * @author xXVevzZXx
*/ */
public class KitPlayer extends SmashKit public class KitHipster extends SmashKit
{ {
public KitPlayer(ArcadeManager manager) public KitHipster(ArcadeManager manager)
{ {
super(manager, "Hipster", KitAvailability.Free, 0, super(manager, "Hipster", KitAvailability.Free, 0,
new String[]{"Always get another kit!"}, new Perk[]{}, EntityType.ZOMBIE, new ItemStack(Material.RECORD_10), "Super", new String[]{"Always get another kit!"}, new Perk[]{}, EntityType.ZOMBIE, new ItemStack(Material.RECORD_10), "Super",

View File

@ -77,7 +77,6 @@ public class PerkCowAngryHerd extends SmashPerk
for (double i=-2 ; i<3 ; i++) for (double i=-2 ; i<3 ; i++)
{ {
Cow cow;
Vector dir = player.getLocation().getDirection(); Vector dir = player.getLocation().getDirection();
dir.setY(0); dir.setY(0);
dir.normalize(); dir.normalize();
@ -88,19 +87,11 @@ public class PerkCowAngryHerd extends SmashPerk
loc.add(UtilAlg.getLeft(dir).multiply(i*1.5)); loc.add(UtilAlg.getLeft(dir).multiply(i*1.5));
Manager.GetGame().CreatureAllowOverride = true; Manager.GetGame().CreatureAllowOverride = true;
if(isSuperActive(player))
{
cow = player.getWorld().spawn(loc, MushroomCow.class);
}
else
{
cow = player.getWorld().spawn(loc, Cow.class);
}
Class<? extends Cow> clazz = isSuperActive(player) ? MushroomCow.class : Cow.class; Class<? extends Cow> clazz = isSuperActive(player) ? MushroomCow.class : Cow.class;
Cow cow1 = player.getWorld().spawn(loc, clazz); Cow cow = player.getWorld().spawn(loc, clazz);
Manager.GetGame().CreatureAllowOverride = false; Manager.GetGame().CreatureAllowOverride = false;
_active.add(new DataCowCharge(player, cow1)); _active.add(new DataCowCharge(player, cow));
} }
//Sound //Sound

View File

@ -4,6 +4,10 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilTime.TimeUnit; import mineplex.core.common.util.UtilTime.TimeUnit;
@ -13,17 +17,13 @@ import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.Game.GameState; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.chat.ChatStatData; import nautilus.game.arcade.managers.chat.ChatStatData;
import nautilus.game.arcade.stats.FirstSupplyDropOpenStatTracker; import nautilus.game.arcade.stats.FirstSupplyDropOpenStatTracker;
import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker; import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker;
import nautilus.game.arcade.stats.SimultaneousSkeletonStatTracker; import nautilus.game.arcade.stats.SimultaneousSkeletonStatTracker;
import nautilus.game.arcade.stats.WinWithoutWearingArmorStatTracker; import nautilus.game.arcade.stats.WinWithoutWearingArmorStatTracker;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
public class SoloSurvivalGames extends SurvivalGames public class SoloSurvivalGames extends SurvivalGames
{ {
@ -66,6 +66,23 @@ public class SoloSurvivalGames extends SurvivalGames
this.DamageTeamSelf = true; this.DamageTeamSelf = true;
} }
public SoloSurvivalGames(ArcadeManager manager, Kit[] kits, GameType type)
{
super(manager, kits, type,
new String[]
{
"Search for chests to find loot",
"Slaughter your opponents",
"Stay away from the borders!",
"Last tribute alive wins!"
});
this.DamageTeamSelf = true;
}
@EventHandler @EventHandler
public void CustomTeamGeneration(GameStateChangeEvent event) public void CustomTeamGeneration(GameStateChangeEvent event)
{ {

View File

@ -145,35 +145,38 @@ public abstract class SurvivalGames extends Game
private int _chestRefillTime = 60 * 7; private int _chestRefillTime = 60 * 7;
public SurvivalGames(ArcadeManager manager, GameType type, public SurvivalGames(ArcadeManager manager, GameType type, String[] description)
{
this(manager, new Kit[]
{
new KitAxeman(manager),
// new KitLooter(manager),
new KitKnight(manager),
new KitArcher(manager),
new KitBrawler(manager),
new KitAssassin(manager),
new KitBeastmaster(manager),
new KitBomber(manager),
new KitNecromancer(manager),
new KitBarbarian(manager),
new KitHorseman(manager),
}, type, description);
}
public SurvivalGames(ArcadeManager manager, Kit[] kits, GameType type,
String[] description) String[] description)
{ {
super(manager, type, super(manager, type, kits, description);
new Kit[]
{
new KitAxeman(manager),
// new KitLooter(manager),
new KitKnight(manager),
new KitArcher(manager),
new KitBrawler(manager),
new KitAssassin(manager),
new KitBeastmaster(manager),
new KitBomber(manager),
new KitNecromancer(manager),
new KitBarbarian(manager),
new KitHorseman(manager),
}, description);
_help = new String[] _help = new String[]
{ {

Some files were not shown because too many files have changed in this diff Show More