From b84756ef7a1ba2ee9ae33cd4e998495328db2229 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 27 Mar 2015 22:13:50 +1300 Subject: [PATCH 01/43] Revert wizard commits --- .../mineplex/core/explosion/Explosion.java | 11 +-- .../game/core/explosion/CustomExplosion.java | 17 +--- .../game/games/wizards/SpellButton.java | 48 +++++----- .../game/games/wizards/SpellMenuPage.java | 10 +-- .../wizards/spells/SpellLightningStrike.java | 88 ++++++++----------- .../games/wizards/spells/SpellSpeedBoost.java | 16 ++-- .../wizards/spells/SpellSummonWolves.java | 9 +- 7 files changed, 76 insertions(+), 123 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java b/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java index b53fccd66..f07adb266 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/explosion/Explosion.java @@ -25,6 +25,7 @@ import org.bukkit.block.Block; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; @@ -302,11 +303,6 @@ public class Explosion extends MiniPlugin } public void BlockExplosion(Collection blockSet, Location mid, boolean onlyAbove) - { - BlockExplosion(blockSet, mid, onlyAbove, true); - } - - public void BlockExplosion(Collection blockSet, Location mid, boolean onlyAbove, boolean removeBlock) { if (blockSet.isEmpty()) return; @@ -324,10 +320,7 @@ public class Explosion extends MiniPlugin blocks.put(cur, new AbstractMap.SimpleEntry(cur.getTypeId(), cur.getData())); - if (removeBlock) - { - cur.setType(Material.AIR); - } + cur.setType(Material.AIR); } //DELAY diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java index 3465a1b65..181a230db 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java @@ -45,10 +45,8 @@ public class CustomExplosion extends Explosion private boolean _createFire; private boolean _ignoreRate = true; private float _blockExplosionSize; - private boolean _fallingBlockExplosion; - private mineplex.core.explosion.Explosion _explosion; - public CustomExplosion(DamageManager manager, mineplex.core.explosion.Explosion explosion, Location loc, float explosionSize, String deathCause) + public CustomExplosion(DamageManager manager, Location loc, float explosionSize, String deathCause) { super(((CraftWorld) loc.getWorld()).getHandle(), null, loc.getX(), loc.getY(), loc.getZ(), explosionSize); @@ -56,7 +54,6 @@ public class CustomExplosion extends Explosion _manager = manager; _damageReason = deathCause; _blockExplosionSize = explosionSize; - _explosion = explosion; } public CustomExplosion setBlockExplosionSize(float explosionSize) @@ -73,13 +70,6 @@ public class CustomExplosion extends Explosion return this; } - public CustomExplosion setFallingBlockExplosion(boolean fallingBlockExplosion) - { - _fallingBlockExplosion = fallingBlockExplosion; - - return this; - } - public CustomExplosion setDamageBlocks(boolean damageBlocks) { b = damageBlocks; @@ -292,11 +282,6 @@ public class CustomExplosion extends Explosion return; } - if (_fallingBlockExplosion) - { - _explosion.BlockExplosion(event.GetBlocks(), new Location(_world.getWorld(), posX, posY, posZ), false, false); - } - Iterator iterator = this.blocks.iterator(); while (iterator.hasNext()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java index e5a122a07..8069d6ddf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellButton.java @@ -10,39 +10,31 @@ import org.bukkit.event.inventory.ClickType; public class SpellButton implements IButton { - private SpellType _spell; - private SpellMenuPage _spellPage; + private SpellType _spell; + private SpellMenuPage _spellPage; - public SpellButton(SpellMenuPage spellPage, SpellType spell) - { - _spell = spell; - _spellPage = spellPage; - } + public SpellButton(SpellMenuPage spellPage, SpellType spell) + { + _spell = spell; + _spellPage = spellPage; + } - @Override - public void onClick(Player player, ClickType clickType) - { - Wizard wizard = _spellPage.getWizards().getWizard(player); + @Override + public void onClick(Player player, ClickType clickType) + { + Wizard wizard = _spellPage.getWizards().getWizard(player); - if (wizard != null) - { - if (clickType.isLeftClick()) - { - wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell); + if (wizard != null) + { + wizard.setSpell(player.getInventory().getHeldItemSlot(), _spell); - player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName()); + player.sendMessage(C.cBlue + "Set spell on wand to " + _spell.getElement().getColor() + _spell.getSpellName()); - player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1); - } - else - { - _spellPage.getWizards().castSpell(player, wizard, _spell, null); - } + player.playSound(player.getLocation(), Sound.ORB_PICKUP, 10, 1); - _spellPage.getWizards().drawUtilTextBottom(player); - _spellPage.getWizards().changeWandsTitles(player); - player.closeInventory(); - } - } + _spellPage.getWizards().drawUtilTextBottom(player); + _spellPage.getWizards().changeWandsTitles(player); + } + } } \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java index 1f824827b..a623eb102 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/SpellMenuPage.java @@ -73,14 +73,10 @@ public class SpellMenuPage extends ShopPageBase list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150); - if (list.size() > 1) - { - final Location loc = list.get(0).getLocation().add(0.5, 0, 0.5); + @Override + public void castSpell(Player p) + { + List list = p.getLastTwoTargetBlocks(UtilBlock.blockAirFoliageSet, 150); + if (list.size() > 1) + { + Location loc = list.get(0).getLocation(); - while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP))) - { - loc.add(0, 1, 0); - } + while (UtilBlock.solid(loc.getBlock().getRelative(BlockFace.UP))) + { + loc.add(0, 1, 0); + } - UtilParticle.PlayParticle(ParticleType.ANGRY_VILLAGER, loc.clone().add(0, 1.3, 0), 0.5F, 0.3F, 0.5F, 0, 7); + LightningStrike lightning = p.getWorld().strikeLightning(loc); - Bukkit.getScheduler().scheduleSyncDelayedTask(Wizards.getArcadeManager().getPlugin(), new Runnable() - { + lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p)); - @Override - public void run() - { - LightningStrike lightning = p.getWorld().strikeLightning(loc); + charge(p); + } + } - lightning.setMetadata("Damager", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), p)); - } + @EventHandler + public void onEntityDamage(EntityDamageByEntityEvent event) + { + if (event.getDamager() instanceof LightningStrike && event.getEntity() instanceof LivingEntity) + { + LightningStrike lightning = (LightningStrike) event.getDamager(); + if (lightning.hasMetadata("Damager")) + { + event.setCancelled(true); - }, 20); + if (!lightning.hasMetadata("IgnoreDamage")) + { + lightning.setMetadata("IgnoreDamage", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), null)); - charge(p); - } - } - - @EventHandler - public void onEntityDamage(EntityDamageByEntityEvent event) - { - if (event.getDamager() instanceof LightningStrike && event.getEntity() instanceof LivingEntity) - { - LightningStrike lightning = (LightningStrike) event.getDamager(); - if (lightning.hasMetadata("Damager")) - { - event.setCancelled(true); - - if (!lightning.hasMetadata("IgnoreDamage")) - { - lightning.setMetadata("IgnoreDamage", new FixedMetadataValue(Wizards.getArcadeManager().getPlugin(), null)); - - Wizards.getArcadeManager() - .GetDamage() - .NewDamageEvent((LivingEntity) event.getEntity(), - (Player) lightning.getMetadata("Damager").get(0).value(), null, DamageCause.LIGHTNING, - event.getDamage(), false, true, false, "Lightning Strike", "Lightning Strike"); - } - } - } - } + Wizards.getArcadeManager() + .GetDamage() + .NewDamageEvent((LivingEntity) event.getEntity(), + (Player) lightning.getMetadata("Damager").get(0).value(), null, DamageCause.LIGHTNING, + event.getDamage(), false, true, false, "Lightning Strike", "Lightning Strike"); + } + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java index af04c4a06..0892dfa4c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSpeedBoost.java @@ -7,14 +7,14 @@ import org.bukkit.entity.Player; public class SpellSpeedBoost extends Spell implements SpellClick { - @Override - public void castSpell(Player p) - { - int ticks = 20 * 20; - int potionLevel = getSpellLevel(p); + @Override + public void castSpell(Player p) + { + int ticks = 30 * getSpellLevel(p) * 20; + int potionLevel = getSpellLevel(p); - Wizards.getArcadeManager().GetCondition().Factory().Speed("Speed Boost", p, p, ticks, potionLevel, false, false, false); + Wizards.getArcadeManager().GetCondition().Factory().Speed("Speed Boost", p, p, ticks, potionLevel, false, false, false); - charge(p); - } + charge(p); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java index 0e6a12300..00b9e58be 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java @@ -43,7 +43,7 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl Location loc = block.getLocation().add(0.5, 0, 0.5); - for (int i = 0; i < getSpellLevel(player); i++) + for (int i = 0; i < 2 + getSpellLevel(player); i++) { Wizards.CreatureAllowOverride = true; @@ -57,10 +57,11 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl wolf.setBreed(false); wolf.setCustomName(player.getDisplayName() + "'s Wolf"); wolf.setRemoveWhenFarAway(false); - wolf.setMaxHealth(0.5); - wolf.setHealth(0.5); + wolf.setMaxHealth(2); + wolf.setHealth(2); + // wolf.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 9001, 0)); - _summonedWolves.put(wolf, System.currentTimeMillis() + (30L * 1000L)); + this._summonedWolves.put(wolf, System.currentTimeMillis() + (30L * 1000L)); } UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, loc, 0.8F, 0, 0.8F, 0, 4); From 50c38dc46717fdc12f7b3e15af82b502b404b1f1 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Tue, 31 Mar 2015 17:22:50 -0400 Subject: [PATCH 02/43] April Fools Additions, Fix some errors in Clans code, Add PlayerCache to IntellIJ IDEA --- Plugins/.idea/artifacts/Mineplex_Hub_jar.xml | 2 +- Plugins/.idea/modules.xml | 1 + .../v1_7_R4/PacketPlayOutPlayerInfo.java | 55 +++++++++++++++++-- .../Mineplex.Bungee.Mineplexer.iml | 1 + .../core/reward/rewards/CoinReward.java | 7 --- .../game/clans/shop/PvpShopButton.java | 4 +- .../clans/shop/energy/EnergyShopButton.java | 2 +- .../src/mineplex/hub/HubManager.java | 11 +++- .../Mineplex.PlayerCache.iml | 12 ++++ 9 files changed, 78 insertions(+), 17 deletions(-) create mode 100644 Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml diff --git a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml index d49f02062..a90117bcf 100644 --- a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml +++ b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml @@ -17,8 +17,8 @@ - + \ No newline at end of file diff --git a/Plugins/.idea/modules.xml b/Plugins/.idea/modules.xml index c3a2035a7..bf0ac4bae 100644 --- a/Plugins/.idea/modules.xml +++ b/Plugins/.idea/modules.xml @@ -14,6 +14,7 @@ + diff --git a/Plugins/Classpath.Dummy/src/net/minecraft/server/v1_7_R4/PacketPlayOutPlayerInfo.java b/Plugins/Classpath.Dummy/src/net/minecraft/server/v1_7_R4/PacketPlayOutPlayerInfo.java index 67f811440..f1bcc4118 100644 --- a/Plugins/Classpath.Dummy/src/net/minecraft/server/v1_7_R4/PacketPlayOutPlayerInfo.java +++ b/Plugins/Classpath.Dummy/src/net/minecraft/server/v1_7_R4/PacketPlayOutPlayerInfo.java @@ -6,6 +6,7 @@ package net.minecraft.server.v1_7_R4; import java.io.IOException; +import java.util.Calendar; import java.util.Iterator; import org.bukkit.craftbukkit.v1_7_R4.scoreboard.CraftScoreboard; @@ -16,6 +17,11 @@ import net.minecraft.util.com.mojang.authlib.properties.Property; import net.minecraft.util.com.mojang.authlib.properties.PropertyMap; public class PacketPlayOutPlayerInfo extends Packet { + + public static final String NOTCH_SKIN = "eyJ0aW1lc3RhbXAiOjE0Mjc4MjgyMzMwNDUsInByb2ZpbGVJZCI6IjA2OWE3OWY0NDRlOTQ3MjZhNWJlZmNhOTBlMzhhYWY1IiwicHJvZmlsZU5hbWUiOiJOb3RjaCIsImlzUHVibGljIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTExNmU2OWE4NDVlMjI3ZjdjYTFmZGRlOGMzNTdjOGM4MjFlYmQ0YmE2MTkzODJlYTRhMWY4N2Q0YWU5NCJ9LCJDQVBFIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2Y2ODhlMGU2OTliM2Q5ZmU0NDhiNWJiNTBhM2EyODhmOWM1ODk3NjJiM2RhZTgzMDg4NDIxMjJkY2I4MSJ9fX0="; + public static final String NOTCH_SIGNATURE = "WrBmNqkpkjh6VJY26jOOMNS6oSOPi0MTm9WWc0t4EMUHchUbTd6/1sT2O2zz2s7xwmCeUxuIhvRREa+1bIPzIIbXJLjhxiBWMdTJbQhv6zBb1U2SZb7eb5cYrFTD6rvxy0rOarScxCBdeOXpr1coxrvN8a6VkgLhc/dGhFx0ZmORxELBLFiCNi+4WE//MI+KioAq84Gdf0ltT9ZLWdlHNFV2ynBgcx2MfNTA2lrpdKEUVOYD7xhPoOdHa5d1hzdDxbYPGDgM0FzYjzNUlBx8SLvHEpyBB7XyOsIGnfqrS0ltIDTq82wgLrEwDRncuQN18w6IiQbNK06MZBDyNnIp79mmUYvRj+Zl0dPBrZok2q2uQ08hZ87ufU3jhjY39kr+iEaPYMvfWaBxt3ALjopsZRCGSlEukMzITjeYxhfVKuQ0fhWKRfwWn/Jv2de2h+i+t7nulvN3MV3rJVrS6OXsx87p/vm9biU7Hs07T8VSGONfkxXmsgYEtY6m2egU5pmqFnsKM0MwwnZJ7Sxz2EjiPikoGzJzpv4ncj3rhelIKJKjDk9jSAz7nPzc8/UdOiTrfy4ezr3jFVAVatiKr+kS/HNXHWiCFdufhpG4DVCrSkwkFBJw030pJ6ICVhpuYq5yOswQB5QOp0JDWc2Rdth7SVmvxthSCL9G2ksfm+v7sKw="; + + public static final int ADD_PLAYER = 0; public static final int UPDATE_GAMEMODE = 1; public static final int UPDATE_LATENCY = 2; @@ -38,6 +44,7 @@ public class PacketPlayOutPlayerInfo extends Packet { packet.player = player.getProfile(); packet.ping = player.ping; packet.gamemode = player.playerInteractManager.getGameMode().getId(); + packet._tabName = getFormattedName(player); return packet; } @@ -87,6 +94,9 @@ public class PacketPlayOutPlayerInfo extends Packet { public void b(PacketDataSerializer packetdataserializer) throws IOException { if(packetdataserializer.version >= 20) { + + Calendar c = Calendar.getInstance(); + packetdataserializer.b(this.action); packetdataserializer.b(1); packetdataserializer.writeUUID(this.player.getId()); @@ -94,16 +104,41 @@ public class PacketPlayOutPlayerInfo extends Packet { case 0: packetdataserializer.a(this.player.getName()); PropertyMap properties = this.player.getProperties(); + + // April Fools + if (isAprilFools() && properties.size() == 0) + { + // add texture if no textures exist + properties.put("textures", new Property("textures", NOTCH_SKIN, NOTCH_SIGNATURE)); + + } + packetdataserializer.b(properties.size()); Iterator var3 = properties.values().iterator(); while(var3.hasNext()) { Property property = (Property)var3.next(); - packetdataserializer.a(property.getName()); - packetdataserializer.a(property.getValue()); - packetdataserializer.writeBoolean(property.hasSignature()); - if(property.hasSignature()) { - packetdataserializer.a(property.getSignature()); + + // April Fools + if (isAprilFools() && property.getName().equalsIgnoreCase("textures")) + { + System.out.println("Applying notch texture for : " + property.getName()); + System.out.println("Skin: " + property.getValue()); + System.out.println("Signature: " + property.getSignature()); + packetdataserializer.a(property.getName()); + packetdataserializer.a(NOTCH_SKIN); + packetdataserializer.writeBoolean(true); + packetdataserializer.a(NOTCH_SIGNATURE); + } + else + { + packetdataserializer.a(property.getName()); + packetdataserializer.a(property.getValue()); + + packetdataserializer.writeBoolean(property.hasSignature()); + if(property.hasSignature()) { + packetdataserializer.a(property.getSignature()); + } } } @@ -149,6 +184,8 @@ public class PacketPlayOutPlayerInfo extends Packet { { String name = player.getName(); + if (isAprilFools()) name = "Notch"; + CraftScoreboard scoreboard = player.getBukkitEntity().getScoreboard(); if (scoreboard != null) { @@ -159,4 +196,12 @@ public class PacketPlayOutPlayerInfo extends Packet { return name; } + + public static boolean isAprilFools() + { + Calendar c = Calendar.getInstance(); + +// return true; + return c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1; + } } diff --git a/Plugins/Mineplex.Bungee.Mineplexer/Mineplex.Bungee.Mineplexer.iml b/Plugins/Mineplex.Bungee.Mineplexer/Mineplex.Bungee.Mineplexer.iml index 81ce3df96..872b77ead 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/Mineplex.Bungee.Mineplexer.iml +++ b/Plugins/Mineplex.Bungee.Mineplexer/Mineplex.Bungee.Mineplexer.iml @@ -13,5 +13,6 @@ + \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/CoinReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/CoinReward.java index 72bc8f823..a0023e137 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/CoinReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/CoinReward.java @@ -1,9 +1,5 @@ package mineplex.core.reward.rewards; -/** - * Created by shaun on 2014-09-08. - */ - import java.util.Random; import org.bukkit.entity.Player; @@ -16,9 +12,6 @@ import mineplex.core.reward.RewardData; import mineplex.core.reward.RewardManager; import mineplex.core.reward.RewardRarity; -/** - * Created by shaun on 2014-09-08. - */ public class CoinReward extends Reward { private DonationManager _donationManager; diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpShopButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpShopButton.java index cb2b186df..962ea019c 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpShopButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/PvpShopButton.java @@ -69,7 +69,7 @@ public class PvpShopButton> imple UtilPlayer.message(player, F.main(Page.getPlugin().getName(), "An error occurred processing your purchase.")); } } - }, "Clans", player.getName(), player.getUniqueId(), -cost); + }, "Clans", player.getName(), Page.getClientManager().Get(player).getAccountId(), -cost); } } else if (clickType == ClickType.RIGHT || clickType == ClickType.SHIFT_RIGHT) @@ -109,7 +109,7 @@ public class PvpShopButton> imple UtilPlayer.message(player, F.main(Page.getPlugin().getName(), "An error occurred processing your return.")); } } - }, "Clans", player.getName(), player.getUniqueId(), creditAmount); + }, "Clans", player.getName(), Page.getClientManager().Get(player).getAccountId(), creditAmount); } } } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/energy/EnergyShopButton.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/energy/EnergyShopButton.java index c0d416d3b..5398daf50 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/energy/EnergyShopButton.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/shop/energy/EnergyShopButton.java @@ -50,7 +50,7 @@ public class EnergyShopButton implements IButton _clanInfo.adjustEnergy(energy); _page.refresh(); } - }, "Energy Purchase", player.getName(), player.getUniqueId(), -goldCost, true); + }, "Energy Purchase", player.getName(), _page.getClientManager().Get(player).getAccountId(), -goldCost, true); } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 17c624188..9c56daeab 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -1,6 +1,7 @@ package mineplex.hub; import java.util.ArrayList; +import java.util.Calendar; import java.util.HashMap; import org.bukkit.Bukkit; @@ -510,13 +511,21 @@ public class HubManager extends MiniClientPlugin public void PlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); + String playerName = player.getName(); + + // April Fools + Calendar c = Calendar.getInstance(); + if (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1) + { + playerName = "Notch"; + } //Public Message if (_clientManager.Get(player).GetRank() != Rank.LEGEND) event.setJoinMessage(null); else { - event.setJoinMessage(C.cGreen + C.Bold + "Legend " + player.getName() + " has joined!"); + event.setJoinMessage(C.cGreen + C.Bold + "Legend " + playerName + " has joined!"); UtilFirework.playFirework(player.getEyeLocation(), org.bukkit.FireworkEffect.Type.BALL_LARGE, Color.LIME, true, true); player.getWorld().playSound(player.getEyeLocation(), Sound.WITHER_SPAWN, 2f, 1f); } diff --git a/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml b/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml new file mode 100644 index 000000000..54892e832 --- /dev/null +++ b/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file From ed35d2a992ab62e53a335c8ccce9b14935289bcd Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 16:56:13 +1100 Subject: [PATCH 03/43] April Fools update --- .../core/aprilfools/AprilFoolsManager.java | 196 ++++++++++++++++++ .../Mineplex.Hub/src/mineplex/hub/Hub.java | 9 +- .../src/mineplex/hub/HubManager.java | 22 +- .../hub/modules/ForcefieldManager.java | 2 +- .../src/nautilus/game/arcade/Arcade.java | 3 + .../nautilus/game/arcade/ArcadeManager.java | 17 +- .../games/champions/ChampionsDominate.java | 3 +- .../game/games/champions/ChampionsTDM.java | 3 +- .../game/arcade/managers/GameChatManager.java | 14 +- ...loweenManager.java => HolidayManager.java} | 24 +-- 10 files changed, 259 insertions(+), 34 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java rename Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/{HalloweenManager.java => HolidayManager.java} (89%) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java new file mode 100644 index 000000000..fcbdecbbc --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java @@ -0,0 +1,196 @@ +package mineplex.core.aprilfools; + +import java.util.Calendar; +import java.util.HashSet; +import java.util.Iterator; + +import org.bukkit.Effect; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.block.BlockDamageEvent; +import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.plugin.java.JavaPlugin; + +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilServer; +import mineplex.core.disguise.DisguiseManager; +import mineplex.core.disguise.disguises.DisguiseCow; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class AprilFoolsManager extends MiniPlugin +{ + public static AprilFoolsManager Instance; + + private boolean _enabled; + private DisguiseManager _disguiseManager; + private CoreClientManager _clientManager; + + private HashSet _disguised = new HashSet(); + + protected AprilFoolsManager(JavaPlugin plugin, CoreClientManager clientManager, DisguiseManager disguiseManager) + { + super("April Fools", plugin); + + _disguiseManager = disguiseManager; + _clientManager = clientManager; + + Calendar c = Calendar.getInstance(); + _enabled = (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1); + } + + public static void Initialize(JavaPlugin plugin, CoreClientManager clientManager, DisguiseManager disguiseManager) + { + Instance = new AprilFoolsManager(plugin, clientManager, disguiseManager); + } + + @EventHandler(priority = EventPriority.LOW) + public void chatAdd(AsyncPlayerChatEvent event) + { + if (!_enabled) + return; + + String[] words = event.getMessage().split(" "); + + String out = ""; + for (String word : words) + { + //Prefix + if (Math.random() > 0.9) + { + out += "moo"; + + for (int i=0 ; i 0.9) + { + out += word + " "; + + out += "moo"; + + for (int i=0 ; i 0.99) + { + out += "moo"; + + for (int i=3 ; i disguiseIter = _disguised.iterator(); + while (disguiseIter.hasNext()) + { + Player player = disguiseIter.next(); + + if (!player.isValid() || !player.isOnline() || + _disguiseManager.getDisguise(player) == null || + !(_disguiseManager.getDisguise(player) instanceof DisguiseCow)) + { + disguiseIter.remove(); + continue; + } + + if (Math.random() > 0.8) + { + player.getWorld().playSound(player.getLocation(), Sound.COW_IDLE, (float)Math.random() + 0.5f, (float)Math.random() + 0.5f); + } + } + } + + public boolean isActive() + { + return _enabled; + } + + public String getName(Player player) + { + //Name + int index = 0; + boolean hitVowel = false; + for (int i=0 ; i 16) + name = name.substring(0, 16); + + return name; + } + + public void setEnabled(boolean b) + { + _enabled = b; + } +} diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java index 97672e417..1ff7875a9 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java @@ -8,6 +8,7 @@ import mineplex.core.TablistFix; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; import mineplex.core.antihack.AntiHack; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.chat.Chat; import mineplex.core.command.CommandCenter; @@ -113,13 +114,13 @@ public class Hub extends JavaPlugin implements IRelation StatsManager statsManager = new StatsManager(this, clientManager); AchievementManager achievementManager = new AchievementManager(statsManager, clientManager, donationManager); - + PartyManager partyManager = new PartyManager(this, portal, clientManager, preferenceManager); HubManager hubManager = new HubManager(this, blockRestore, clientManager, donationManager, new ConditionManager(this), disguiseManager, new TaskManager(this, webServerAddress), portal, partyManager, preferenceManager, petManager, pollManager, statsManager, achievementManager, new HologramManager(this)); QueueManager queueManager = new QueueManager(this, clientManager, donationManager, new EloManager(this, clientManager), partyManager); - + new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, new StackerManager(hubManager), queueManager); new Chat(this, clientManager, preferenceManager, serverStatusManager.getCurrentServerName()); new MemoryFix(this); @@ -129,6 +130,8 @@ public class Hub extends JavaPlugin implements IRelation //new Replay(this, packetHandler); new PersonalServerManager(this, clientManager); + AprilFoolsManager.Initialize(this, clientManager, disguiseManager); + CombatManager combatManager = new CombatManager(this); ProjectileManager throwManager = new ProjectileManager(this); @@ -136,7 +139,7 @@ public class Hub extends JavaPlugin implements IRelation DamageManager damage = new DamageManager(this, combatManager, npcManager, disguiseManager); Fire fire = new Fire(this, conditionManager, damage); - Teleport teleport = new Teleport(this); + Teleport teleport = new Teleport(this); Energy energy = new Energy(this); energy.setEnabled(false); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 9c56daeab..ebff189d5 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -46,6 +46,7 @@ import mineplex.core.MiniClientPlugin; import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.common.Rank; import mineplex.core.common.util.C; @@ -514,11 +515,8 @@ public class HubManager extends MiniClientPlugin String playerName = player.getName(); // April Fools - Calendar c = Calendar.getInstance(); - if (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1) - { - playerName = "Notch"; - } + if (AprilFoolsManager.Instance.isActive()) + playerName = AprilFoolsManager.Instance.getName(player); //Public Message if (_clientManager.Get(player).GetRank() != Rank.LEGEND) @@ -529,8 +527,7 @@ public class HubManager extends MiniClientPlugin UtilFirework.playFirework(player.getEyeLocation(), org.bukkit.FireworkEffect.Type.BALL_LARGE, Color.LIME, true, true); player.getWorld().playSound(player.getEyeLocation(), Sound.WITHER_SPAWN, 2f, 1f); } - - + //Teleport player.teleport(GetSpawn().add(0, 10, 0)); @@ -631,6 +628,11 @@ public class HubManager extends MiniClientPlugin } Player player = event.getPlayer(); + String playerName = player.getName(); + + // April Fools + if (AprilFoolsManager.Instance.isActive()) + playerName = AprilFoolsManager.Instance.getName(player); Rank rank = GetClients().Get(player).GetRank(); @@ -656,7 +658,7 @@ public class HubManager extends MiniClientPlugin event.getRecipients().clear(); event.setMessage(event.getMessage().substring(1, event.getMessage().length())); - event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + "%1$s " + C.cPurple + "%2$s"); + event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + playerName + " " + C.cPurple + "%2$s"); for (String name : party.GetPlayers()) { @@ -673,7 +675,7 @@ public class HubManager extends MiniClientPlugin } return; - } + } else { for (Player other : UtilServer.getPlayers()) @@ -685,7 +687,7 @@ public class HubManager extends MiniClientPlugin } event.setMessage(event.getMessage()); - event.setFormat(levelStr + rankStr + C.cYellow + "%1$s " + C.cWhite + "%2$s"); + event.setFormat(levelStr + rankStr + C.cYellow + playerName + " " + C.cWhite + "%2$s"); } } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java index 0683060e9..425ce1a0f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ForcefieldManager.java @@ -42,7 +42,7 @@ public class ForcefieldManager extends MiniPlugin for (Player player : UtilServer.getPlayers()) { - if (Manager.getPreferences().Get(player).HubForcefield) + if (Manager.getPreferences().Get(player).HubForcefield && Manager.GetClients().Get(player).GetRank().Has(Rank.ADMIN)) { for (Player other : UtilServer.getPlayers()) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index ae9ca9b08..b4e166f6b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -10,6 +10,7 @@ import mineplex.core.CustomTagFix; import mineplex.core.TablistFix; import mineplex.core.account.CoreClientManager; import mineplex.core.antihack.AntiHack; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.blood.Blood; import mineplex.core.command.CommandCenter; @@ -135,6 +136,8 @@ public class Arcade extends JavaPlugin new CustomTagFix(this, packetHandler); new TablistFix(this); + AprilFoolsManager.Initialize(this, _clientManager, disguiseManager); + //Updates getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 761a2b7c9..043772964 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -33,6 +33,7 @@ import org.bukkit.util.Vector; import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.blood.Blood; import mineplex.core.chat.Chat; @@ -602,8 +603,14 @@ public class ArcadeManager extends MiniPlugin implements IRelation @EventHandler public void MessageJoin(PlayerJoinEvent event) { + String name = event.getPlayer().getName(); + + // April Fools + if (AprilFoolsManager.Instance.isActive()) + name = AprilFoolsManager.Instance.getName(event.getPlayer()); + if (_game != null && _game.AnnounceJoinQuit) - event.setJoinMessage(F.sys("Join", GetColor(event.getPlayer()) + event.getPlayer().getName())); + event.setJoinMessage(F.sys("Join", GetColor(event.getPlayer()) + name)); else event.setJoinMessage(null); @@ -612,8 +619,14 @@ public class ArcadeManager extends MiniPlugin implements IRelation @EventHandler public void MessageQuit(PlayerQuitEvent event) { + String name = event.getPlayer().getName(); + + // April Fools + if (AprilFoolsManager.Instance.isActive()) + name = AprilFoolsManager.Instance.getName(event.getPlayer()); + if (_game == null || _game.AnnounceJoinQuit) - event.setQuitMessage(F.sys("Quit", GetColor(event.getPlayer()) + event.getPlayer().getName())); + event.setQuitMessage(F.sys("Quit", GetColor(event.getPlayer()) + name)); else event.setQuitMessage(null); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index 59f2f34d4..3aa158ad0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.game.games.champions; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.minecraft.game.core.combat.DeathMessageType; @@ -65,7 +66,7 @@ public class ChampionsDominate extends Domination EloStart = 1000; this.DisableKillCommand = false; - + registerStatTrackers( new KillReasonStatTracker(this, "Backstab", "Assassination", false), new ElectrocutionStatTracker(this), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index 9af73ce5c..e7999d18f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -6,6 +6,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.inventory.InventoryType; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.minecraft.game.core.combat.DeathMessageType; @@ -63,7 +64,7 @@ public class ChampionsTDM extends TeamDeathmatch InventoryOpenChest = true; this.DisableKillCommand = false; - + registerStatTrackers( new WinWithoutLosingTeammateStatTracker(this, "FlawlessVictory"), new KillAllOpposingStatTracker(this), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java index b05e9c7e6..0bebbb2c1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java @@ -2,6 +2,7 @@ package nautilus.game.arcade.managers; import java.util.Iterator; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; @@ -46,6 +47,11 @@ public class GameChatManager implements Listener return; Player sender = event.getPlayer(); + String senderName = sender.getName(); + + // April Fools + if (AprilFoolsManager.Instance.isActive()) + senderName = AprilFoolsManager.Instance.getName(sender); //Dead Prefix String dead = ""; @@ -100,7 +106,7 @@ public class GameChatManager implements Listener event.getRecipients().clear(); event.setMessage(event.getMessage().substring(1, event.getMessage().length())); - event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + "%1$s " + C.cPurple + "%2$s"); + event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + senderName + " " + C.cPurple + "%2$s"); event.getRecipients().addAll(party.GetPlayersOnline()); @@ -109,7 +115,7 @@ public class GameChatManager implements Listener } //Base Format - event.setFormat(dead + levelStr + rankStr + Manager.GetColor(sender) + "%1$s " + ChatColor.WHITE + "%2$s"); + event.setFormat(dead + levelStr + rankStr + Manager.GetColor(sender) + senderName + " " + ChatColor.WHITE + "%2$s"); //Public/Private (Not If Player Dead) if (Manager.GetGame() != null && Manager.GetGame().GetState() == GameState.Live) @@ -125,13 +131,13 @@ public class GameChatManager implements Listener if (event.getMessage().charAt(0) == '@') { event.setMessage(event.getMessage().substring(1, event.getMessage().length())); - event.setFormat(C.cWhite + C.Bold + "Team" + " " + dead + levelStr + rankStr + team.GetColor() + "%1$s " + C.cWhite + "%2$s"); + event.setFormat(C.cWhite + C.Bold + "Team" + " " + dead + levelStr + rankStr + team.GetColor() + senderName + " " + C.cWhite + "%2$s"); } //All Chat else { globalMessage = true; - event.setFormat(dead + levelStr + rankStr + team.GetColor() + "%1$s " + C.cWhite + "%2$s"); + event.setFormat(dead + levelStr + rankStr + team.GetColor() + senderName + " " + C.cWhite + "%2$s"); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HalloweenManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java similarity index 89% rename from Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HalloweenManager.java rename to Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java index fd45a05a8..0def76fa3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HalloweenManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java @@ -30,7 +30,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; -public class HalloweenManager implements Listener +public class HolidayManager implements Listener { ArcadeManager Manager; @@ -40,7 +40,7 @@ public class HalloweenManager implements Listener public long _lastSpawn = System.currentTimeMillis(); - public HalloweenManager(ArcadeManager manager) + public HolidayManager(ArcadeManager manager) { Manager = manager; @@ -61,29 +61,29 @@ public class HalloweenManager implements Listener if (event.getType() == UpdateType.TICK) return; - Iterator pumpkinIterator = _active.iterator(); + Iterator blockIterator = _active.iterator(); - while (pumpkinIterator.hasNext()) + while (blockIterator.hasNext()) { - Block pumpkin = pumpkinIterator.next(); + Block block = blockIterator.next(); - if (pumpkin.getType() != Material.PUMPKIN && pumpkin.getType() != Material.JACK_O_LANTERN) + if (block.getType() != Material.PUMPKIN && block.getType() != Material.JACK_O_LANTERN) { - pumpkinBreak(pumpkin); - pumpkinIterator.remove(); + pumpkinBreak(block); + blockIterator.remove(); continue; } - UtilParticle.PlayParticle(ParticleType.FLAME, pumpkin.getLocation().add(0.5, 0.5, 0.5), 0, 0, 0, 0.06f, 4); + UtilParticle.PlayParticle(ParticleType.FLAME, block.getLocation().add(0.5, 0.5, 0.5), 0, 0, 0, 0.06f, 4); if (Math.random() > 0.90) { - if (pumpkin.getType() == Material.PUMPKIN) + if (block.getType() == Material.PUMPKIN) { - pumpkin.setType(Material.JACK_O_LANTERN); + block.setType(Material.JACK_O_LANTERN); } else { - pumpkin.setType(Material.PUMPKIN); + block.setType(Material.PUMPKIN); } } } From 59fce1cd8866539996ceef416eaad15093bb5126 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 17:15:56 +1100 Subject: [PATCH 04/43] adding some mmoooo text changed pig kit for baconbrawl --- .../core/aprilfools/AprilFoolsManager.java | 21 ++++++++++++++----- .../games/baconbrawl/kits/KitMamaPig.java | 17 +++++++++++++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java index fcbdecbbc..240c66bd1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java @@ -4,24 +4,20 @@ import java.util.Calendar; import java.util.HashSet; import java.util.Iterator; -import org.bukkit.Effect; -import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.player.AsyncPlayerChatEvent; -import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.disguises.DisguiseCow; -import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -106,6 +102,21 @@ public class AprilFoolsManager extends MiniPlugin event.setMessage(out); } + @EventHandler + public void updateText(UpdateEvent event) + { + if (!_enabled) + return; + + if (event.getType() != UpdateType.SLOW) + return; + + if (Math.random() <= 0.99) + return; + + UtilTextMiddle.display("Moo", null, 5, 20, 5); + } + @EventHandler public void updateCow(UpdateEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java index 42cf880f7..c0f2819a4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.game.games.baconbrawl.kits; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.EntityType; import org.bukkit.entity.Pig; @@ -7,6 +8,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.disguise.disguises.DisguisePig; import mineplex.core.itemstack.ItemStackFactory; import nautilus.game.arcade.ArcadeManager; @@ -15,6 +17,7 @@ import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.perks.PerkBaconBlast; import nautilus.game.arcade.kit.perks.PerkSpeed; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; public class KitMamaPig extends Kit { @@ -37,7 +40,7 @@ public class KitMamaPig extends Kit } @Override - public void GiveItems(Player player) + public void GiveItems(final Player player) { player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); @@ -48,12 +51,22 @@ public class KitMamaPig extends Kit Manager.GetDisguise().disguise(disguise); Manager.GetGame().CreatureAllowOverride = true; - Pig pig = player.getWorld().spawn(player.getEyeLocation(), Pig.class); + final Pig pig = player.getWorld().spawn(player.getEyeLocation(), Pig.class); pig.setBaby(); pig.setAgeLock(true); pig.setCustomName(C.cYellow + player.getName()); pig.setCustomNameVisible(true); + Manager.GetGame().CreatureAllowOverride = false; player.setPassenger(pig); + + Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable() + { + @Override + public void run() + { + UtilPlayer.sendPacket(player, new PacketPlayOutEntityDestroy(new int[] { pig.getEntityId() })); + } + }, 2); } } From 10c7d06a88d035d8f7f64866953910d9fc0c920c Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Tue, 31 Mar 2015 23:16:15 -0700 Subject: [PATCH 05/43] Memory leak fixes for DisguiseManager and DonationManager. --- .../core/disguise/DisguiseManager.java | 72 +++++++------------ .../core/donation/DonationManager.java | 30 ++++++-- 2 files changed, 48 insertions(+), 54 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index bc8b4b5ae..83373899c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.Map.Entry; import net.minecraft.server.v1_7_R4.Block; @@ -797,53 +798,6 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler } } - /*public void reApplyDisguise(final DisguiseBase disguise, final Player player) - { - PacketPlayOutEntityDestroy destroyPacket = new PacketPlayOutEntityDestroy(disguise.GetEntityId()); - - if (disguise.GetEntity() == ((CraftPlayer) player).getHandle()) - return; - - EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); - - entityPlayer.playerConnection.sendPacket(destroyPacket); - - List tempArmor = new ArrayList(); - - if (disguise instanceof DisguiseInsentient && disguise.GetEntity() instanceof LivingEntity) - { - if (((DisguiseInsentient) disguise).armorVisible()) - { - for (Packet armorPacket : ((DisguiseInsentient) disguise).getArmorPackets()) - tempArmor.add(armorPacket); - } - } - - final List armorPackets = tempArmor; - - Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() - { - public void run() - { - EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); - entityPlayer.playerConnection.sendPacket(disguise.GetSpawnPacket()); - - if (disguise instanceof DisguisePlayer && ((DisguisePlayer) disguise).getSleepingDirection() != null) - { - for (Packet packet : getBedPackets(player.getLocation(), (DisguisePlayer) disguise)) - { - entityPlayer.playerConnection.sendPacket(packet); - } - } - - for (Packet packet : armorPackets) - { - entityPlayer.playerConnection.sendPacket(packet); - } - } - }); - }*/ - private void prepareChunk(Location loc) { int chunkX = getChunk(loc.getX()); @@ -1054,4 +1008,28 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler entityPlayer.playerConnection.sendPacket(disguise.GetMetaDataPacket()); } } + + public void cleanDisguises(UpdateEvent event) + { + if (event.getType() != UpdateType.SLOWER || _disguisePlayerMap.isEmpty()) + return; + + for (Iterator disguiseIterator = _disguisePlayerMap.keySet().iterator(); disguiseIterator.hasNext();) + { + DisguiseBase disguise = disguiseIterator.next(); + + if (disguise.GetEntity() instanceof Player && (!((Player)disguise.GetEntity()).isOnline() || !((Player)disguise.GetEntity()).isValid())) + disguiseIterator.remove(); + else + { + for (Iterator playerIterator = _disguisePlayerMap.get(disguise).iterator(); playerIterator.hasNext();) + { + Player player = playerIterator.next(); + + if (!player.isOnline() || !player.isValid()) + playerIterator.remove(); + } + } + } + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java index c82e72530..9f1f39124 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java @@ -251,22 +251,38 @@ public class DonationManager extends MiniDbClientPlugin if (event.getType() != UpdateType.SLOWER) return; - for (Player player : _coinQueue.keySet()) + for (final Player player : _coinQueue.keySet()) { - String caller = null; - int total = 0; + String tempCaller = null; + int tempTotal = 0; for (String curCaller : _coinQueue.get(player).keySet()) { - caller = curCaller; - total += _coinQueue.get(player).get(curCaller); + tempCaller = curCaller; + tempTotal += _coinQueue.get(player).get(curCaller); } + final int total = tempTotal; + final String caller = tempCaller; + if (caller == null) continue; - //Actually Add Gems - RewardCoins(null, caller, player.getName(), ClientManager.Get(player).getAccountId(), total, false); + try + { + //Actually Add Gems + RewardCoins(null, caller, player.getName(), ClientManager.Get(player).getAccountId(), total, false); + } + catch (Exception exception) + { + Bukkit.getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() + { + public void run() + { + RewardCoins(null, caller, player.getName(), ClientManager.getCachedClientAccountId(player.getUniqueId()), total, false); + } + }); + } System.out.println("Queue Added [" + player + "] with Coins [" + total + "] for [" + caller + "]"); From 31ddeaac500668880d67414d0c55f7197309daf1 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 17:28:05 +1100 Subject: [PATCH 06/43] a little more moo --- .../src/mineplex/core/aprilfools/AprilFoolsManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java index 240c66bd1..3483b3e8e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java @@ -59,7 +59,7 @@ public class AprilFoolsManager extends MiniPlugin for (String word : words) { //Prefix - if (Math.random() > 0.9) + if (Math.random() > 0.85) { out += "moo"; @@ -71,7 +71,7 @@ public class AprilFoolsManager extends MiniPlugin } //Suffix - else if (Math.random() > 0.9) + else if (Math.random() > 0.85) { out += word + " "; From 8bd883cb26f1b8cbb31f43b5bac1356317ace9da Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 17:43:46 +1100 Subject: [PATCH 07/43] fixed damage transfer for mama pigglez kit --- .../game/core/damage/CustomDamageEvent.java | 11 ++++++++++ .../games/baconbrawl/kits/KitMamaPig.java | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java index ff33ab273..c92e63a57 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java @@ -243,6 +243,15 @@ public class CustomDamageEvent extends Event implements Cancellable _damagerPlayer = (Player)ent; } + public void setDamagee(LivingEntity ent) + { + _damageeEntity = ent; + + _damageePlayer = null; + if (ent instanceof Player) + _damageePlayer = (Player)ent; + } + public void changeReason(String initial, String reason) { for (DamageChange change : _damageMod) @@ -307,4 +316,6 @@ public class CustomDamageEvent extends Event implements Cancellable { SetCancelled("No reason given because SOMEONE IS AN IDIOT"); } + + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java index c0f2819a4..c17a2103a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java @@ -3,14 +3,17 @@ package nautilus.game.arcade.game.games.baconbrawl.kits; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Pig; import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilPlayer; import mineplex.core.disguise.disguises.DisguisePig; import mineplex.core.itemstack.ItemStackFactory; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.KitAvailability; @@ -69,4 +72,21 @@ public class KitMamaPig extends Kit } }, 2); } + + @EventHandler + public void damageTransfer(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + if (!(event.GetDamageeEntity() instanceof Pig)) + return; + + Pig pig = (Pig)event.GetDamageeEntity(); + + if (pig.getVehicle() == null || !(pig.getPassenger() instanceof LivingEntity)) + return; + + event.setDamagee((LivingEntity)pig.getVehicle()); + } } From 405d0fec18c1141605ab31f785fa6832e99331be Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Tue, 31 Mar 2015 23:46:43 -0700 Subject: [PATCH 08/43] Work on FriendRepository, still not enabled yet. --- .../core/friend/data/FriendRepository.java | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendRepository.java index 359220020..a06f3e540 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/data/FriendRepository.java @@ -16,6 +16,7 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.database.DBPool; import mineplex.core.database.RepositoryBase; import mineplex.core.database.ResultSetCallable; +import mineplex.core.database.column.ColumnInt; import mineplex.core.database.column.ColumnVarChar; import mineplex.core.friend.FriendStatusType; import mineplex.serverdata.Region; @@ -26,11 +27,8 @@ import mineplex.serverdata.servers.ServerManager; public class FriendRepository extends RepositoryBase { - private static String CREATE_FRIEND_TABLE = "CREATE TABLE IF NOT EXISTS accountFriend (id INT NOT NULL AUTO_INCREMENT, uuidSource VARCHAR(100), uuidTarget VARCHAR(100), status VARCHAR(100), PRIMARY KEY (id), UNIQUE INDEX uuidIndex (uuidSource, uuidTarget));"; - private static String RETRIEVE_MULTIPLE_FRIEND_RECORDS = "SELECT uuidSource, tA.Name, status, tA.lastLogin, now() FROM accountFriend INNER Join accounts AS fA ON fA.uuid = uuidSource INNER JOIN accounts AS tA ON tA.uuid = uuidTarget WHERE uuidSource IN "; - private static String ADD_FRIEND_RECORD = "INSERT INTO accountFriend (uuidSource, uuidTarget, status, created) SELECT fA.uuid AS uuidSource, tA.uuid AS uuidTarget, ?, now() FROM accounts as fA LEFT JOIN accounts AS tA ON tA.name = ? WHERE fA.name = ?;"; - private static String UPDATE_MUTUAL_RECORD = "UPDATE accountFriend AS aF INNER JOIN accounts as fA ON aF.uuidSource = fA.uuid INNER JOIN accounts AS tA ON aF.uuidTarget = tA.uuid SET aF.status = ? WHERE tA.name = ? AND fA.name = ?;"; - private static String DELETE_FRIEND_RECORD = "DELETE aF FROM accountFriend AS aF INNER JOIN accounts as fA ON aF.uuidSource = fA.uuid INNER JOIN accounts AS tA ON aF.uuidTarget = tA.uuid WHERE fA.name = ? AND tA.name = ?;"; + private static String ADD_FRIEND_RECORD = "INSERT INTO accountFriend (sourceId, targetId) VALUES(?, ?);"; + private static String DELETE_FRIEND_RECORD = "DELETE FROM accountFriend WHERE id = ?;"; // Repository holding active PlayerStatus data. private DataRepository _repository; @@ -54,29 +52,14 @@ public class FriendRepository extends RepositoryBase { } - public boolean addFriend(final Player caller, String name) + public boolean addFriend(int sourceAccountId, int targetAccountId) { - int rowsAffected = executeUpdate(ADD_FRIEND_RECORD, new ColumnVarChar("status", 100, "Sent"), new ColumnVarChar("name", 100, name), new ColumnVarChar("name", 100, caller.getName())); - - if (rowsAffected > 0) - return executeUpdate(ADD_FRIEND_RECORD, new ColumnVarChar("status", 100, "Pending"), new ColumnVarChar("name", 100, caller.getName()), new ColumnVarChar("uuid", 100, name)) > 0; - - return false; + return executeUpdate(ADD_FRIEND_RECORD, new ColumnInt("sourceId", sourceAccountId), new ColumnInt("targetId", targetAccountId)) > 0; } - public boolean updateFriend(String caller, String name, String status) - { - return executeUpdate(UPDATE_MUTUAL_RECORD, new ColumnVarChar("status", 100, status), new ColumnVarChar("uuid", 100, name), new ColumnVarChar("name", 100, caller)) > 0; - } - - public boolean removeFriend(String caller, String name) + public boolean removeFriendRecord(int recordId) { - int rowsAffected = executeUpdate(DELETE_FRIEND_RECORD, new ColumnVarChar("name", 100, name), new ColumnVarChar("name", 100, caller)); - - if (rowsAffected > 0) - return executeUpdate(DELETE_FRIEND_RECORD, new ColumnVarChar("name", 100, caller), new ColumnVarChar("uuid", 100, name)) > 0; - - return false; + return executeUpdate(DELETE_FRIEND_RECORD, new ColumnInt("id", recordId)) > 0; } public NautHashMap getFriendsForAll(Player...players) @@ -84,7 +67,7 @@ public class FriendRepository extends RepositoryBase final NautHashMap friends = new NautHashMap(); StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append(RETRIEVE_MULTIPLE_FRIEND_RECORDS + "("); + //stringBuilder.append(RETRIEVE_MULTIPLE_FRIEND_RECORDS + "("); for (Player player : players) { From 6037da6e0f7863b175c573a12e081eb6723f504b Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Tue, 31 Mar 2015 23:47:08 -0700 Subject: [PATCH 09/43] Improved fix for coinQueue memory leak. --- .../src/mineplex/core/donation/DonationManager.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java index 9f1f39124..b8b2bf46b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/donation/DonationManager.java @@ -268,12 +268,9 @@ public class DonationManager extends MiniDbClientPlugin if (caller == null) continue; - try - { - //Actually Add Gems + if (player.isOnline() && player.isValid()) RewardCoins(null, caller, player.getName(), ClientManager.Get(player).getAccountId(), total, false); - } - catch (Exception exception) + else { Bukkit.getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() { From 24ba42cb16ad19944f0a46b6873950ea6d49625d Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 17:49:49 +1100 Subject: [PATCH 10/43] fixed armor stands blocking attacks in bacon brawl --- .../arcade/game/games/baconbrawl/kits/KitMamaPig.java | 10 +++++----- .../game/arcade/game/games/baconbrawl/kits/KitPig.java | 2 +- .../arcade/game/games/baconbrawl/kits/KitSheepPig.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java index c17a2103a..cbbb1e905 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java @@ -58,7 +58,7 @@ public class KitMamaPig extends Kit pig.setBaby(); pig.setAgeLock(true); pig.setCustomName(C.cYellow + player.getName()); - pig.setCustomNameVisible(true); + pig.setCustomNameVisible(false); Manager.GetGame().CreatureAllowOverride = false; player.setPassenger(pig); @@ -78,15 +78,15 @@ public class KitMamaPig extends Kit { if (event.IsCancelled()) return; - + if (!(event.GetDamageeEntity() instanceof Pig)) return; - + Pig pig = (Pig)event.GetDamageeEntity(); if (pig.getVehicle() == null || !(pig.getPassenger() instanceof LivingEntity)) return; - - event.setDamagee((LivingEntity)pig.getVehicle()); + + event.setDamagee((LivingEntity)pig.getVehicle()); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitPig.java index 627da5201..db9071a12 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitPig.java @@ -43,7 +43,7 @@ public class KitPig extends Kit //Disguise DisguisePig disguise = new DisguisePig(player); disguise.setName(C.cYellow + player.getName()); - disguise.setCustomNameVisible(true); + disguise.setCustomNameVisible(false); Manager.GetDisguise().disguise(disguise); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitSheepPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitSheepPig.java index 934909313..3a63d31ff 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitSheepPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitSheepPig.java @@ -50,7 +50,7 @@ public class KitSheepPig extends Kit //Disguise DisguiseSheep disguise = new DisguiseSheep(player); disguise.setName(C.cYellow + player.getName()); - disguise.setCustomNameVisible(true); + disguise.setCustomNameVisible(false); disguise.setColor(DyeColor.PINK); Manager.GetDisguise().disguise(disguise); } From da9e7892f0169cb51f3efe74c340df4032049020 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 18:01:09 +1100 Subject: [PATCH 11/43] fixed aprilfools bugs mamapig debug :( --- .../core/aprilfools/AprilFoolsManager.java | 47 ++++++++----------- .../games/baconbrawl/kits/KitMamaPig.java | 18 ++++--- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java index 3483b3e8e..ae6282bbd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java @@ -1,8 +1,6 @@ package mineplex.core.aprilfools; import java.util.Calendar; -import java.util.HashSet; -import java.util.Iterator; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -29,8 +27,6 @@ public class AprilFoolsManager extends MiniPlugin private DisguiseManager _disguiseManager; private CoreClientManager _clientManager; - private HashSet _disguised = new HashSet(); - protected AprilFoolsManager(JavaPlugin plugin, CoreClientManager clientManager, DisguiseManager disguiseManager) { super("April Fools", plugin); @@ -47,6 +43,16 @@ public class AprilFoolsManager extends MiniPlugin Instance = new AprilFoolsManager(plugin, clientManager, disguiseManager); } + @EventHandler + public void updateEnabled(UpdateEvent event) + { + if (event.getType() != UpdateType.SLOW) + return; + + Calendar c = Calendar.getInstance(); + _enabled = (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1); + } + @EventHandler(priority = EventPriority.LOW) public void chatAdd(AsyncPlayerChatEvent event) { @@ -129,36 +135,23 @@ public class AprilFoolsManager extends MiniPlugin //Disguise for (Player player : UtilServer.getPlayers()) { + //Moo if (_disguiseManager.getDisguise(player) != null) - continue; + { + if (Math.random() > 0.8) + { + if (_disguiseManager.getDisguise(player) instanceof DisguiseCow) + { + player.getWorld().playSound(player.getLocation(), Sound.COW_IDLE, (float)Math.random() + 0.5f, (float)Math.random() + 0.5f); + } + } + } //Disguise DisguiseCow disguise = new DisguiseCow(player); disguise.setName(getName(player), _clientManager.Get(player).GetRank()); disguise.setCustomNameVisible(true); _disguiseManager.disguise(disguise); - - _disguised.add(player); - } - - //Moo - Iterator disguiseIter = _disguised.iterator(); - while (disguiseIter.hasNext()) - { - Player player = disguiseIter.next(); - - if (!player.isValid() || !player.isOnline() || - _disguiseManager.getDisguise(player) == null || - !(_disguiseManager.getDisguise(player) instanceof DisguiseCow)) - { - disguiseIter.remove(); - continue; - } - - if (Math.random() > 0.8) - { - player.getWorld().playSound(player.getLocation(), Sound.COW_IDLE, (float)Math.random() + 0.5f, (float)Math.random() + 0.5f); - } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java index cbbb1e905..6611d2d78 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java @@ -7,9 +7,11 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Pig; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilPlayer; import mineplex.core.disguise.disguises.DisguisePig; import mineplex.core.itemstack.ItemStackFactory; @@ -65,7 +67,7 @@ public class KitMamaPig extends Kit Bukkit.getScheduler().runTaskLater(Manager.getPlugin(), new Runnable() { - @Override + @Override public void run() { UtilPlayer.sendPacket(player, new PacketPlayOutEntityDestroy(new int[] { pig.getEntityId() })); @@ -73,20 +75,24 @@ public class KitMamaPig extends Kit }, 2); } - @EventHandler + @EventHandler(priority=EventPriority.LOWEST) public void damageTransfer(CustomDamageEvent event) { + System.out.println("A"); if (event.IsCancelled()) return; - + System.out.println("B"); if (!(event.GetDamageeEntity() instanceof Pig)) return; - + System.out.println("C"); Pig pig = (Pig)event.GetDamageeEntity(); if (pig.getVehicle() == null || !(pig.getPassenger() instanceof LivingEntity)) return; - - event.setDamagee((LivingEntity)pig.getVehicle()); + System.out.println("D"); + event.SetCancelled("Pig Damage"); + + Manager.GetDamage().NewDamageEvent((LivingEntity)pig.getVehicle(), event.GetDamagerEntity(true), event.GetProjectile(), event.GetCause(), + event.GetDamage(), event.IsKnockback(), event.IgnoreRate(), event.IgnoreArmor(), UtilEnt.getName(pig.getVehicle()), event.GetReason()); } } From 987bf266ee65a0b3f2e752b7e346b7cb36eb7e41 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 18:02:56 +1100 Subject: [PATCH 12/43] fixed bug in moo --- .../src/mineplex/core/aprilfools/AprilFoolsManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java index ae6282bbd..528b673ad 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java @@ -135,9 +135,9 @@ public class AprilFoolsManager extends MiniPlugin //Disguise for (Player player : UtilServer.getPlayers()) { - //Moo if (_disguiseManager.getDisguise(player) != null) { + //Moo if (Math.random() > 0.8) { if (_disguiseManager.getDisguise(player) instanceof DisguiseCow) @@ -145,6 +145,8 @@ public class AprilFoolsManager extends MiniPlugin player.getWorld().playSound(player.getLocation(), Sound.COW_IDLE, (float)Math.random() + 0.5f, (float)Math.random() + 0.5f); } } + + continue; } //Disguise From 5737df8d6aec4aeb641eab30ccbf79b097954ca0 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 18:07:45 +1100 Subject: [PATCH 13/43] final fixes for bacon brawl --- .../game/games/baconbrawl/kits/KitMamaPig.java | 12 ++++-------- .../game/arcade/kit/perks/PerkBaconBlast.java | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java index 6611d2d78..4852415a5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/baconbrawl/kits/KitMamaPig.java @@ -78,21 +78,17 @@ public class KitMamaPig extends Kit @EventHandler(priority=EventPriority.LOWEST) public void damageTransfer(CustomDamageEvent event) { - System.out.println("A"); if (event.IsCancelled()) return; - System.out.println("B"); + if (!(event.GetDamageeEntity() instanceof Pig)) return; - System.out.println("C"); + Pig pig = (Pig)event.GetDamageeEntity(); - if (pig.getVehicle() == null || !(pig.getPassenger() instanceof LivingEntity)) + if (pig.getVehicle() == null || !(pig.getVehicle() instanceof LivingEntity)) return; - System.out.println("D"); - event.SetCancelled("Pig Damage"); - Manager.GetDamage().NewDamageEvent((LivingEntity)pig.getVehicle(), event.GetDamagerEntity(true), event.GetProjectile(), event.GetCause(), - event.GetDamage(), event.IsKnockback(), event.IgnoreRate(), event.IgnoreArmor(), UtilEnt.getName(pig.getVehicle()), event.GetReason()); + event.setDamagee((LivingEntity)pig.getVehicle()); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java index 1ff18356e..f61f6ede4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java @@ -65,7 +65,7 @@ public class PerkBaconBlast extends Perk implements IThrown UtilInv.Update(player); - org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.PORK, (byte)0, 16)); + org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection().multiply(1.5)), ItemStackFactory.Instance.CreateStack(Material.PORK, (byte)0, 16)); UtilAction.velocity(ent, player.getLocation().getDirection(), 1, false, 0, 0.2, 10, false); From 3355d2b457e76f7a7e440460f6f6689904f92b28 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 19:15:11 +1100 Subject: [PATCH 14/43] disabled aprilfools cow for team games --- .../src/mineplex/core/aprilfools/AprilFoolsManager.java | 3 ++- .../src/nautilus/game/arcade/game/games/bridge/Bridge.java | 3 +++ .../game/arcade/game/games/champions/ChampionsDominate.java | 2 ++ .../game/arcade/game/games/champions/ChampionsTDM.java | 2 ++ .../src/nautilus/game/arcade/game/games/micro/Micro.java | 3 +++ .../game/arcade/game/games/minestrike/MineStrike.java | 4 +++- .../nautilus/game/arcade/game/games/paintball/Paintball.java | 3 +++ .../src/nautilus/game/arcade/game/games/sheep/SheepGame.java | 4 +++- .../nautilus/game/arcade/managers/GameCreationManager.java | 2 ++ 9 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java index 528b673ad..6507b48d6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/aprilfools/AprilFoolsManager.java @@ -197,6 +197,7 @@ public class AprilFoolsManager extends MiniPlugin public void setEnabled(boolean b) { - _enabled = b; + Calendar c = Calendar.getInstance(); + _enabled = b && (c.get(Calendar.MONTH) == Calendar.APRIL && c.get(Calendar.DAY_OF_MONTH) == 1); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index fc9b5e983..60e750aac 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -38,6 +38,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.util.Vector; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; @@ -144,6 +145,8 @@ public class Bridge extends TeamGame implements OreObsfucation "The last team alive wins!" }); + AprilFoolsManager.Instance.setEnabled(false); + _ore = new OreHider(); // Flags diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index 3aa158ad0..45bc2644d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -55,6 +55,8 @@ public class ChampionsDominate extends Domination }; + AprilFoolsManager.Instance.setEnabled(false); + Manager.GetDamage().UseSimpleWeaponDamage = false; Manager.getCosmeticManager().setHideParticles(true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index e7999d18f..045412b82 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -56,6 +56,8 @@ public class ChampionsTDM extends TeamDeathmatch }; + AprilFoolsManager.Instance.setEnabled(false); + this.Manager.GetDamage().UseSimpleWeaponDamage = false; Manager.getCosmeticManager().setHideParticles(true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java index cd0eb796a..135df7768 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java @@ -12,6 +12,7 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockFromToEvent; import org.bukkit.event.block.BlockPlaceEvent; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; @@ -47,6 +48,8 @@ public class Micro extends TeamGame "Small game, big strategy!", }); + AprilFoolsManager.Instance.setEnabled(false); + this.StrictAntiHack = true; this.TeamArmor = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java index 197948aa0..01289e8ae 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java @@ -57,6 +57,7 @@ import org.bukkit.scoreboard.Team; import org.bukkit.scoreboard.TeamNameTagVisibility; import org.bukkit.util.Vector; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; @@ -109,7 +110,6 @@ import nautilus.game.arcade.stats.KillFastStatTracker; import nautilus.game.arcade.stats.KillReasonStatTracker; import nautilus.game.arcade.stats.KillsWithConditionStatTracker; import nautilus.game.arcade.stats.MineStrikeLastAliveKillStatTracker; - import net.minecraft.server.v1_7_R4.EntityArrow; public class MineStrike extends TeamGame @@ -249,6 +249,8 @@ public class MineStrike extends TeamGame C.cRed + "Al'Jaha" + C.cWhite + " Kill the Counter-Terrorists", }); + AprilFoolsManager.Instance.setEnabled(false); + _shopManager = new ShopManager(this); this.StrictAntiHack = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java index c938d57d6..840f210d3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java @@ -34,6 +34,7 @@ import org.bukkit.inventory.meta.LeatherArmorMeta; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; @@ -111,6 +112,8 @@ public class Paintball extends TeamGame "Last team alive wins!" }); + AprilFoolsManager.Instance.setEnabled(false); + this.StrictAntiHack = true; this.HungerSet = 20; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index c91841a5c..4cb753d7f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -29,10 +29,10 @@ import org.bukkit.event.player.PlayerEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerItemHeldEvent; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; - import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilInv; @@ -142,6 +142,8 @@ public class SheepGame extends TeamGame "Most sheep at 5 minutes wins!" }); + AprilFoolsManager.Instance.setEnabled(false); + this.DeathOut = false; this.DeathSpectateSecs = 6; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java index 010fedef3..b67c1e474 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; @@ -163,6 +164,7 @@ public class GameCreationManager implements Listener // Manager.GetAntiStack().SetEnabled(true); Manager.getCosmeticManager().setHideParticles(false); Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.CustomWeaponName); + AprilFoolsManager.Instance.setEnabled(true); HashMap pastTeams = null; From 43c58bd31c837dbe17923c2f0e795248eb37ed3d Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 1 Apr 2015 20:22:13 +1100 Subject: [PATCH 15/43] removed april fools from arcade :( --- .../src/nautilus/game/arcade/Arcade.java | 3 --- .../src/nautilus/game/arcade/ArcadeManager.java | 9 --------- .../nautilus/game/arcade/game/games/bridge/Bridge.java | 3 --- .../arcade/game/games/champions/ChampionsDominate.java | 5 +---- .../game/arcade/game/games/champions/ChampionsTDM.java | 5 +---- .../src/nautilus/game/arcade/game/games/micro/Micro.java | 6 ------ .../game/arcade/game/games/minestrike/MineStrike.java | 3 --- .../game/arcade/game/games/paintball/Paintball.java | 6 +----- .../nautilus/game/arcade/game/games/sheep/SheepGame.java | 3 --- .../nautilus/game/arcade/managers/GameChatManager.java | 5 ----- .../game/arcade/managers/GameCreationManager.java | 4 +--- 11 files changed, 4 insertions(+), 48 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index b4e166f6b..ae9ca9b08 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -10,7 +10,6 @@ import mineplex.core.CustomTagFix; import mineplex.core.TablistFix; import mineplex.core.account.CoreClientManager; import mineplex.core.antihack.AntiHack; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.blood.Blood; import mineplex.core.command.CommandCenter; @@ -136,8 +135,6 @@ public class Arcade extends JavaPlugin new CustomTagFix(this, packetHandler); new TablistFix(this); - AprilFoolsManager.Initialize(this, _clientManager, disguiseManager); - //Updates getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 043772964..3c710989d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -33,7 +33,6 @@ import org.bukkit.util.Vector; import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.blood.Blood; import mineplex.core.chat.Chat; @@ -605,10 +604,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation { String name = event.getPlayer().getName(); - // April Fools - if (AprilFoolsManager.Instance.isActive()) - name = AprilFoolsManager.Instance.getName(event.getPlayer()); - if (_game != null && _game.AnnounceJoinQuit) event.setJoinMessage(F.sys("Join", GetColor(event.getPlayer()) + name)); @@ -621,10 +616,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation { String name = event.getPlayer().getName(); - // April Fools - if (AprilFoolsManager.Instance.isActive()) - name = AprilFoolsManager.Instance.getName(event.getPlayer()); - if (_game == null || _game.AnnounceJoinQuit) event.setQuitMessage(F.sys("Quit", GetColor(event.getPlayer()) + name)); else diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index 60e750aac..fc9b5e983 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -38,7 +38,6 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.util.Vector; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; @@ -145,8 +144,6 @@ public class Bridge extends TeamGame implements OreObsfucation "The last team alive wins!" }); - AprilFoolsManager.Instance.setEnabled(false); - _ore = new OreHider(); // Flags diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index 45bc2644d..2066d9589 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game.games.champions; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.minecraft.game.core.combat.DeathMessageType; @@ -54,9 +53,7 @@ public class ChampionsDominate extends Domination "Diamond Weapons deal 7 damage", }; - - AprilFoolsManager.Instance.setEnabled(false); - + Manager.GetDamage().UseSimpleWeaponDamage = false; Manager.getCosmeticManager().setHideParticles(true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index 045412b82..505ca592e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -6,7 +6,6 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.inventory.InventoryType; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.minecraft.game.core.combat.DeathMessageType; @@ -55,9 +54,7 @@ public class ChampionsTDM extends TeamDeathmatch "Diamond Weapons deal 7 damage", }; - - AprilFoolsManager.Instance.setEnabled(false); - + this.Manager.GetDamage().UseSimpleWeaponDamage = false; Manager.getCosmeticManager().setHideParticles(true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java index 135df7768..e35832f40 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java @@ -9,14 +9,10 @@ import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockFromToEvent; import org.bukkit.event.block.BlockPlaceEvent; -import mineplex.core.aprilfools.AprilFoolsManager; -import mineplex.core.common.util.C; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; -import mineplex.core.timing.TimingManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -48,8 +44,6 @@ public class Micro extends TeamGame "Small game, big strategy!", }); - AprilFoolsManager.Instance.setEnabled(false); - this.StrictAntiHack = true; this.TeamArmor = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java index 01289e8ae..0116237ea 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java @@ -57,7 +57,6 @@ import org.bukkit.scoreboard.Team; import org.bukkit.scoreboard.TeamNameTagVisibility; import org.bukkit.util.Vector; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; @@ -249,8 +248,6 @@ public class MineStrike extends TeamGame C.cRed + "Al'Jaha" + C.cWhite + " Kill the Counter-Terrorists", }); - AprilFoolsManager.Instance.setEnabled(false); - _shopManager = new ShopManager(this); this.StrictAntiHack = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java index 840f210d3..75982a00d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/paintball/Paintball.java @@ -34,7 +34,6 @@ import org.bukkit.inventory.meta.LeatherArmorMeta; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; @@ -43,7 +42,6 @@ import mineplex.core.common.util.UtilServer; import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.visibility.VisibilityManager; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; @@ -111,9 +109,7 @@ public class Paintball extends TeamGame "Revive/heal with Water Bombs", "Last team alive wins!" }); - - AprilFoolsManager.Instance.setEnabled(false); - + this.StrictAntiHack = true; this.HungerSet = 20; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 4cb753d7f..b00875e7b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -29,7 +29,6 @@ import org.bukkit.event.player.PlayerEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerItemHeldEvent; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; @@ -142,8 +141,6 @@ public class SheepGame extends TeamGame "Most sheep at 5 minutes wins!" }); - AprilFoolsManager.Instance.setEnabled(false); - this.DeathOut = false; this.DeathSpectateSecs = 6; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java index 0bebbb2c1..0f8f37712 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameChatManager.java @@ -2,7 +2,6 @@ package nautilus.game.arcade.managers; import java.util.Iterator; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; @@ -49,10 +48,6 @@ public class GameChatManager implements Listener Player sender = event.getPlayer(); String senderName = sender.getName(); - // April Fools - if (AprilFoolsManager.Instance.isActive()) - senderName = AprilFoolsManager.Instance.getName(sender); - //Dead Prefix String dead = ""; if (Manager.GetGame() != null) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java index b67c1e474..2337f1f77 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; -import mineplex.core.aprilfools.AprilFoolsManager; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; @@ -164,8 +163,7 @@ public class GameCreationManager implements Listener // Manager.GetAntiStack().SetEnabled(true); Manager.getCosmeticManager().setHideParticles(false); Manager.GetDamage().GetCombatManager().setUseWeaponName(AttackReason.CustomWeaponName); - AprilFoolsManager.Instance.setEnabled(true); - + HashMap pastTeams = null; //Chosen Game From f682bb8f9cae6a5ffba09817c672fb6082a0b597 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 12:10:02 +1100 Subject: [PATCH 16/43] fixed kit items not spawning horse pet doesnt spawn when dead --- .../src/mineplex/core/common/util/UtilEnt.java | 5 +++++ .../src/mineplex/core/common/util/UtilInv.java | 5 +++++ .../src/nautilus/game/arcade/kit/perks/PerkHorsePet.java | 5 ++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java index a502bd8e2..bf726be24 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java @@ -627,4 +627,9 @@ public class UtilEnt return null; } + + public static boolean inWater(LivingEntity ent) + { + return ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9; + } } diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java index d15e401f2..393922947 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilInv.java @@ -79,11 +79,16 @@ public class UtilInv for (ItemStack stack : getItems(player, checkArmor, checkCursor)) { if (required <= 0) + { return true; + } if (stack == null) continue; + if (stack.getType() != item) + continue; + if (stack.getAmount() <= 0) continue; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java index e08d1f22a..e6717a68f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHorsePet.java @@ -49,6 +49,9 @@ public class PerkHorsePet extends Perk public void spawnHorse(Player player, boolean baby) { + if (!Manager.GetGame().IsAlive(player)) + return; + Manager.GetGame().CreatureAllowOverride = true; Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class); Manager.GetGame().CreatureAllowOverride = false; @@ -181,7 +184,7 @@ public class PerkHorsePet extends Perk //Damage Event Manager.GetDamage().NewDamageEvent((Player)ent, event.GetDamagerEntity(true), event.GetProjectile(), - event.GetCause(), event.GetDamage() * 0.25, true, false, false, + event.GetCause(), event.GetDamage() * 0.5, true, false, false, UtilEnt.getName(event.GetDamagerEntity(true)), event.GetReason()); } From d4e8c0c9a6c01ed29e4320810aa5378b1176eb07 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 15:28:10 +1100 Subject: [PATCH 17/43] Added Respawn middle screen text Added Champs capture point mid screen text Fixed hitbox mults for projectiles Fixed inconsistent arrow damage Lots of Champions balance --- .../core/projectile/ProjectileManager.java | 18 +- .../core/projectile/ProjectileUser.java | 162 +++++++++--------- .../classcombat/Skill/Assassin/Assassin.java | 4 +- .../classcombat/Skill/Assassin/Blink.java | 7 +- .../classcombat/Skill/Assassin/Flash.java | 4 +- .../classcombat/Skill/Assassin/Recall.java | 4 +- .../Skill/Assassin/SilencingArrow.java | 2 +- .../Skill/Assassin/SmokeArrow.java | 2 +- .../classcombat/Skill/Assassin/SmokeBomb.java | 4 +- .../classcombat/Skill/Brute/BlockToss.java | 32 ++-- .../classcombat/Skill/Brute/Bloodlust.java | 85 ++++----- .../classcombat/Skill/Brute/Colossus.java | 6 +- .../Skill/Brute/CripplingBlow.java | 4 +- .../classcombat/Skill/Brute/DwarfToss.java | 30 ++-- .../classcombat/Skill/Brute/Overwhelm.java | 4 +- .../classcombat/Skill/Brute/WhirlwindAxe.java | 13 +- .../classcombat/Skill/Knight/AxeThrow.java | 4 +- .../Skill/Knight/DefensiveStance.java | 9 +- .../classcombat/Skill/Knight/Deflection.java | 4 +- .../classcombat/Skill/Knight/HiltSmash.java | 19 +- .../game/classcombat/Skill/Mage/Blizzard.java | 4 +- .../classcombat/Skill/Mage/IcePrison.java | 6 +- .../game/classcombat/Skill/Mage/Inferno.java | 4 +- .../classcombat/Skill/Mage/LifeBondsData.java | 3 +- .../classcombat/Skill/Mage/LightningOrb.java | 2 +- .../classcombat/Skill/Mage/StaticLazer.java | 17 +- .../game/classcombat/Skill/Mage/Void.java | 6 +- .../classcombat/Skill/Ranger/Agility.java | 4 +- .../classcombat/Skill/Ranger/Disengage.java | 55 ++++-- .../classcombat/Skill/Ranger/HealingShot.java | 4 +- .../classcombat/Skill/Ranger/HeavyArrows.java | 6 +- .../classcombat/Skill/Ranger/Longshot.java | 4 +- .../classcombat/Skill/Ranger/Overcharge.java | 2 +- .../Skill/Ranger/Sharpshooter.java | 5 +- .../Skill/Ranger/VitalitySpores.java | 5 +- .../classcombat/Skill/Ranger/WolfsPounce.java | 4 +- .../game/classcombat/Skill/SkillCharge.java | 20 +++ .../game/classcombat/Skill/SkillFactory.java | 8 +- .../game/core/damage/DamageManager.java | 11 +- .../nautilus/game/arcade/ArcadeManager.java | 4 +- .../common/dominate_data/CapturePoint.java | 2 + .../game/arcade/managers/GameFlagManager.java | 4 +- 42 files changed, 352 insertions(+), 245 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java index bf3b827b5..3355e945d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java @@ -35,15 +35,7 @@ public class ProjectileManager extends MiniPlugin { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, - null, 1f, 1f, null, 0, null, null, hitboxMult, null)); - } - - public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, - long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, double hitboxMult, DisguiseManager disguise) - { - _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, - expireTime, hitPlayer, hitBlock, idle, false, - null, 1f, 1f, null, 0, null, null, hitboxMult, disguise)); + null, 1f, 1f, null, 0, null, null, hitboxMult)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, @@ -51,7 +43,7 @@ public class ProjectileManager extends MiniPlugin { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, pickup, - null, 1f, 1f, null, 0, null, null, hitboxMult, null)); + null, 1f, 1f, null, 0, null, null, hitboxMult)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, @@ -60,7 +52,7 @@ public class ProjectileManager extends MiniPlugin { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, - sound, soundVolume, soundPitch, effect, effectData, effectRate, null, hitboxMult, null)); + sound, soundVolume, soundPitch, effect, effectData, effectRate, null, hitboxMult)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, @@ -69,7 +61,7 @@ public class ProjectileManager extends MiniPlugin { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, - sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, hitboxMult, null)); + sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, hitboxMult)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, @@ -78,7 +70,7 @@ public class ProjectileManager extends MiniPlugin { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, - sound, soundVolume, soundPitch, null, 0, effectRate, particle, hitboxMult, null)); + sound, soundVolume, soundPitch, null, 0, effectRate, particle, hitboxMult)); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java index 876a95580..9d2abf3cb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java @@ -3,6 +3,7 @@ package mineplex.core.projectile; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilParticle.ParticleType; @@ -48,14 +49,14 @@ public class ProjectileUser private int _effectData = 0; private UpdateType _effectRate = UpdateType.TICK; - private DisguiseManager _disguise; - + private double _hitboxMult; + public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate, ParticleType particle, - double hitboxMult, DisguiseManager disguise) + double hitboxMult) { Throw = throwInput; @@ -77,7 +78,7 @@ public class ProjectileUser _effectData = effectData; _effectRate = effectRate; - _disguise = disguise; + _hitboxMult = hitboxMult; } public void Effect(UpdateEvent event) @@ -104,90 +105,93 @@ public class ProjectileUser return true; } - double distanceToEntity = 0.0D; - LivingEntity victim = null; - - net.minecraft.server.v1_7_R4.Entity nmsEntity = ((CraftEntity)_thrown).getHandle(); - Vec3D vec3d = Vec3D.a(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ); - Vec3D vec3d1 = Vec3D.a(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ); - - MovingObjectPosition finalObjectPosition = nmsEntity.world.rayTrace(vec3d, vec3d1, false, true, false); - vec3d = Vec3D.a(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ); - vec3d1 = Vec3D.a(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ); + if (_hitPlayer) + { + double distanceToEntity = 0.0D; + LivingEntity victim = null; + + net.minecraft.server.v1_7_R4.Entity nmsEntity = ((CraftEntity)_thrown).getHandle(); + Vec3D vec3d = Vec3D.a(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ); + Vec3D vec3d1 = Vec3D.a(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ); + + MovingObjectPosition finalObjectPosition = nmsEntity.world.rayTrace(vec3d, vec3d1, false, true, false); + vec3d = Vec3D.a(nmsEntity.locX, nmsEntity.locY, nmsEntity.locZ); + vec3d1 = Vec3D.a(nmsEntity.locX + nmsEntity.motX, nmsEntity.locY + nmsEntity.motY, nmsEntity.locZ + nmsEntity.motZ); - if (finalObjectPosition != null) - { - vec3d1 = Vec3D.a(finalObjectPosition.pos.a, finalObjectPosition.pos.b, finalObjectPosition.pos.c); - } - - for (Object entity : ((CraftWorld)_thrown.getWorld()).getHandle().getEntities(((CraftEntity)_thrown).getHandle(), ((CraftEntity)_thrown).getHandle().boundingBox.a(((CraftEntity)_thrown).getHandle().motX, ((CraftEntity)_thrown).getHandle().motY, ((CraftEntity)_thrown).getHandle().motZ).grow(1.0D, 1.0D, 1.0D))) - { - if (entity instanceof net.minecraft.server.v1_7_R4.Entity) - { - Entity bukkitEntity = ((net.minecraft.server.v1_7_R4.Entity) entity).getBukkitEntity(); - - if (bukkitEntity instanceof LivingEntity) - { - LivingEntity ent = (LivingEntity)bukkitEntity; - - //Avoid Self - if (ent.equals(_thrower)) - continue; - - //Creative or Spec - if (ent instanceof Player) - if (((Player)ent).getGameMode() == GameMode.CREATIVE || UtilPlayer.isSpectator(ent)) + if (finalObjectPosition != null) + { + vec3d1 = Vec3D.a(finalObjectPosition.pos.a, finalObjectPosition.pos.b, finalObjectPosition.pos.c); + } + + for (Object entity : ((CraftWorld)_thrown.getWorld()).getHandle().getEntities(((CraftEntity)_thrown).getHandle(), + ((CraftEntity)_thrown).getHandle().boundingBox.a( + ((CraftEntity)_thrown).getHandle().motX, + ((CraftEntity)_thrown).getHandle().motY, + ((CraftEntity)_thrown).getHandle().motZ).grow(_hitboxMult, _hitboxMult, _hitboxMult))) + { + if (entity instanceof net.minecraft.server.v1_7_R4.Entity) + { + Entity bukkitEntity = ((net.minecraft.server.v1_7_R4.Entity) entity).getBukkitEntity(); + + if (bukkitEntity instanceof LivingEntity) + { + LivingEntity ent = (LivingEntity)bukkitEntity; + + //Avoid Self + if (ent.equals(_thrower)) continue; - - EntityType disguise = null; - if (_disguise != null && _disguise.getDisguise(ent) != null) - { - if (_disguise.getDisguise(ent) instanceof DisguiseSquid) - disguise = EntityType.SQUID; - } + + //Creative or Spec + if (ent instanceof Player) + if (((Player)ent).getGameMode() == GameMode.CREATIVE || UtilPlayer.isSpectator(ent)) + continue; - float f1 = (float)(nmsEntity.boundingBox.a() * .6); - AxisAlignedBB axisalignedbb1 = ((CraftEntity)ent).getHandle().boundingBox.grow(f1, f1, f1); - MovingObjectPosition entityCollisionPosition = axisalignedbb1.a(vec3d, vec3d1); - - if (entityCollisionPosition != null) - { - double d1 = vec3d.distanceSquared(entityCollisionPosition.pos); - if ((d1 < distanceToEntity) || (distanceToEntity == 0.0D)) + //float f1 = (float)(nmsEntity.boundingBox.a() * 0.6f); + AxisAlignedBB axisalignedbb1 = ((CraftEntity)ent).getHandle().boundingBox.grow(1F, 1F, 1F); + MovingObjectPosition entityCollisionPosition = axisalignedbb1.a(vec3d, vec3d1); + + if (entityCollisionPosition != null) { - victim = ent; - distanceToEntity = d1; + if (_thrower instanceof Player) + ((Player)_thrower).playSound(_thrower.getLocation(), Sound.ORB_PICKUP, 1f, 1.25f); + + double d1 = vec3d.distanceSquared(entityCollisionPosition.pos); + if ((d1 < distanceToEntity) || (distanceToEntity == 0.0D)) + { + victim = ent; + distanceToEntity = d1; + } } } - } - } - } - - if (victim != null) - { - finalObjectPosition = new MovingObjectPosition(((CraftLivingEntity)victim).getHandle()); + } + } - _callback.Collide(victim, null, this); - return true; - } - - if (finalObjectPosition != null) - { - if (_hitBlock) + if (victim != null) { - Block block = _thrown.getWorld().getBlockAt(finalObjectPosition.b, finalObjectPosition.c, finalObjectPosition.d); - if (!UtilBlock.airFoliage(block) && !block.isLiquid()) + finalObjectPosition = new MovingObjectPosition(((CraftLivingEntity)victim).getHandle()); + + _callback.Collide(victim, null, this); + return true; + } + + if (finalObjectPosition != null) + { + if (_hitBlock) { - nmsEntity.motX = ((float) (finalObjectPosition.pos.a - nmsEntity.locX)); - nmsEntity.motY = ((float) (finalObjectPosition.pos.b - nmsEntity.locY)); - nmsEntity.motZ = ((float) (finalObjectPosition.pos.c - nmsEntity.locZ)); - float f2 = MathHelper.sqrt(nmsEntity.motX * nmsEntity.motX + nmsEntity.motY * nmsEntity.motY + nmsEntity.motZ * nmsEntity.motZ); - nmsEntity.locX -= nmsEntity.motX / f2 * 0.0500000007450581D; - nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D; - nmsEntity.locZ -= nmsEntity.motZ / f2 * 0.0500000007450581D; - - _callback.Collide(null, block, this); - return true; + Block block = _thrown.getWorld().getBlockAt(finalObjectPosition.b, finalObjectPosition.c, finalObjectPosition.d); + if (!UtilBlock.airFoliage(block) && !block.isLiquid()) + { + nmsEntity.motX = ((float) (finalObjectPosition.pos.a - nmsEntity.locX)); + nmsEntity.motY = ((float) (finalObjectPosition.pos.b - nmsEntity.locY)); + nmsEntity.motZ = ((float) (finalObjectPosition.pos.c - nmsEntity.locZ)); + float f2 = MathHelper.sqrt(nmsEntity.motX * nmsEntity.motX + nmsEntity.motY * nmsEntity.motY + nmsEntity.motZ * nmsEntity.motZ); + nmsEntity.locX -= nmsEntity.motX / f2 * 0.0500000007450581D; + nmsEntity.locY -= nmsEntity.motY / f2 * 0.0500000007450581D; + nmsEntity.locZ -= nmsEntity.motZ / f2 * 0.0500000007450581D; + + _callback.Collide(null, block, this); + return true; + } } } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Assassin.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Assassin.java index 94dea13b0..62dc3852b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Assassin.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Assassin.java @@ -23,7 +23,7 @@ public class Assassin extends Skill SetDesc(new String[] { "Permanent Speed II.", - "Fall damage reduced by 1." + "Fall damage reduced by 1.5." }); } @@ -87,7 +87,7 @@ public class Assassin extends Skill int level = getLevel(player); if (level == 0) return; - event.AddMod(null, GetName(), -1, false); + event.AddMod(null, GetName(), -1.5, false); } @Override diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java index 7a1d5f331..66b2682dd 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java @@ -70,11 +70,14 @@ public class Blink extends SkillActive return false; } - //Mastery + //Deblink if (_loc.containsKey(player) && _blinkTime.containsKey(player)) if (!UtilTime.elapsed(_blinkTime.get(player), 5000)) { - Deblink(player, level); + //Require 500ms after blink to deblink + if (UtilTime.elapsed(_blinkTime.get(player), 500)) + Deblink(player, level); + return false; } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java index 9e3890b3c..58f2a0046 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Flash.java @@ -53,7 +53,7 @@ public class Flash extends SkillActive @Override public String GetRechargeString() { - return "Recharge: #11#-1 Seconds per Charge"; + return "Recharge: #10#-1 Seconds per Charge"; } @Override @@ -98,7 +98,7 @@ public class Flash extends SkillActive if (charges >= 1 + level) continue; - if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 11000 - (1000 * level), false, false)) + if (!mineplex.core.recharge.Recharge.Instance.use(cur, "Flash Recharge", 10000 - (1000 * level), false, false)) continue; _flash.put(cur, charges + 1); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java index 6c860f086..b15f4756c 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Recall.java @@ -46,7 +46,7 @@ public class Recall extends Skill @Override public String GetRechargeString() { - return "Recharge: #90#-15 Seconds"; + return "Recharge: #60#-10 Seconds"; } @EventHandler @@ -70,7 +70,7 @@ public class Recall extends Skill if (trigger.IsCancelled()) return; - if (!Recharge.Instance.use(player, GetName(), GetName(level), 90000 - (level * 15000), true, false)) + if (!Recharge.Instance.use(player, GetName(), GetName(level), 60000 - (level * 10000), true, false)) return; LinkedList locs = _locMap.remove(player); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SilencingArrow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SilencingArrow.java index 2af2d2345..2a9b18a2f 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SilencingArrow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SilencingArrow.java @@ -50,7 +50,7 @@ public class SilencingArrow extends SkillActive SetDesc(new String[] { "Your next arrow will Silence", - "target for #3#3 seconds.", + "target for #1#3 seconds.", "", "Silence stops skills being used." }); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeArrow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeArrow.java index 29135e56f..ad888f7d5 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeArrow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeArrow.java @@ -50,7 +50,7 @@ public class SmokeArrow extends SkillActive SetDesc(new String[] { "Your next arrow will give Blindness", - "to target for #3#1 seconds." + "to target for #4#1 seconds." }); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java index c7ddc4924..96de20042 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java @@ -46,7 +46,7 @@ public class SmokeBomb extends Skill @Override public String GetRechargeString() { - return "Recharge: #90#-15 Seconds"; + return "Recharge: #60#-10 Seconds"; } @EventHandler @@ -75,7 +75,7 @@ public class SmokeBomb extends Skill return; } - if (!Recharge.Instance.use(player, GetName(), GetName(level), 90000 - (level * 15000), true, false)) + if (!Recharge.Instance.use(player, GetName(), GetName(level), 60000 - (level * 10000), true, false)) return; //Action diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java index 8375c2ae5..b09e64c30 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java @@ -25,6 +25,7 @@ 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.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilServer; @@ -55,9 +56,6 @@ public class BlockToss extends SkillCharge implements IThrown "dealing up to #6#1 damage.", "", GetChargeString(), - "", - "You can only pick up Stone, Dirt,", - "Cobblestone, Sand, Gravel or Snow." }); } @@ -98,24 +96,22 @@ public class BlockToss extends SkillCharge implements IThrown UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water.")); return; } - + + Block grab = event.getClickedBlock(); + + if (!UtilBlock.solid(grab) || grab.getType() == Material.BEDROCK) + return; + //Recharge if (!Recharge.Instance.use(player, GetName(), 1000, false, false)) return; - - Block grab = event.getClickedBlock(); - - int id = event.getClickedBlock().getTypeId(); - - if ( - id != 1 && - id != 2 && - id != 3 && - id != 12 && - id != 13 && - id != 80) + + if (grab.getRelative(BlockFace.UP).getType() != Material.AIR) + { + UtilPlayer.message(player, F.main(GetName(), "You cannot grab this block.")); return; - + } + //Door if (grab.getRelative(BlockFace.UP).getTypeId() == 64 || grab.getRelative(BlockFace.UP).getTypeId() == 71) { @@ -240,7 +236,7 @@ public class BlockToss extends SkillCharge implements IThrown //Damage Event Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, - DamageCause.CUSTOM, data.GetThrown().getVelocity().length() * (2.5 + 0.5 * level), true, true, false, + DamageCause.CUSTOM, data.GetThrown().getVelocity().length() * (3 + 0.6 * level), true, true, false, UtilEnt.getName(data.GetThrower()), GetName()); //Block to Item diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Bloodlust.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Bloodlust.java index f857bad86..1101d4d65 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Bloodlust.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Bloodlust.java @@ -8,6 +8,8 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import com.mysql.jdbc.Util; + import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.core.common.util.F; import mineplex.core.updater.event.UpdateEvent; @@ -32,9 +34,9 @@ public class Bloodlust extends Skill SetDesc(new String[] { - "When an enemy dies within #8#2 blocks,", - "you go into a Bloodlust, receiving", - "Speed 1 and Strength 1 for #4#2 seconds.", + "When you kill an enemy, you go into", + "a Bloodlust, receiving Speed 1 and", + "Strength 1 for #4#2 seconds.", "You also heal #0#1 health.", "", "Bloodlust can stack up to 3 times,", @@ -47,50 +49,53 @@ public class Bloodlust extends Skill { if (!(event.GetEvent().getEntity() instanceof Player)) return; + + if (event.GetLog().GetKiller() == null || !event.GetLog().GetKiller().IsPlayer()) + return; - for (Player cur : UtilServer.getPlayers()) - { - if (Expire(cur)) - continue; + Player player = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName()); + if (player == null) + return; - if (!Factory.Relation().canHurt(cur, (Player)event.GetEvent().getEntity())) - continue; - - if (cur.equals(event.GetEvent().getEntity())) - continue; + if (!Factory.Relation().canHurt(player, (Player)event.GetEvent().getEntity())) + return; - //Level - int level = getLevel(cur); - if (level == 0) continue; + if (player.equals(event.GetEvent().getEntity())) + return; - //Offset - double distance = 4 + (4 * level); - if (UtilMath.offset(event.GetEvent().getEntity().getLocation(), cur.getLocation()) > distance) - continue; + //Level + int level = getLevel(player); + if (level == 0) + return; + + //Offset + double distance = 4 + (4 * level); + if (UtilMath.offset(event.GetEvent().getEntity().getLocation(), player.getLocation()) > distance) + return; - //Strength - int str = 0; - if (_str.containsKey(cur)) - str = _str.get(cur) + 1; - str = Math.min(str, 3); - _str.put(cur, str); + //Strength + int str = 0; + if (_str.containsKey(player)) + str = _str.get(player) + 1; + str = Math.min(str, 2); + _str.put(player, str); - //Time - double dur = 4 + (2 * level); - _time.put(cur, (System.currentTimeMillis() + (long)(dur*1000))); + //Time + double dur = 4 + (2 * level); + _time.put(player, (System.currentTimeMillis() + (long)(dur*1000))); - //Condition - Factory.Condition().Factory().Speed(GetName(), cur, event.GetEvent().getEntity(), dur, str, false, true, true); - Factory.Condition().Factory().Strength(GetName(), cur, event.GetEvent().getEntity(), dur, 0, false, true, true); + //Condition + Factory.Condition().Factory().Speed(GetName(), player, event.GetEvent().getEntity(), dur, str, false, true, true); + Factory.Condition().Factory().Strength(GetName(), player, event.GetEvent().getEntity(), dur, 0, false, true, true); - UtilPlayer.health(cur, level); - - //Inform - UtilPlayer.message(cur, F.main(GetClassType().name(), "You entered " + F.skill(GetName(level)) + " at " + F.elem("Level " + (str+1)) + ".")); + UtilPlayer.health(player, level); + + //Inform + UtilPlayer.message(player, F.main(GetClassType().name(), "You entered " + F.skill(GetName(level)) + " at " + F.elem("Level " + (str+1)) + ".")); + + //Effect + player.getWorld().playSound(player.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 2f, 0.6f); - //Effect - cur.getWorld().playSound(cur.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 2f, 0.6f); - } } @EventHandler @@ -120,13 +125,13 @@ public class Bloodlust extends Skill return false; } - + @EventHandler public void Particle(UpdateEvent event) { if (event.getType() != UpdateType.TICK) return; - + for (Entity ent : _str.keySet()) { UtilParticle.PlayParticle(ParticleType.RED_DUST, ent.getLocation(), diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Colossus.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Colossus.java index e19886d4a..86074595b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Colossus.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Colossus.java @@ -17,8 +17,8 @@ public class Colossus extends Skill SetDesc(new String[] { - "You are so huge that you do not", - "take any knockback from attacks." + "You are so huge that you take", + "#25#25 % less knockback from attacks." }); } @@ -36,7 +36,7 @@ public class Colossus extends Skill //Damage event.AddMod(damagee.getName(), GetName(), 0, false); - event.SetKnockback(false); + event.AddKnockback(GetName(), 0.75 - 0.25*level); } @Override diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java index 9d85fd230..252d4cd22 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/CripplingBlow.java @@ -23,7 +23,7 @@ public class CripplingBlow extends Skill SetDesc(new String[] { "Your powerful axe attacks give", - "targets Slow 1 for 1.5 second,", + "targets Slow 2 for 1.5 second,", "as well as no knockback." }); } @@ -53,7 +53,7 @@ public class CripplingBlow extends Skill if (level == 0) return; //Stun - Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * 1, 0, false, true, false, true); + Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * 1, 1, false, true, false, true); //Damage event.AddMod(damager.getName(), GetName(), 0, true); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java index b078c8a9b..e9236c01e 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/DwarfToss.java @@ -2,6 +2,7 @@ package mineplex.minecraft.game.classcombat.Skill.Brute; import java.util.HashSet; +import org.bukkit.Bukkit; import org.bukkit.EntityEffect; import org.bukkit.GameMode; import org.bukkit.Material; @@ -298,28 +299,37 @@ public class DwarfToss extends SkillActive UtilPlayer.message(cur, F.main(GetClassType().name(), F.name(UtilEnt.getName(target)) + " escaped your " + F.skill(GetName(level)) + ".")); } - for (Player cur : throwSet) + for (final Player cur : throwSet) { - LivingEntity target = _holding.remove(cur); + final LivingEntity target = _holding.remove(cur); _time.remove(cur); int level = getLevel(cur); //Throw cur.eject(); target.leaveVehicle(); - double mult = 1.2 + (0.2 * level); + final double mult = 1.2 + (0.2 * level); - UtilAction.velocity(target, cur.getLocation().getDirection(), mult, false, 0, 0.2, 1.2, true); - - //Condition - Factory.Condition().Factory().Falling(GetName(), target, cur, 10, false, true); + //Delay + Bukkit.getScheduler().scheduleSyncDelayedTask(Factory.getPlugin(), new Runnable() + { + @Override + public void run() + { + UtilAction.velocity(target, cur.getLocation().getDirection(), mult, false, 0, 0.2, 1.2, true); + + //Condition + Factory.Condition().Factory().Falling(GetName(), target, cur, 10, false, true); + + //Effect + target.playEffect(EntityEffect.HURT); + } + + }, 4); //Inform UtilPlayer.message(cur, F.main(GetClassType().name(), "You threw " + F.name(UtilEnt.getName(target)) + " with " + F.skill(GetName(level)) + ".")); UtilPlayer.message(target, F.main(GetClassType().name(), F.name(cur.getName()) + " threw you with " + F.skill(GetName(level)) + ".")); - - //Effect - target.playEffect(EntityEffect.HURT); } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Overwhelm.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Overwhelm.java index dd16ffaca..50001ce48 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Overwhelm.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/Overwhelm.java @@ -23,7 +23,7 @@ public class Overwhelm extends Skill "than your target, you deal 0.25", "bonus damage", "", - "Maximum of #0#1 bonus damage." + "Maximum of #0.5#0.5 bonus damage." }); } @@ -52,7 +52,7 @@ public class Overwhelm extends Skill int level = getLevel(damager); if (level == 0) return; - diff = Math.min(diff, level); + diff = Math.min(diff, 0.5 + 0.5 * level); //Damage event.AddMod(damager.getName(), GetName(), diff, true); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/WhirlwindAxe.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/WhirlwindAxe.java index 8c93a2b43..ec172fd73 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/WhirlwindAxe.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/WhirlwindAxe.java @@ -42,9 +42,8 @@ public class WhirlwindAxe extends SkillActive SetDesc(new String[] { "Whirl your axes around rapidly dealing", - "#4#1 damage to nearby enemies, and", - "pulling enemies within #5#1 blocks", - "towards you.", + "up to #3#1 damage to enemies within", + "#4#1 blocks, pulling them towards you.", }); this.setAchievementSkill(true); @@ -66,17 +65,21 @@ public class WhirlwindAxe extends SkillActive public void Skill(final Player player, int level) { //Pull + Damage - HashMap targets = UtilEnt.getInRadius(player.getLocation(), 5d + 1 * level); + HashMap targets = UtilEnt.getInRadius(player.getLocation(), 4d + 1 * level); for (LivingEntity cur : targets.keySet()) { if (cur.equals(player)) continue; + if (cur instanceof Player) + if (!Factory.Relation().canHurt((Player)cur, player)) + continue; + //Damage Event if (UtilMath.offset(cur, player) < 4) { Factory.Damage().NewDamageEvent(cur, player, null, - DamageCause.CUSTOM, 4 + level, false, true, false, + DamageCause.CUSTOM, 2 + (1 + level) * targets.get(cur), false, true, false, player.getName(), GetName()); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java index daf1b4245..478392b57 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java @@ -59,7 +59,7 @@ public class AxeThrow extends SkillActive implements IThrown "collides with anything.", "", "Your axe is returned to you if you do", - "not pick it up within #20#-2 seconds." + "not pick it up within #15#-1 seconds." }); setAchievementSkill(true); @@ -186,7 +186,7 @@ public class AxeThrow extends SkillActive implements IThrown int level = getLevel(player); - if (item.getTicksLived() > 400 - level * 40) + if (item.getTicksLived() > 300 - level * 40) { _thrown.get(item).getInventory().addItem(item.getItemStack()); item.remove(); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/DefensiveStance.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/DefensiveStance.java index 24819aabb..5935feefe 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/DefensiveStance.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/DefensiveStance.java @@ -15,6 +15,7 @@ import org.bukkit.util.Vector; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilTime; import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; @@ -85,6 +86,9 @@ public class DefensiveStance extends SkillActive if (event.GetCause() != DamageCause.ENTITY_ATTACK && event.GetCause() != DamageCause.PROJECTILE) return; + + if (UtilEnt.inWater(event.GetDamageeEntity())) + return; Player damagee = event.GetDamageePlayer(); if (damagee == null) return; @@ -112,7 +116,10 @@ public class DefensiveStance extends SkillActive } //Damage - event.SetCancelled(GetName() + " Defense"); + if (event.GetCause() == DamageCause.ENTITY_ATTACK) + event.AddMult(GetName(), GetName(), 0.1, false); + else + event.SetCancelled(GetName() + " Defense"); //Effect damagee.getWorld().playSound(damagee.getLocation(), Sound.ZOMBIE_METAL, 1f, 2f); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Deflection.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Deflection.java index 75bae265b..32b148220 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Deflection.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/Deflection.java @@ -29,7 +29,7 @@ public class Deflection extends Skill { "Prepare to deflect incoming attacks.", "You gain 1 Charge every #5#-1 seconds.", - "You can store a maximum of #2#1 Charges.", + "You can store a maximum of #1#1 Charges.", "", "When you are attacked, the damage is", "reduced by the number of your Charges,", @@ -73,7 +73,7 @@ public class Deflection extends Skill if (!Recharge.Instance.use(cur, GetName(), 5000 - (1000 * level), false, false)) continue; - int max = 2 + (1 * level); + int max = 1 + (1 * level); int charge = 1; if (_charges.containsKey(cur)) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java index 6979bbcff..9e743cea2 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/HiltSmash.java @@ -17,6 +17,7 @@ import mineplex.minecraft.game.core.damage.CustomDamageEvent; import mineplex.core.common.util.F; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; @@ -46,13 +47,19 @@ public class HiltSmash extends SkillActive { "Smash the hilt of your sword into", "your opponent, dealing #2#1 damage", - "and Slow 4 for #0.5#0.5 seconds." + "and Slow 3 for #0.5#0.5 seconds." }); } @Override public boolean CustomCheck(Player player, int level) { + if (UtilEnt.inWater(player)) + { + UtilPlayer.message(player, F.main("Skill", "You cannot use " + F.skill(GetName()) + " in water.")); + return false; + } + if (_used.contains(player)) return false; @@ -111,6 +118,9 @@ public class HiltSmash extends SkillActive { if (event.isCancelled()) return; + + if (UtilEnt.inWater(event.getPlayer())) + return; Player player = event.getPlayer(); @@ -123,12 +133,15 @@ public class HiltSmash extends SkillActive Entity ent = event.getRightClicked(); + if (UtilPlayer.isSpectator(ent)) + return; + if (ent == null) return; if (!(ent instanceof LivingEntity)) return; - + if (UtilMath.offset(player, ent) > 4) { UtilPlayer.message(player, F.main(GetClassType().name(), "You missed " + F.skill(GetName()) + ".")); @@ -169,7 +182,7 @@ public class HiltSmash extends SkillActive return; //Condition - Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * level, 4, false, true, true, true); + Factory.Condition().Factory().Slow(GetName(), damagee, damager, 0.5 + 0.5 * level, 2, false, true, true, true); //Effect damagee.getWorld().playSound(damagee.getLocation(), Sound.ZOMBIE_WOOD, 1f, 1.2f); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java index 83782befe..b95d909fb 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java @@ -66,7 +66,7 @@ public class Blizzard extends SkillActive @Override public String GetEnergyString() { - return "Energy: #32#-2 per Second"; + return "Energy: #34#-2 per Second"; } @Override @@ -113,7 +113,7 @@ public class Blizzard extends SkillActive } //Energy - if (!Factory.Energy().Use(cur, GetName(), 1.6 - (0.1 * level), true, true)) + if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, true)) { _active.remove(cur); continue; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java index 592c595f8..2b56bba57 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java @@ -71,10 +71,10 @@ public class IcePrison extends SkillActive implements IThrown Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(79)); item.setVelocity(player.getLocation().getDirection()); Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 2000, true, false, false, - Sound.FIZZ, 0.6f, 1.6f, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 2d); - + Sound.FIZZ, 0.6f, 1.6f, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 1.5d); + //Inform - UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); + UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); //Effect item.getWorld().playSound(item.getLocation(), Sound.SILVERFISH_HIT, 2f, 1f); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java index 1fb9140b6..cced308da 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Inferno.java @@ -53,7 +53,7 @@ public class Inferno extends SkillActive @Override public String GetEnergyString() { - return "Energy: #30#-2 per Second"; + return "Energy: #34#-2 per Second"; } @Override @@ -100,7 +100,7 @@ public class Inferno extends SkillActive } //Energy - if (!Factory.Energy().Use(cur, GetName(), 1.5 - (0.1 * level), true, false)) + if (!Factory.Energy().Use(cur, GetName(), 1.7 - (0.1 * level), true, false)) { _active.remove(cur); continue; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBondsData.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBondsData.java index 62b15b37b..a2a54c0fa 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBondsData.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LifeBondsData.java @@ -33,8 +33,7 @@ public class LifeBondsData return true; } - - _loc.add(UtilAlg.getTrajectory(_loc, _target.getLocation().add(0, 0.8, 0)).multiply(0.5)); + _loc.add(UtilAlg.getTrajectory(_loc, _target.getLocation().add(0, 0.8, 0)).multiply(0.9)); UtilParticle.PlayParticle(ParticleType.HEART, _loc, 0, 0, 0, 0, 1); return false; diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java index c7119f0b1..b7e3f3b00 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java @@ -102,7 +102,7 @@ public class LightningOrb extends SkillActive implements IThrown Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(57)); item.setVelocity(player.getLocation().getDirection()); Factory.Projectile().AddThrow(item, player, this, System.currentTimeMillis() + 5000 - (400 * level), true, false, false, - Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 1.5d); + Sound.FIZZ, 0.6f, 1.6f, ParticleType.FIREWORKS_SPARK, UpdateType.TICK, 2d); //Inform UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(level)) + ".")); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/StaticLazer.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/StaticLazer.java index 10e364d40..7c343e2d6 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/StaticLazer.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/StaticLazer.java @@ -33,7 +33,7 @@ public class StaticLazer extends SkillChargeSword int cost, int maxLevel) { super(skills, name, classType, skillType, cost, maxLevel, - 0.012f, 0.008f, + 0.012f, 0.004f, 12000, -1000, true, true, false, true); @@ -45,11 +45,12 @@ public class StaticLazer extends SkillChargeSword GetChargeString(), "Taking damage cancels charge.", "", - "Deals up to #7#1 damage and travels", - "up to #20#10 blocks.", + "Deals #6#1 damage and travels up to", + "#20#10 blocks.", }); - _fireOnFull = true; + _fireOnFull = false; + _energyPerCharge = 1.2f; setAchievementSkill(true); } @@ -58,6 +59,12 @@ public class StaticLazer extends SkillChargeSword { return "Recharge: " + "#12#-1 Seconds"; } + + @Override + public String GetEnergyString() + { + return "Energy: " + "24 per Second"; + } @Override public void DoSkillCustom(Player player, float charge) @@ -105,7 +112,7 @@ public class StaticLazer extends SkillChargeSword //Damage Event Factory.Damage().NewDamageEvent(other, player, null, - DamageCause.CUSTOM, (2 + (5 + level) * hit.get(other)) * charge, true, true, false, + DamageCause.CUSTOM, 6 + level * charge, true, true, false, player.getName(), GetName()); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Void.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Void.java index 149ae1336..950ce0293 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Void.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Void.java @@ -33,7 +33,7 @@ public class Void extends Skill "Drop Axe/Sword to Toggle.", "", "While in void form, you receive", - "Slow 2, take no knockback and", + "Slow 3, take no knockback and", "use no energy to swing weapons.", "", "Reduces incoming damage by #1#1 , but", @@ -144,8 +144,8 @@ public class Void extends Skill continue; //Condition - Factory.Condition().Factory().Invisible(GetName(), cur, cur, 1.9, 0, false, true, true); - Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 1, false, true, false, true); + Factory.Condition().Factory().Invisible(GetName(), cur, cur, 1.9, 1, false, true, true); + Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 2, false, true, false, true); } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java index fb2a899f3..aff5b5bc0 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Agility.java @@ -45,7 +45,7 @@ public class Agility extends SkillActive SetDesc(new String[] { "Sprint with great agility, gaining", - "Speed I for #3#1 seconds. You take", + "Speed 2 for #3#1 seconds. You take", "#45#5 % less damage and take no knockback.", "", "Agility ends if you Left-Click." @@ -68,7 +68,7 @@ public class Agility extends SkillActive public void Skill(Player player, int level) { //Action - Factory.Condition().Factory().Speed(GetName(), player, player, 3 + level, 0, false, true, true); + Factory.Condition().Factory().Speed(GetName(), player, player, 3 + level, 1, false, true, true); _active.add(player); //Inform diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Disengage.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Disengage.java index 231db08bb..a5e872bcb 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Disengage.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Disengage.java @@ -21,6 +21,7 @@ import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; @@ -28,7 +29,8 @@ import mineplex.minecraft.game.classcombat.Skill.SkillFactory; public class Disengage extends SkillActive { private HashMap _prepare = new HashMap(); - + private HashMap _fall = new HashMap(); + public Disengage(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels, int energy, int energyMod, @@ -118,8 +120,10 @@ public class Disengage extends SkillActive //Condition Factory.Condition().Factory().Slow(GetName(), damager, damagee, 2.5 + (0.5 * level), 3, false, true, true, true); - Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 2, false, false); + Factory.Condition().Factory().Invulnerable(GetName(), damagee, damagee, 1, false, false); + _fall.put(damagee, System.currentTimeMillis()); + //Effect damagee.getWorld().playSound(damager.getLocation(), Sound.ZOMBIE_METAL, 0.5f, 1.6f); UtilParticle.PlayParticle(ParticleType.ANGRY_VILLAGER, damager.getEyeLocation(), 0, 0, 0, 0, 1); @@ -135,26 +139,53 @@ public class Disengage extends SkillActive { if (event.getType() != UpdateType.TICK) return; - + for (Player cur : GetUsers()) { - if (!_prepare.containsKey(cur)) - continue; - - if (System.currentTimeMillis() > _prepare.get(cur)) + if (_fall.containsKey(cur)) { - //Remove - _prepare.remove(cur); - - //Inform - UtilPlayer.message(cur, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + ".")); + if (UtilTime.elapsed(_fall.get(cur), 2000)) + { + if (UtilEnt.isGrounded(cur) || UtilTime.elapsed(_fall.get(cur), 20000)) + { + _fall.remove(cur); + } + } } + + if (_prepare.containsKey(cur)) + { + if (System.currentTimeMillis() > _prepare.get(cur)) + { + //Remove + _prepare.remove(cur); + + //Inform + UtilPlayer.message(cur, F.main(GetClassType().name(), "You failed to " + F.skill(GetName()) + ".")); + } + } + } + } + + @EventHandler(priority = EventPriority.LOW) + public void fallCancel(CustomDamageEvent event) + { + if (event.IsCancelled()) + return; + + if (event.GetCause() != DamageCause.FALL) + return; + + if (_fall.remove(event.GetDamageeEntity()) != null) + { + event.SetCancelled(GetName() + " Fall"); } } @Override public void Reset(Player player) { + _fall.remove(player); _prepare.remove(player); } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HealingShot.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HealingShot.java index c29eb1021..8a92aea48 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HealingShot.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HealingShot.java @@ -55,7 +55,7 @@ public class HealingShot extends SkillActive { "Prepare a healing shot;", "Your next arrow will give its target", - "Regeneration 1 for #2#2 seconds,", + "Regeneration 2 for #3#2 seconds,", "and remove all negative effects." }); } @@ -148,7 +148,7 @@ public class HealingShot extends SkillActive projectile.remove(); //Regen - Factory.Condition().Factory().Regen(GetName(), damagee, damager, 2 + 2 * level, 0, false, true, true); + Factory.Condition().Factory().Regen(GetName(), damagee, damager, 3 + 2 * level, 1, false, true, true); //Remove Bad damagee.setFireTicks(0); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HeavyArrows.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HeavyArrows.java index 6f1a142cd..9848193ed 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HeavyArrows.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/HeavyArrows.java @@ -39,7 +39,7 @@ public class HeavyArrows extends Skill "as well as #1#1 additional damage.", "", "You also receive #10#10 % knockback", - "when firing arrows.", + "when firing arrows if not sneaking.", }); } @@ -59,11 +59,11 @@ public class HeavyArrows extends Skill if (level == 0) return; //Backboost - if (Recharge.Instance.use(player, GetName(), 500, false, false)) + if (!player.isSneaking() && Recharge.Instance.use(player, GetName(), 750, false, false)) { double vel = (event.getProjectile().getVelocity().length() * (0.1 + 0.1 * level)); UtilAction.velocity(player, player.getLocation().getDirection().multiply(-1), vel, - false, 0, 0.2, 0.6, true); + false, 0, 0.3, 0.6, true); } //Decrease Speed diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Longshot.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Longshot.java index a3abf916e..102f8110e 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Longshot.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Longshot.java @@ -25,7 +25,7 @@ public class Longshot extends Skill SetDesc(new String[] { "Arrows do an additional 1 damage", "for every #4#-0.5 Blocks they travelled,", - "however, their base damage is", "reduced by 3.", "", "Maximum of #5#5 additional damage." + "however, their base damage is", "reduced by 3.", "", "Maximum of #6#6 additional damage." }); } @@ -70,7 +70,7 @@ public class Longshot extends Skill double length = UtilMath.offset(loc, projectile.getLocation()); // Damage - double damage = Math.min(5 + 5 * level, (length / (4 - 0.5 * level)) - 3); + double damage = Math.min(6 + 6 * level, (length / (4 - 0.5 * level)) - 3); event.AddMod(damager.getName(), GetName(), damage, damage > 0); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Overcharge.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Overcharge.java index e4e71d223..88412d922 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Overcharge.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Overcharge.java @@ -40,7 +40,7 @@ public class Overcharge extends SkillChargeBow "", GetChargeString(), "", - "Deals up to #0#1 bonus damage." + "Deals up to #1.5#1.5 bonus damage." }); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java index 5fa378428..6946be806 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/Sharpshooter.java @@ -72,7 +72,10 @@ public class Sharpshooter extends Skill Player player = _arrows.remove(projectile); int level = getLevel(player); - + + if (event.GetDamagerEntity(true) != null && event.GetDamagerEntity(true).equals(event.GetDamageeEntity())) + return; + if (_hitCount.containsKey(player)) { //Damage diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java index 55abc63f9..fa39af241 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java @@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler; import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.UpdateType; +import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; @@ -40,12 +41,12 @@ public class VitalitySpores extends Skill int level = getLevel(cur); if (level == 0) continue; - if (UtilTime.elapsed(Factory.Combat().Get(cur).GetLastDamaged(), 12000 - 2000*level)) + if (UtilTime.elapsed(Factory.Combat().Get(cur).GetLastDamaged(), 5000 - 1000*level)) { //Factory.Condition().Factory().Regen(GetName(), cur, cur, 3.9 + 2*level, 0, false, true, true); UtilPlayer.health(cur, 1); - UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation(), 0, 0.2f, 0, 0, 1); + UtilParticle.PlayParticle(ParticleType.HEART, cur.getEyeLocation().add(UtilAlg.getBehind(cur.getLocation().getDirection().multiply(0.5))), 0, 0.2f, 0, 0, 1); } } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java index dd6753902..5a827d651 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/WolfsPounce.java @@ -33,7 +33,7 @@ public class WolfsPounce extends SkillChargeSword { super(skills, name, classType, skillType, cost, maxLevel, 0.012f, 0.008f, - 7000, -1000, true, true, + 8000, -1000, true, true, false, false); SetDesc(new String[] @@ -88,7 +88,7 @@ public class WolfsPounce extends SkillChargeSword if (!_live.containsKey(player)) continue; - if (!UtilTime.elapsed(_live.get(player), 2000)) + if (!UtilTime.elapsed(_live.get(player), 1000)) continue; _live.remove(player); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillCharge.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillCharge.java index 2825c5f93..9925302f8 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillCharge.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillCharge.java @@ -14,6 +14,8 @@ public class SkillCharge extends Skill protected float _rateBase; protected float _rateBoost; + protected float _energyPerCharge = 0; + public SkillCharge(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int maxLevel, float base, float boost) @@ -36,6 +38,24 @@ public class SkillCharge extends Skill _charge.put(player, 0f); float charge = _charge.get(player); + + if (charge >= 1) + { + //Display + DisplayProgress(player, GetName(level), charge); + return true; + } + + //Energy + if (_energyPerCharge > 0) + { + if (!Factory.Energy().Use(player, GetName(), _energyPerCharge, true, false)) + { + //Display + DisplayProgress(player, GetName(level), charge); + return true; + } + } //Increase Charge charge = Math.min(1f, charge + _rateBase + (_rateBoost * level)); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java index 543e45572..bae3ebf03 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java @@ -171,7 +171,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new Illusion(this, "Illusion", ClassType.Assassin, SkillType.Sword, 1, 4, 50, -4, - 20000, -1000, true, + 17000, -1000, true, new Material[] {Material.IRON_SWORD, Material.GOLD_SWORD, Material.DIAMOND_SWORD}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); @@ -193,7 +193,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new Leap(this, "Leap", ClassType.Assassin, SkillType.Axe, 1, 4, 36, -3, - 9500, -1500, true, + 10500, -1500, true, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); @@ -282,7 +282,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory //Passive B AddSkill(new CripplingBlow(this, "Crippling Blow", ClassType.Brute, SkillType.PassiveB, 2, 1)); - AddSkill(new Colossus(this, "Colossus", ClassType.Brute, SkillType.PassiveB, 2, 1)); + AddSkill(new Colossus(this, "Colossus", ClassType.Brute, SkillType.PassiveB, 1, 3)); AddSkill(new Overwhelm(this, "Overwhelm", ClassType.Brute, SkillType.PassiveB, 1, 3)); } @@ -386,7 +386,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new FireBlast(this, "Fire Blast", ClassType.Mage, SkillType.Axe, 1, 5, 60, -3, - 11000, -1000, true, + 13000, -1000, true, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java index 5cd36efd5..69a258f60 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java @@ -21,6 +21,7 @@ import net.minecraft.server.v1_7_R4.DamageSource; import net.minecraft.server.v1_7_R4.EntityHuman; import net.minecraft.server.v1_7_R4.EntityLiving; +import org.bukkit.Bukkit; import org.bukkit.EntityEffect; import org.bukkit.GameMode; import org.bukkit.Location; @@ -99,9 +100,17 @@ public class DamageManager extends MiniPlugin //Pre-Event Modifications if (!DisableDamageChanges) WeaponDamage(event, damager); + + double damage = event.getDamage(); + + //Consistent Arrow Damage + if (projectile != null && projectile instanceof Arrow) + { + damage = projectile.getVelocity().length() * 3; + } //New Event - NewDamageEvent(damagee, damager, projectile, event.getCause(), event.getDamage(), true, false, false, null, null, preCancel); + NewDamageEvent(damagee, damager, projectile, event.getCause(), damage, true, false, false, null, null, preCancel); //System.out.println(UtilEnt.getName(damagee) + " by " + event.getCause() + " at " + UtilWorld.locToStr(damagee.getLocation())); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 3c710989d..13aab5ea5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -115,7 +115,7 @@ import nautilus.game.arcade.shop.ArcadeShop; public class ArcadeManager extends MiniPlugin implements IRelation { - // Modules + // Modules private BlockRestore _blockRestore; private Blood _blood; private Chat _chat; @@ -131,7 +131,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation private Fire _fire; private ProjectileManager _projectileManager; - private Portal _portal; + private Portal _portal; private ArcadeShop _arcadeShop; //Champions Modules diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java index ba8a84196..ac022741b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/common/dominate_data/CapturePoint.java @@ -301,6 +301,8 @@ public class CapturePoint RewardCapture(player, 30); } } + + UtilTextMiddle.display(null, _owner.GetColor() + _owner.GetName() + " captured " + _name, 5, 40, 5); } } //Count Down diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 8fdc41db5..7a7c00480 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -11,6 +11,7 @@ import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; import mineplex.core.teleport.event.MineplexTeleportEvent; @@ -713,6 +714,7 @@ public class GameFlagManager implements Listener UtilAction.velocity(player, new Vector(0,0,0), 1, true, 0.4, 0, 1, true); UtilPlayer.message(player, C.cWhite + C.Bold + "You will respawn in " + time + " seconds..."); + UtilTextMiddle.display(null, "Respawning in " + time + " seconds...", 5, 40, 5, player); Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable() { @@ -727,7 +729,7 @@ public class GameFlagManager implements Listener { Manager.addSpectator(player, true); } - + player.setFireTicks(0); player.setVelocity(new Vector(0,0,0)); } From 437c70e548cdf04c992f1b9228414b45661f5284 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 2 Apr 2015 23:36:16 -0700 Subject: [PATCH 18/43] Fixed issue with double run() call in loadClientByName. --- .../mineplex/core/account/CoreClientManager.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java index f0715f5c7..88aafb1af 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java @@ -220,7 +220,13 @@ public class CoreClientManager extends MiniPlugin if (client.getAccountId() > 0) _accountCacheRepository.addElement(new AccountCache(uuid, client.getAccountId())); - + } + catch (Exception exception) + { + exception.printStackTrace(); + } + finally + { Bukkit.getServer().getScheduler().runTask(getPlugin(), new Runnable() { public void run() @@ -230,14 +236,6 @@ public class CoreClientManager extends MiniPlugin } }); } - catch (Exception exception) - { - exception.printStackTrace(); - } - finally - { - runnable.run(); - } } }); } From fb4be35dfe98fa547738fa6d6227f82d9f3ca51d Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 2 Apr 2015 23:36:54 -0700 Subject: [PATCH 19/43] Let admins apply youtube rank. Limit Lobby count to 250. --- .../src/mineplex/core/account/command/UpdateRank.java | 2 +- .../src/mineplex/servermonitor/ServerMonitor.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java index 7a7dbf3f9..7bf400dd2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/command/UpdateRank.java @@ -52,7 +52,7 @@ public class UpdateRank extends CommandBase final Rank rank = tempRank; - if ((rank == Rank.YOUTUBE && Plugin.Get(caller).GetRank().Has(Rank.OWNER)) || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR) + if (rank == Rank.YOUTUBE || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR) { Plugin.getRepository().matchPlayerName(new Callback>() { diff --git a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java index bdcca216a..1d9306bb3 100644 --- a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java +++ b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java @@ -427,6 +427,7 @@ public class ServerMonitor if (availableSlots < 1500) { serversToAdd = Math.max(1, (1500 - availableSlots) / serverGroup.getMaxPlayers()); + serversToAdd = Math.min(250 - totalServers, serversToAdd); serversToKill = 0; } else if (serversToKill > 0) @@ -439,6 +440,8 @@ public class ServerMonitor if (serversToRestart <= 5) serversToRestart = 0; } + + } else if (serverGroup.getName().equalsIgnoreCase("Halloween")) { From 120420d35f030a1027ff119effe290119e4de9d1 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 2 Apr 2015 23:37:43 -0700 Subject: [PATCH 20/43] Really fixed disguise memory leak this time. --- .../src/mineplex/core/disguise/DisguiseManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 83373899c..b3567a3e6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -1009,6 +1009,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler } } + @EventHandler public void cleanDisguises(UpdateEvent event) { if (event.getType() != UpdateType.SLOWER || _disguisePlayerMap.isEmpty()) @@ -1018,7 +1019,12 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { DisguiseBase disguise = disguiseIterator.next(); - if (disguise.GetEntity() instanceof Player && (!((Player)disguise.GetEntity()).isOnline() || !((Player)disguise.GetEntity()).isValid())) + if (!(disguise.GetEntity() instanceof EntityPlayer)) + continue; + + EntityPlayer disguisedPlayer = (EntityPlayer)disguise.GetEntity(); + + if (Bukkit.getPlayerExact(disguisedPlayer.getName()) == null || !disguisedPlayer.isAlive() || !disguisedPlayer.valid) disguiseIterator.remove(); else { From a8aab1fea05ca20011badb8af04598ab43b70490 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Thu, 2 Apr 2015 23:38:29 -0700 Subject: [PATCH 21/43] Motd changes. --- .../src/mineplex/bungee/motd/GlobalMotd.java | 7 ++-- .../src/mineplex/bungee/motd/MotdManager.java | 33 ++++++++++++++----- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/GlobalMotd.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/GlobalMotd.java index 055416f96..f8de8c523 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/GlobalMotd.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/GlobalMotd.java @@ -11,10 +11,12 @@ import mineplex.serverdata.data.Data; */ public class GlobalMotd implements Data { - // The unique name representing this MOTD set private String _name; + private String _headline; + public String getHeadline() { return _headline; } + // List of lines describing the MOTD private List _motd; public List getMotd() { return _motd; } @@ -24,9 +26,10 @@ public class GlobalMotd implements Data * @param name * @param motd */ - public GlobalMotd(String name, List motd) + public GlobalMotd(String name, String headline, List motd) { _name = name; + _headline = headline; _motd = motd; } diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java index d136dc354..460511699 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.concurrent.TimeUnit; import mineplex.serverdata.Region; -import mineplex.serverdata.data.BungeeServer; import mineplex.serverdata.data.DataRepository; import mineplex.serverdata.redis.RedisDataRepository; import mineplex.serverdata.servers.ServerManager; @@ -23,7 +22,7 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory private DataRepository _repository; - private String firstLine = " §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r"; + private String _firstLine = " §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r"; private List _motdLines; public MotdManager(Plugin plugin) @@ -42,7 +41,7 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory { net.md_5.bungee.api.ServerPing serverPing = event.getResponse(); - String motd = firstLine; + String motd = _firstLine; if (_motdLines != null && _motdLines.size() > 0) { motd += "\n" + _motdLines.get(0); @@ -60,14 +59,30 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory _repository.removeElement("MainMotd"); List lines = new ArrayList(); - lines.add(" §e§lSurvival Games §a§lBIG UPDATE!"); // TODO: Implement in-game command to update MOTD? + lines.add(" §e§lSurvival Games §a§lBIG UPDATE!"); // TODO: Implement in-game command to update MOTD? lines.add(" §d§lHero Sale §a§l33% Off"); - lines.add(" §e§lSurvival Games §a§lBIG UPDATE!"); + lines.add(" §e§lSurvival Games §a§lBIG UPDATE!"); - updateMainMotd(lines); + /* + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + lines.add("§a§l MOO"); + */ + + updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines); + //updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMooplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines); } - _motdLines = _repository.getElement("MainMotd").getMotd(); // Update MOTD lines + GlobalMotd motd = _repository.getElement("MainMotd"); + _motdLines = motd.getMotd(); + _firstLine = motd.getHeadline(); + InitialHandler.setCustomMotdFactory(this); } @@ -75,9 +90,9 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory * Update the main {@link GlobalMotd} determining the MOTD for Bungee instances. * @param motdLines - the lines to update the MOTD to. */ - public void updateMainMotd(List motdLines) + public void updateMainMotd(String headline, List motdLines) { - _repository.addElement(new GlobalMotd("MainMotd", motdLines)); + _repository.addElement(new GlobalMotd("MainMotd", headline, motdLines)); } public List getMotdLines() From 66c83397e556bdd941015adb18f23ab7e427a0c8 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 3 Apr 2015 20:52:09 +1300 Subject: [PATCH 22/43] DisguiseManager: Add DisguiseRabbit --- .../core/disguise/DisguiseManager.java | 89 +++++++++++++++++++ .../disguise/disguises/DisguiseRabbit.java | 80 +++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index bc8b4b5ae..7d04d17fb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -17,6 +17,7 @@ import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent; import net.minecraft.server.v1_7_R4.EntityPlayer; import net.minecraft.server.v1_7_R4.Packet; import net.minecraft.server.v1_7_R4.PacketPlayOutBed; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityStatus; import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunk; import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; @@ -62,6 +63,7 @@ import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseBlock; import mineplex.core.disguise.disguises.DisguiseInsentient; import mineplex.core.disguise.disguises.DisguisePlayer; +import mineplex.core.disguise.disguises.DisguiseRabbit; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketHandler; import mineplex.core.packethandler.PacketVerifier; @@ -80,6 +82,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler private NautHashMap> _disguisePlayerMap = new NautHashMap>(); private HashSet _blockedNames = new HashSet(); private NautHashMap> _futureDisguises = new NautHashMap>(); + private NautHashMap> _lastRabbitHop = new NautHashMap>(); private boolean _handlingPacket = false; @@ -93,6 +96,8 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler private Field _bedD; private Field _xChunk; private Field _zChunk; + private Field _eStatusId; + private Field _eStatusState; private Chunk _bedChunk; private boolean _bedPackets; @@ -121,6 +126,10 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler _bedB.setAccessible(true); _bedD = PacketPlayOutBed.class.getDeclaredField("d"); _bedD.setAccessible(true); + _eStatusId = PacketPlayOutEntityStatus.class.getDeclaredField("a"); + _eStatusId.setAccessible(true); + _eStatusState = PacketPlayOutEntityStatus.class.getDeclaredField("b"); + _eStatusState.setAccessible(true); _bedChunk = new Chunk(null, 0, 0); Field cSection = Chunk.class.getDeclaredField("sections"); @@ -221,6 +230,11 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler disguise.setEntity(event.GetEntity()); _spawnPacketMap.put(event.GetEntity().getEntityId(), disguise); _entityDisguiseMap.remove(event.GetEntity().getUniqueId().toString()); + + if (disguise instanceof DisguiseRabbit) + { + _lastRabbitHop.put(disguise.GetEntityId(), new NautHashMap()); + } } } @@ -325,6 +339,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { _entityDisguiseMap.put(entity.getUniqueId().toString(), _spawnPacketMap.get(entity.getEntityId())); _spawnPacketMap.remove(entity.getEntityId()); + _lastRabbitHop.remove(entity.getEntityId()); } } } @@ -374,6 +389,11 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler _spawnPacketMap.put(disguise.GetEntityId(), disguise); _disguisePlayerMap.put(disguise, new HashSet()); + if (disguise instanceof DisguiseRabbit) + { + _lastRabbitHop.put(disguise.GetEntityId(), new NautHashMap()); + } + for (Player player : players) addViewerToDisguise(disguise, player, false); @@ -513,6 +533,63 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler final Player owner = packetInfo.getPlayer(); final PacketVerifier packetVerifier = packetInfo.getVerifier(); + if (UtilPlayer.is1_8(owner) + && (packet instanceof PacketPlayOutRelEntityMoveLook || packet instanceof PacketPlayOutRelEntityMove)) + { + int entityId = -1; + + if (packet instanceof PacketPlayOutRelEntityMoveLook) + { + entityId = ((PacketPlayOutRelEntityMoveLook) packet).a; + }/* + else if (packet instanceof PacketPlayOutEntityLook) + { + entityId = ((PacketPlayOutEntityLook) packet).a; + }*/ + else if (packet instanceof PacketPlayOutRelEntityMove) + { + PacketPlayOutRelEntityMove rPacket = (PacketPlayOutRelEntityMove) packet; + + if (rPacket.b != 0 || rPacket.c != 0 || rPacket.d != 0) + { + entityId = rPacket.a; + } + } + /*else if (packet instanceof PacketPlayOutEntityTeleport) + { + entityId = ((PacketPlayOutEntityTeleport) packet).a; + }*/ + + if (_lastRabbitHop.containsKey(entityId)) + { + NautHashMap rabbitHops = _lastRabbitHop.get(entityId); + + if (rabbitHops != null) + { + long last = rabbitHops.containsKey(owner.getEntityId()) ? System.currentTimeMillis() + - rabbitHops.get(owner.getEntityId()) : 1000; + + if (last > 500 || last < 100) + { + rabbitHops.put(owner.getEntityId(), System.currentTimeMillis()); + + PacketPlayOutEntityStatus entityStatus = new PacketPlayOutEntityStatus(); + try + { + _eStatusId.set(entityStatus, entityId); + _eStatusState.set(entityStatus, (byte) 1); + + handlePacket(entityStatus, packetVerifier); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + } + } + } + } + if (packet instanceof PacketPlayOutPlayerInfo) { if (_blockedNames.contains(((PacketPlayOutPlayerInfo) packet).username)) @@ -737,6 +814,12 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler private void handleSpawnPackets(PacketInfo packetInfo, DisguiseBase disguise) { final Player player = packetInfo.getPlayer(); + + if (!UtilPlayer.is1_8(player) && disguise instanceof DisguiseRabbit) + { + return; + } + final PacketVerifier packetVerifier = packetInfo.getVerifier(); if (disguise instanceof DisguisePlayer) @@ -795,6 +878,11 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { _disguisePlayerMap.get(disguise).remove(event.getPlayer()); } + + for (Integer disguise : _lastRabbitHop.keySet()) + { + _lastRabbitHop.get(disguise).remove(event.getPlayer().getEntityId()); + } } /*public void reApplyDisguise(final DisguiseBase disguise, final Player player) @@ -1007,6 +1095,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler if (!_spawnPacketMap.containsKey(entity.getEntityId())) return; + _lastRabbitHop.remove(entity.getEntityId()); DisguiseBase disguise = _spawnPacketMap.remove(entity.getEntityId()); Collection players = (disguise.Global ? Bukkit.getOnlinePlayers() : _disguisePlayerMap.remove(disguise)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java new file mode 100644 index 000000000..cdde5fd6e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguiseRabbit.java @@ -0,0 +1,80 @@ +package mineplex.core.disguise.disguises; + +import net.minecraft.server.v1_7_R4.EnumEntitySize; +import net.minecraft.server.v1_7_R4.MathHelper; +import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; + +public class DisguiseRabbit extends DisguiseInsentient +{ + + public DisguiseRabbit(org.bukkit.entity.Entity entity) + { + super(entity); + + DataWatcher.a(4, Byte.valueOf((byte) 0)); + + DataWatcher.a(12, (byte) 0); + DataWatcher.a(15, Byte.valueOf((byte) 0)); + DataWatcher.a(18, Byte.valueOf((byte) 0)); + } + + @Override + public Packet GetSpawnPacket() + { + PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(); + packet.a = Entity.getId(); + packet.b = (byte) 101; + packet.c = (int) EnumEntitySize.SIZE_2.a(Entity.locX); + packet.d = (int) MathHelper.floor(Entity.locY * 32.0D); + packet.e = (int) EnumEntitySize.SIZE_2.a(Entity.locZ); + packet.i = (byte) ((int) (Entity.yaw * 256.0F / 360.0F)); + packet.j = (byte) ((int) (Entity.pitch * 256.0F / 360.0F)); + packet.k = (byte) ((int) (Entity.yaw * 256.0F / 360.0F)); + + double var2 = 3.9D; + double var4 = 0; + double var6 = 0; + double var8 = 0; + + if (var4 < -var2) + { + var4 = -var2; + } + + if (var6 < -var2) + { + var6 = -var2; + } + + if (var8 < -var2) + { + var8 = -var2; + } + + if (var4 > var2) + { + var4 = var2; + } + + if (var6 > var2) + { + var6 = var2; + } + + if (var8 > var2) + { + var8 = var2; + } + + packet.f = (int) (var4 * 8000.0D); + packet.g = (int) (var6 * 8000.0D); + packet.h = (int) (var8 * 8000.0D); + + packet.l = DataWatcher; + packet.m = DataWatcher.b(); + + return packet; + } + +} From aa089314f004d37cc2c4024f55fe1ebb0b0b7704 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 3 Apr 2015 01:56:36 -0700 Subject: [PATCH 23/43] Completely removed Testing group from dead checks and laggy checks in server monitor. --- .../src/mineplex/servermonitor/ServerMonitor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java index 1d9306bb3..889dd4ef4 100644 --- a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java +++ b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java @@ -230,6 +230,9 @@ public class ServerMonitor for (MinecraftServer minecraftServer : _serverStatuses) { + if (minecraftServer.getGroup().equalsIgnoreCase("Testing")) + continue; + onlineServers.add(minecraftServer.getName()); if (minecraftServer.getTps() <= 17) @@ -369,7 +372,7 @@ public class ServerMonitor _deadServers.clear(); for (MinecraftServer deadServer : _repository.getDeadServers()) { - if (deadServer.getUptime() <= 10) + if (deadServer.getUptime() <= 10 || deadServer.getGroup().equalsIgnoreCase("Testing")) continue; if (_count == 0 || deadServers.contains(deadServer.getName())) From 23df6daab03de0969c21cbc68e3ccb3205f3cdf9 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 20:31:23 +1100 Subject: [PATCH 24/43] Added Easter Morph Added Eggs Baskets in games Added double gem for 1.8 --- .../src/mineplex/core/antihack/AntiHack.java | 10 +- .../mineplex/core/gadget/GadgetManager.java | 1 + .../core/gadget/gadgets/MorphBunny.java | 241 +++++++++++++++ .../core/gadget/gadgets/ParticleBlizzard.java | 2 +- .../nautilus/game/arcade/ArcadeManager.java | 3 +- .../games/survivalgames/SurvivalGames.java | 3 + .../game/arcade/managers/GameGemManager.java | 6 +- .../game/arcade/managers/HolidayManager.java | 283 +++++++++++++----- 8 files changed, 471 insertions(+), 78 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 5101f26be..d14043a9a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -97,11 +97,13 @@ public class AntiHack extends MiniPlugin _movementDetectors = new ArrayList(); _combatDetectors = new ArrayList(); - _movementDetectors.add(new Fly(this)); - _movementDetectors.add(new Idle(this)); - _movementDetectors.add(new Speed(this)); +// _movementDetectors.add(new Fly(this)); +// _movementDetectors.add(new Idle(this)); +// _movementDetectors.add(new Speed(this)); +// +// _combatDetectors.add(new Reach(this)); - _combatDetectors.add(new Reach(this)); + _enabled = false; } public static void Initialize(JavaPlugin plugin, Punish punish, Portal portal, PreferencesManager preferences, CoreClientManager clientManager) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 8f3a1d912..775206ffd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -119,6 +119,7 @@ public class GadgetManager extends MiniPlugin addGadget(new MorphBlaze(this)); //addGadget(new MorphGeno(this)); addGadget(new MorphWither(this)); + addGadget(new MorphBunny(this)); // Particles addGadget(new ParticleFoot(this)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java new file mode 100644 index 000000000..cd4b2550f --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java @@ -0,0 +1,241 @@ +package mineplex.core.gadget.gadgets; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Color; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.FireworkEffect.Type; +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.ItemDespawnEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.player.PlayerToggleSneakEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import mineplex.core.common.CurrencyType; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilServer; +import mineplex.core.disguise.disguises.DisguiseRabbit; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.MorphGadget; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class MorphBunny extends MorphGadget +{ + private HashSet _jumpCharge = new HashSet(); + private HashMap _eggs = new HashMap(); + + private short[] durs = new short[] {51,55,57,61,66,90,93,98,101}; + + public MorphBunny(GadgetManager manager) + { + super(manager, "Easter Bunny Morph", new String[] + { + C.cWhite + "Happy Easter!", + " ", + C.cYellow + "Charge Crouch" + C.cGray + " to use " + C.cGreen + "Super Jump", + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Hide Easter Egg", + " ", + C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" , + " ", + C.cPurple + "Special Limited Time Morph", + C.cPurple + "Purchase at www.mineplex.com/shop", + }, + 1, + Material.MONSTER_EGG, (byte)98); + } + + @Override + public void EnableCustom(final Player player) + { + this.ApplyArmor(player); + + DisguiseRabbit disguise = new DisguiseRabbit(player); + disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank()); + disguise.setCustomNameVisible(true); + Manager.getDisguiseManager().disguise(disguise); + + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 999999999, 1)); + player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 999999999, 1)); + } + + @Override + public void DisableCustom(Player player) + { + _jumpCharge.remove(player); + this.RemoveArmor(player); + Manager.getDisguiseManager().undisguise(player); + + player.removePotionEffect(PotionEffectType.SPEED); + player.removePotionEffect(PotionEffectType.JUMP); + + } + + @EventHandler + public void jumpTrigger(PlayerToggleSneakEvent event) + { + Player player = event.getPlayer(); + + if (!IsActive(player)) + return; + + //Start + if (!event.getPlayer().isSneaking()) + { + if (UtilEnt.isGrounded(event.getPlayer())) + _jumpCharge.add(event.getPlayer()); + } + //Jump + else if (_jumpCharge.remove(event.getPlayer())) + { + float power = player.getExp(); + player.setExp(0f); + + UtilAction.velocity(player, power * 4, 0.4, 4, true); + + player.getWorld().playSound(player.getLocation(), Sound.CAT_HIT, 0.75f, 2f); + } + } + + @EventHandler + public void jumpBoost(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + Iterator jumpIter = _jumpCharge.iterator(); + + while (jumpIter.hasNext()) + { + Player player = jumpIter.next(); + + if (!player.isValid() || !player.isOnline() || !player.isSneaking()) + { + jumpIter.remove(); + continue; + } + + player.setExp(Math.min(0.9999f, player.getExp() + 0.03f)); + + player.playSound(player.getLocation(), Sound.FIZZ, 0.25f + player.getExp() * 0.5f, 0.5f + player.getExp()); + } + } + + @EventHandler + public void eggHide(PlayerInteractEvent event) + { + Player player = event.getPlayer(); + + if (!IsActive(player)) + return; + + if (!UtilEvent.isAction(event, ActionType.L)) + return; + + if (Manager.getDonationManager().Get(player.getName()).GetBalance(CurrencyType.Coins) < 500) + { + UtilPlayer.message(player, F.main("Gadget", "You do not have enough Coins.")); + return; + } + + if (!Recharge.Instance.use(player, "Hide Egg", 30000, true, false)) + return; + + //Color + + + //Item + ItemStack eggStack = ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte)0, 1, "Hidden Egg" + System.currentTimeMillis()); + eggStack.setDurability(durs[UtilMath.r(durs.length)]); + + Item egg = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), eggStack); + UtilAction.velocity(egg, player.getLocation().getDirection(), 0.2, false, 0, 0.2, 1, false); + + + Manager.getDonationManager().RewardCoinsLater(this.GetName() + " Egg Hide", player, -500); + + egg.setPickupDelay(40); + + _eggs.put(egg, player.getName()); + + //Announce + Bukkit.broadcastMessage(C.cYellow + C.Bold + player.getName() + + ChatColor.RESET + C.Bold + " has hidden an " + + C.cYellow + C.Bold + "Easter Egg" + + ChatColor.RESET + C.Bold + " worth " + + C.cYellow + C.Bold + "450 Coins"); + + for (Player other : UtilServer.getPlayers()) + player.playSound(other.getLocation(), Sound.CAT_HIT, 1.5f, 1.5f); + } + + @EventHandler + public void eggPickup(PlayerPickupItemEvent event) + { + if (_eggs.containsKey(event.getItem()) && !_eggs.get(event.getItem()).equals(event.getPlayer().getName())) + { + event.setCancelled(true); + event.getItem().remove(); + + Manager.getDonationManager().RewardCoinsLater(GetName() + " Egg Pickup", event.getPlayer(), 450); + + event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1.5f, 0.75f); + event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1.5f, 1.25f); + + UtilFirework.playFirework(event.getItem().getLocation(), Type.BURST, Color.YELLOW, true, true); + + UtilPlayer.message(event.getPlayer(), + ChatColor.RESET + C.Bold + "You picked up an " + + C.cYellow + C.Bold + "Easter Egg" + + ChatColor.RESET + C.Bold + " worth " + + C.cYellow + C.Bold + "450 Coins"); + } + } + + @EventHandler + public void eggClean(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + Iterator gemIterator = _eggs.keySet().iterator(); + + while (gemIterator.hasNext()) + { + Item gem = gemIterator.next(); + + if (!gem.isValid() || gem.getTicksLived() > 24000) + { + gem.remove(); + gemIterator.remove(); + } + } + } + + @EventHandler + public void eggDespawnCancel(ItemDespawnEvent event) + { + if (_eggs.containsKey(event.getEntity())) + event.setCancelled(true); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java index ba0aa8b4e..f20373576 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java @@ -34,7 +34,7 @@ public class ParticleBlizzard extends ParticleGadget C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", " ", - C.cPurple + "Purchased at www.mineplex.com/shop", + C.cPurple + "No longer available", }, -1, Material.SNOW_BALL, (byte)0); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 13aab5ea5..8fa80109e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -109,6 +109,7 @@ import nautilus.game.arcade.managers.GameSpectatorManager; import nautilus.game.arcade.managers.GameStatManager; import nautilus.game.arcade.managers.GameTournamentManager; import nautilus.game.arcade.managers.GameWorldManager; +import nautilus.game.arcade.managers.HolidayManager; import nautilus.game.arcade.managers.IdleManager; import nautilus.game.arcade.managers.MiscManager; import nautilus.game.arcade.shop.ArcadeShop; @@ -264,7 +265,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation new MiscManager(this); _hologramManager = hologramManager; _idleManager = new IdleManager(this); - //new HalloweenManager(this); + new HolidayManager(this); // Game Addons new CompassAddon(plugin, this); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index ae083966e..9889abe2b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -1495,6 +1495,9 @@ public class SurvivalGames extends SoloGame @EventHandler public void borderBlockDamage(ProjectileHitEvent event) { + if (!IsLive()) + return; + if (!(event.getEntity() instanceof Fireball)) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java index 27ded40e6..46c4b86b6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameGemManager.java @@ -30,7 +30,7 @@ public class GameGemManager implements Listener { ArcadeManager Manager; - boolean DoubleGem = false; + boolean DoubleGem = true; public GameGemManager(ArcadeManager manager) { @@ -174,7 +174,7 @@ public class GameGemManager implements Listener } } - if (DoubleGem && game.GemDoubleEnabled) + if (DoubleGem && game.GemDoubleEnabled && UtilPlayer.is1_8(player)) total += earned; Manager.GetDonation().RewardGems(null, "Earned " + game.GetName(), player.getName(), player.getUniqueId(), total); @@ -245,7 +245,7 @@ public class GameGemManager implements Listener } //Double Gem - if (DoubleGem && game.GemDoubleEnabled) + if (DoubleGem && game.GemDoubleEnabled && UtilPlayer.is1_8(player)) { UtilPlayer.message(player, F.elem(C.cGreen + "+" + (earnedGems) + " Gems") + " for " + F.elem(C.cDGreen + "Double Gem Weekend")); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java index 0def76fa3..09e037d23 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java @@ -4,40 +4,89 @@ import java.util.HashSet; import java.util.Iterator; import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; 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.UtilParticle.ParticleType; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilWorld; +import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.Game.GameState; +import net.minecraft.server.v1_7_R4.PacketPlayOutBlockAction; +import net.minecraft.server.v1_7_R4.TileEntity; +import net.minecraft.server.v1_7_R4.TileEntityEnderChest; import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.craftbukkit.v1_7_R4.CraftWorld; +import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_7_R4.util.CraftMagicNumbers; import org.bukkit.entity.Item; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockDamageEvent; +import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; public class HolidayManager implements Listener { + public enum HolidayType + { + Christmas(Material.CHEST, "Present", Sound.LEVEL_UP), + Halloween(Material.PUMPKIN, "Pumpkin", Sound.ZOMBIE_REMEDY), + Easter(Material.CHEST, "Egg Basket", Sound.CAT_MEOW); + + private Material _blockType; + private String _blockName; + private Sound _blockBreakSound; + + HolidayType(Material blockType, String blockName, Sound blockBreakSound) + { + _blockType = blockType; + _blockName = blockName; + _blockBreakSound = blockBreakSound; + } + + public String getBlockName() + { + return _blockName; + } + + public Sound getBlockSound() + { + return _blockBreakSound; + } + + public Material getBlockType() + { + return _blockType; + } + } + + private HolidayType type = HolidayType.Easter; + ArcadeManager Manager; - + public HashSet _active = new HashSet(); - + + private HashSet _eggs = new HashSet(); + private HashSet _coins = new HashSet(); - + public long _lastSpawn = System.currentTimeMillis(); public HolidayManager(ArcadeManager manager) @@ -46,70 +95,96 @@ public class HolidayManager implements Listener Manager.getPluginManager().registerEvents(this, Manager.getPlugin()); } - + @EventHandler public void reset(GameStateChangeEvent event) { _active.clear(); - + _lastSpawn = System.currentTimeMillis(); } - + @EventHandler - public void pumpkinEffect(UpdateEvent event) + public void blockEffect(UpdateEvent event) { if (event.getType() == UpdateType.TICK) return; - + Iterator blockIterator = _active.iterator(); - + while (blockIterator.hasNext()) { Block block = blockIterator.next(); - - if (block.getType() != Material.PUMPKIN && block.getType() != Material.JACK_O_LANTERN) + + //Break + if (block.getType() != Material.PUMPKIN && + block.getType() != Material.JACK_O_LANTERN && + block.getType() != Material.CHEST) { - pumpkinBreak(block); + specialBlockBreak(block); blockIterator.remove(); continue; } - - UtilParticle.PlayParticle(ParticleType.FLAME, block.getLocation().add(0.5, 0.5, 0.5), 0, 0, 0, 0.06f, 4); - if (Math.random() > 0.90) + + if (type == HolidayType.Halloween) { - if (block.getType() == Material.PUMPKIN) + UtilParticle.PlayParticle(ParticleType.FLAME, block.getLocation().add(0.5, 0.5, 0.5), 0, 0, 0, 0.06f, 4); + if (Math.random() > 0.90) { - block.setType(Material.JACK_O_LANTERN); + if (block.getType() == Material.PUMPKIN) + { + block.setType(Material.JACK_O_LANTERN); + } + else + { + block.setType(Material.PUMPKIN); + } } - else + } + else if (type == HolidayType.Easter) + { + UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, block.getLocation().add(0.5, 0.2, 0.5), 0.3f, 0.2f, 0.3f, 0, 1); + + if (Math.random() > 0.90) { - block.setType(Material.PUMPKIN); + Item egg = block.getWorld().dropItem(block.getLocation().add(0.5, 0.8, 0.5), + ItemStackFactory.Instance.CreateStack(Material.EGG, (byte)0, 1, System.currentTimeMillis() + "Egg")); + egg.setVelocity(new Vector((Math.random()-0.5)*0.3, Math.random()-0.4, (Math.random()-0.5)*0.3)); + + _eggs.add(egg); + + block.getWorld().playSound(block.getLocation(), Sound.CHICKEN_EGG_POP, 0.25f + (float)Math.random() * 0.75f, 0.75f + (float)Math.random() * 0.5f); + } + + if (Math.random() > 0.95) + { + sendChestPackets(block); } } } } @EventHandler - public void spawnPumpkinUpdate(UpdateEvent event) + public void spawnSpecialBlockUpdate(UpdateEvent event) { if (event.getType() != UpdateType.SEC) return; - + if (Manager.GetGame() == null) return; Game game = Manager.GetGame(); - int requirement = (int)((double)Manager.GetPlayerFull() * 0.75d); + int requirement = (int)((double)Manager.GetPlayerFull() * 0.5d); if (UtilServer.getPlayers().length < requirement) return; - + if (game.GetState() != GameState.Live) return; - if (!UtilTime.elapsed(_lastSpawn, 120000)) + if (!UtilTime.elapsed(_lastSpawn, 90000)) return; - + if (Math.random() > 0.01) return; @@ -117,129 +192,199 @@ public class HolidayManager implements Listener for (int i=0 ; i< toDrop ; i++) { double interval = 1 / (double)(toDrop); - + if (Math.random() >= (i * interval)) // Diminishing per growth { - spawnPumpkin(getPumpkinBlock(game)); + spawnSpecialBlock(findSpecialBlockLocation(game)); } } - + _lastSpawn = System.currentTimeMillis(); } - private void spawnPumpkin(Block block) + private void spawnSpecialBlock(Block block) { if (block == null) { - System.out.println("Pumpkin: Could Not Find Suitable Block"); + System.out.println("Holiday Block: Could Not Find Suitable Block"); return; } - - block.setType(Material.PUMPKIN); - block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.PUMPKIN); + + block.setType(type.getBlockType()); + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, type.getBlockType()); + + if (type.getBlockType() == Material.CHEST) + { + sendChestPackets(block); + } + _active.add(block); - - System.out.println("Spawned Pumpkin: " + UtilWorld.locToStrClean(block.getLocation())); + + System.out.println("Spawned Holiday Block: " + UtilWorld.locToStrClean(block.getLocation())); } + + private void sendChestPackets(Block block) + { + PacketPlayOutBlockAction packet = new PacketPlayOutBlockAction(block.getX(), block.getY(), block.getZ(), + CraftMagicNumbers.getBlock(block), 1, 1); + + for (Player other : UtilServer.getPlayers()) + ((CraftPlayer) other).getHandle().playerConnection.sendPacket(packet); + } - private Block getPumpkinBlock(Game game) + private Block findSpecialBlockLocation(Game game) { Block block = null; int attempts = 2000; while (attempts > 0) { attempts--; - + int x = game.WorldData.MinX + UtilMath.r(Math.abs(game.WorldData.MaxX - game.WorldData.MinX)); int z = game.WorldData.MinZ + UtilMath.r(Math.abs(game.WorldData.MaxZ - game.WorldData.MinZ)); - + block = UtilBlock.getHighest(game.WorldData.World, x, z, null); - + if (block.getLocation().getY() <= 2 || block.getLocation().getY() < game.WorldData.MinY || block.getLocation().getY() > game.WorldData.MaxY) continue; - + if (block.getRelative(BlockFace.DOWN).isLiquid()) continue; - + if (!UtilBlock.airFoliage(block) || !UtilBlock.airFoliage(block.getRelative(BlockFace.UP))) continue; - + if (!UtilBlock.solid(block.getRelative(BlockFace.DOWN))) continue; - + + boolean nextToChest = false; + for (Block other : UtilBlock.getSurrounding(block, false)) + { + if (other.getType() == Material.CHEST) + nextToChest = true; + } + if (nextToChest) + continue; + return block; } return null; } - + @EventHandler - public void pumpkinDamage(BlockDamageEvent event) + public void specialBlockInteract(PlayerInteractEvent event) { - if (_active.contains(event.getBlock())) - { - Manager.GetGame().AddStat(event.getPlayer(), "Pumpkins Smashed", 1, false, true); - pumpkinBreak(event.getBlock()); - } + if (UtilPlayer.isSpectator(event.getPlayer())) + return; + + if (!UtilEvent.isAction(event, ActionType.R_BLOCK)) + return; + + if (event.getClickedBlock() == null) + return; + + if (event.getClickedBlock().getType() != Material.CHEST) + return; + + if (!_active.contains(event.getClickedBlock())) + return; + + event.setCancelled(true); + + specialBlockBreak(event.getClickedBlock()); } - private void pumpkinBreak(Block block) + @EventHandler + public void specialBlockDamage(BlockDamageEvent event) { - block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.PUMPKIN); - block.setType(Material.AIR); + if (UtilPlayer.isSpectator(event.getPlayer())) + return; + + if (!_active.contains(event.getBlock())) + return; + specialBlockBreak(event.getBlock()); + } + + private void specialBlockBreak(Block block) + { + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, type.getBlockType()); + block.setType(Material.AIR); + //Coins for (int i=0 ; i < 4 + Math.random()*16 ; i++) { - Item coin = block.getWorld().dropItem(block.getLocation().add(0.5, 1, 0.5), new ItemStack(Material.getMaterial(175))); - + Item coin = block.getWorld().dropItem(block.getLocation().add(0.5, 1, 0.5), + ItemStackFactory.Instance.CreateStack(175, (byte)0, 1, UtilMath.r(999999) + "Coin")); + Vector vel = new Vector( (Math.random() - 0.5) * 0.5, 0.1 + Math.random() * 0.3, (Math.random() - 0.5) * 0.5); - + coin.setVelocity(vel); - + coin.setPickupDelay(20); - + _coins.add(coin); } - + //Effect - block.getWorld().playSound(block.getLocation(), Sound.ZOMBIE_REMEDY, 1f, 1f); + block.getWorld().playSound(block.getLocation(), type.getBlockSound(), 1f, 1f); } - + @EventHandler public void coinPickup(PlayerPickupItemEvent event) { - if (_coins.contains(event.getItem())) + if (_coins.contains(event.getItem())) { event.setCancelled(true); event.getItem().remove(); - - Manager.GetDonation().RewardCoins(null, "Halloween Pumpkin", event.getPlayer().getName(), Manager.GetClients().Get(event.getPlayer()).getAccountId(), 4 * event.getItem().getItemStack().getAmount()); - + + Manager.GetDonation().RewardCoins(null, type + " Coins", event.getPlayer().getName(), Manager.GetClients().Get(event.getPlayer()).getAccountId(), 4 * event.getItem().getItemStack().getAmount()); + event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f); } + + else if (_eggs.contains(event.getItem())) + { + event.setCancelled(true); + } } + + @EventHandler - public void coinClean(UpdateEvent event) + public void itemClean(UpdateEvent event) { if (event.getType() != UpdateType.FAST) return; - + Iterator coinIterator = _coins.iterator(); - + while (coinIterator.hasNext()) { Item coin = coinIterator.next(); - + if (!coin.isValid() || coin.getTicksLived() > 1200) { coin.remove(); coinIterator.remove(); } } + + Iterator eggIterator = _eggs.iterator(); + + while (eggIterator.hasNext()) + { + Item egg = eggIterator.next(); + + if (!egg.isValid() || egg.getTicksLived() > 40) + { + egg.remove(); + eggIterator.remove(); + } + } } } From 54948cc61e70879217dcff1e740964725eca2323 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 20:59:56 +1100 Subject: [PATCH 25/43] disabled rabbit buying --- .../src/mineplex/core/gadget/gadgets/MorphBunny.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java index cd4b2550f..3235bb185 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java @@ -61,7 +61,7 @@ public class MorphBunny extends MorphGadget C.cPurple + "Special Limited Time Morph", C.cPurple + "Purchase at www.mineplex.com/shop", }, - 1, + -1, Material.MONSTER_EGG, (byte)98); } From 0119e99adf0e60cec5fa1a49917ad9aecc76215f Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 3 Apr 2015 03:07:49 -0700 Subject: [PATCH 26/43] Added EasterBunny package for support server. --- .../salespackage/SalesPackageManager.java | 2 ++ .../salespackages/EasterBunny.java | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java index 64b5fc2ec..e3ef2eba3 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java @@ -16,6 +16,7 @@ import mineplex.staffServer.salespackage.salespackages.AncientChest; import mineplex.staffServer.salespackage.salespackages.ApplyKits; import mineplex.staffServer.salespackage.salespackages.Coins; import mineplex.staffServer.salespackage.salespackages.DefaultRank; +import mineplex.staffServer.salespackage.salespackages.EasterBunny; import mineplex.staffServer.salespackage.salespackages.FrostLord; import mineplex.staffServer.salespackage.salespackages.GemHunter; import mineplex.staffServer.salespackage.salespackages.LifetimeHero; @@ -61,6 +62,7 @@ public class SalesPackageManager extends MiniPlugin AddSalesPackage(new AncientChest(this)); AddSalesPackage(new MythicalChest(this)); AddSalesPackage(new FrostLord(this)); + AddSalesPackage(new EasterBunny(this)); } private void AddSalesPackage(SalesPackageBase salesPackage) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java new file mode 100644 index 000000000..4b7681480 --- /dev/null +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java @@ -0,0 +1,20 @@ +package mineplex.staffServer.salespackage.salespackages; + +import mineplex.staffServer.salespackage.SalesPackageManager; + +import org.bukkit.entity.Player; + +public class EasterBunny extends SalesPackageBase +{ + public EasterBunny(SalesPackageManager manager) + { + super(manager, "Easter Bunny Morph"); + } + + public void displayToAgent(Player agent, String playerName) + { + addButton(agent, "/sales item " + playerName + " 1 Easter Bunny Morph", "Give Easter Bunny Morph."); + agent.sendMessage(" "); + addBackButton(agent, playerName); + } +} From 8567701e1d9bfaf5389ad7498faa363aa778ec58 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 3 Apr 2015 03:20:11 -0700 Subject: [PATCH 27/43] Updated Motd. --- .../src/mineplex/bungee/motd/MotdManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java index 460511699..56a2f0662 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -59,9 +59,12 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory _repository.removeElement("MainMotd"); List lines = new ArrayList(); - lines.add(" §e§lSurvival Games §a§lBIG UPDATE!"); // TODO: Implement in-game command to update MOTD? - lines.add(" §d§lHero Sale §a§l33% Off"); - lines.add(" §e§lSurvival Games §a§lBIG UPDATE!"); + lines.add(" §a§lDouble Gems for 1.8 Players!"); + lines.add(" §e§lChampions Update §a§lBalance Patch"); + lines.add(" §6§lSpecial Egg Baskets!"); + lines.add(" §e§lBunny Morph §a§lLimited Time!"); + lines.add(" §d§lHero Sale §a§l33% Off"); + lines.add(" §a§lDouble Gems for 1.8 Players!"); /* lines.add("§a§l MOO"); From ff0883e7d73909c3baa6d082524e364981b23060 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 21:47:43 +1100 Subject: [PATCH 28/43] fixed easter egg duration parser list improvement --- .../core/gadget/gadgets/MorphBunny.java | 42 ++++++++++++------- .../mineplex/hub/modules/WorldManager.java | 3 ++ .../mapparser/command/ListCommand.java | 21 +++++++--- 3 files changed, 46 insertions(+), 20 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java index 3235bb185..511043f60 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java @@ -29,6 +29,8 @@ import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilServer; @@ -180,13 +182,13 @@ public class MorphBunny extends MorphGadget //Announce Bukkit.broadcastMessage(C.cYellow + C.Bold + player.getName() + - ChatColor.RESET + C.Bold + " has hidden an " + + ChatColor.RESET + C.Bold + " hid an " + C.cYellow + C.Bold + "Easter Egg" + ChatColor.RESET + C.Bold + " worth " + C.cYellow + C.Bold + "450 Coins"); for (Player other : UtilServer.getPlayers()) - player.playSound(other.getLocation(), Sound.CAT_HIT, 1.5f, 1.5f); + other.playSound(other.getLocation(), Sound.CAT_HIT, 1.5f, 1.5f); } @EventHandler @@ -194,6 +196,8 @@ public class MorphBunny extends MorphGadget { if (_eggs.containsKey(event.getItem()) && !_eggs.get(event.getItem()).equals(event.getPlayer().getName())) { + _eggs.remove(event.getItem()); + event.setCancelled(true); event.getItem().remove(); @@ -204,12 +208,12 @@ public class MorphBunny extends MorphGadget UtilFirework.playFirework(event.getItem().getLocation(), Type.BURST, Color.YELLOW, true, true); - UtilPlayer.message(event.getPlayer(), - ChatColor.RESET + C.Bold + "You picked up an " + - C.cYellow + C.Bold + "Easter Egg" + - ChatColor.RESET + C.Bold + " worth " + - C.cYellow + C.Bold + "450 Coins"); - } + //Announce + Bukkit.broadcastMessage(C.cYellow + C.Bold + event.getPlayer().getName() + + ChatColor.RESET + C.Bold + " found an " + + C.cGold + C.Bold + "Easter Egg" + + ChatColor.RESET + C.Bold + "! " + _eggs.size() + " Eggs left!"); + } } @EventHandler @@ -218,16 +222,26 @@ public class MorphBunny extends MorphGadget if (event.getType() != UpdateType.FAST) return; - Iterator gemIterator = _eggs.keySet().iterator(); + Iterator eggIter = _eggs.keySet().iterator(); - while (gemIterator.hasNext()) + while (eggIter.hasNext()) { - Item gem = gemIterator.next(); + Item egg = eggIter.next(); - if (!gem.isValid() || gem.getTicksLived() > 24000) + if (!egg.isValid() || egg.getTicksLived() > 24000) { - gem.remove(); - gemIterator.remove(); + egg.remove(); + eggIter.remove(); + + //Announce + Bukkit.broadcastMessage( + ChatColor.RESET + C.Bold + "No one found an " + + C.cGold + C.Bold + "Easter Egg" + + ChatColor.RESET + C.Bold + "! " + _eggs.size() + " Eggs left!"); + } + else + { + UtilParticle.PlayParticle(ParticleType.SPELL, egg.getLocation().add(0, 0.1, 0), 0.1f, 0.1f, 0.1f, 0, 1); } } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java index c2782cbff..c02a3c6a0 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java @@ -209,6 +209,9 @@ public class WorldManager extends MiniPlugin if (!(ent instanceof Item)) continue; + if (((Item)ent).getItemStack().getType() == Material.MONSTER_EGG) + continue; + if (ent.getTicksLived() > 1200) ent.remove(); } diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java index 835973fb1..8935eb777 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/ListCommand.java @@ -34,6 +34,9 @@ public class ListCommand extends BaseCommand for (GameType gameType : GameType.values()) { + if (gameType == GameType.InProgress) + continue; + if (listMaps(player, gameType, colorSwitch)) colorSwitch = !colorSwitch; } @@ -41,16 +44,22 @@ public class ListCommand extends BaseCommand else if (args.length == 1) { GameType gameType = null; - try + if (args[0].equalsIgnoreCase("p")) { - gameType = GameType.valueOf(args[0]); + gameType = GameType.InProgress; } - catch (Exception e) + else { - getPlugin().sendValidGameTypes(player); + try + { + gameType = GameType.valueOf(args[0]); + } + catch (Exception e) + { + getPlugin().sendValidGameTypes(player); + } } - - + UtilPlayer.message(player, F.main("Parser", "Listing Maps for gametype " + F.elem(gameType.GetName()))); listMaps(player, gameType, false); } From 3cadbf3a34518708f98ee359ac52ba0ee29fd5fa Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 22:00:54 +1100 Subject: [PATCH 29/43] fixed color in egg --- .../src/mineplex/core/gadget/gadgets/MorphBunny.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java index 511043f60..d6d9fa7af 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java @@ -209,7 +209,7 @@ public class MorphBunny extends MorphGadget UtilFirework.playFirework(event.getItem().getLocation(), Type.BURST, Color.YELLOW, true, true); //Announce - Bukkit.broadcastMessage(C.cYellow + C.Bold + event.getPlayer().getName() + + Bukkit.broadcastMessage(C.cGold + C.Bold + event.getPlayer().getName() + ChatColor.RESET + C.Bold + " found an " + C.cGold + C.Bold + "Easter Egg" + ChatColor.RESET + C.Bold + "! " + _eggs.size() + " Eggs left!"); From ae298644e2e8fc31e26e7bdf2941b3a94a7a8863 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 3 Apr 2015 22:02:22 +1100 Subject: [PATCH 30/43] removed random egg color, looked ugly --- .../src/mineplex/core/gadget/gadgets/MorphBunny.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java index d6d9fa7af..5026ebbd7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java @@ -47,8 +47,6 @@ public class MorphBunny extends MorphGadget private HashSet _jumpCharge = new HashSet(); private HashMap _eggs = new HashMap(); - private short[] durs = new short[] {51,55,57,61,66,90,93,98,101}; - public MorphBunny(GadgetManager manager) { super(manager, "Easter Bunny Morph", new String[] @@ -168,7 +166,7 @@ public class MorphBunny extends MorphGadget //Item ItemStack eggStack = ItemStackFactory.Instance.CreateStack(Material.MONSTER_EGG, (byte)0, 1, "Hidden Egg" + System.currentTimeMillis()); - eggStack.setDurability(durs[UtilMath.r(durs.length)]); + eggStack.setDurability((short) 98); Item egg = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), eggStack); UtilAction.velocity(egg, player.getLocation().getDirection(), 0.2, false, 0, 0.2, 1, false); From d25b39058adb791e5f45741717cbba13ca803278 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Fri, 3 Apr 2015 04:19:48 -0700 Subject: [PATCH 31/43] Fixed bunny morph name. --- .../staffServer/salespackage/salespackages/EasterBunny.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java index 4b7681480..6aacf8014 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/EasterBunny.java @@ -13,7 +13,7 @@ public class EasterBunny extends SalesPackageBase public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales item " + playerName + " 1 Easter Bunny Morph", "Give Easter Bunny Morph."); + addButton(agent, "/sales item " + playerName + " 1 Morph Easter Bunny Morph", "Give Easter Bunny Morph."); agent.sendMessage(" "); addBackButton(agent, playerName); } From c79432c8b9f0f8966c1845f69370069c9bf913d4 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 4 Apr 2015 10:54:03 +1100 Subject: [PATCH 32/43] Fixed projectile hitboxes and specific values --- .../core/gadget/gadgets/ItemFleshHook.java | 2 +- .../gadget/gadgets/ItemMelonLauncher.java | 2 +- .../core/gadget/gadgets/MorphBat.java | 2 +- .../core/gadget/gadgets/MorphVillager.java | 2 +- .../core/projectile/ProjectileManager.java | 18 +++++++-------- .../mineplex/hub/modules/StackerManager.java | 2 +- .../classcombat/Skill/Assassin/Illusion.java | 9 +++----- .../classcombat/Skill/Brute/BlockToss.java | 22 ++---------------- .../classcombat/Skill/Brute/FleshHook.java | 2 +- .../classcombat/Skill/Knight/AxeThrow.java | 2 +- .../classcombat/Skill/Mage/FreezingBlast.java | 2 +- .../classcombat/Skill/Mage/GlacialBlade.java | 23 ++++++++++++++++++- .../classcombat/Skill/Mage/IcePrison.java | 8 +++---- .../classcombat/Skill/Mage/LightningOrb.java | 2 +- .../game/classcombat/item/ItemUsable.java | 2 +- .../nautilus/game/arcade/ArcadeManager.java | 2 +- .../game/arcade/game/games/runner/Runner.java | 2 +- .../arcade/game/games/stacker/Stacker.java | 4 ++-- .../game/arcade/kit/perks/PerkApple.java | 2 +- .../game/arcade/kit/perks/PerkAxeThrower.java | 2 +- .../game/arcade/kit/perks/PerkBaconBlast.java | 2 +- .../arcade/kit/perks/PerkBlockRestorer.java | 2 +- .../game/arcade/kit/perks/PerkBlockToss.java | 2 +- .../game/arcade/kit/perks/PerkBoneRush.java | 2 +- .../game/arcade/kit/perks/PerkCowBomb.java | 2 +- .../kit/perks/PerkCreeperSulphurBomb.java | 2 +- .../arcade/kit/perks/PerkHammerThrow.java | 2 +- .../game/arcade/kit/perks/PerkInkBlast.java | 2 +- .../game/arcade/kit/perks/PerkIronHook.java | 2 +- .../arcade/kit/perks/PerkPigBaconBounce.java | 2 +- .../game/arcade/kit/perks/PerkRevealer.java | 2 +- .../arcade/kit/perks/PerkSlimeRocket.java | 2 +- .../game/arcade/kit/perks/PerkThrower.java | 2 +- .../game/arcade/kit/perks/PerkWeb.java | 2 +- .../game/arcade/kit/perks/PerkWebShot.java | 2 +- .../game/arcade/kit/perks/PerkWitherWeb.java | 2 +- .../game/arcade/kit/perks/PerkWoolBomb.java | 2 +- .../game/arcade/kit/perks/PerkZombieBile.java | 2 +- .../game/arcade/managers/HolidayManager.java | 5 ++-- 39 files changed, 77 insertions(+), 76 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFleshHook.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFleshHook.java index 165f662ed..44eb1ca17 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFleshHook.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFleshHook.java @@ -46,7 +46,7 @@ public class ItemFleshHook extends ItemGadget implements IThrown 1.6, false, 0, 0.2, 10, false); Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, - Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 2d); + Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 0.5f); //Inform UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemMelonLauncher.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemMelonLauncher.java index faff21e22..a2ee2c308 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemMelonLauncher.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemMelonLauncher.java @@ -58,7 +58,7 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown 1, false, 0, 0.2, 10, false); Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, - null, 1f, 1f, null, null, 0, UpdateType.TICK, 2d); + null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f); //Inform UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBat.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBat.java index 373abb30e..0d6d18762 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBat.java @@ -115,7 +115,7 @@ public class MorphBat extends MorphGadget implements IThrown 0.01, true, -0.3, 0, 10, false); Manager.getProjectileManager().AddThrow(item, player, this, -1, true, true, true, - null, 1f, 1f, null, null, 0, UpdateType.TICK, 3d); + null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f); //Inform UtilPlayer.message(player, F.main("Skill", "You used " + F.skill("Poop") + ".")); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphVillager.java index ccca1c2be..c2f0d04b1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphVillager.java @@ -98,7 +98,7 @@ public class MorphVillager extends MorphGadget implements IThrown //Throw Manager.getProjectileManager().AddThrow(gem, player, this, -1, true, true, true, - null, 1.4f, 0.8f, null, null, 0, UpdateType.TICK, 2d); + null, 1.4f, 0.8f, null, null, 0, UpdateType.TICK, 0.5f); Manager.getDonationManager().RewardGems(null, this.GetName() + " Throw", player.getName(), player.getUniqueId(), -20); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java index 3355e945d..a3e3fb661 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java @@ -31,42 +31,42 @@ public class ProjectileManager extends MiniPlugin } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, - long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, double hitboxMult) + long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, float hitboxGrow) { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, - null, 1f, 1f, null, 0, null, null, hitboxMult)); + null, 1f, 1f, null, 0, null, null, hitboxGrow)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, - long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, double hitboxMult) + long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, float hitboxGrow) { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, pickup, - null, 1f, 1f, null, 0, null, null, hitboxMult)); + null, 1f, 1f, null, 0, null, null, hitboxGrow)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, - Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , double hitboxMult) + Sound sound, float soundVolume, float soundPitch, Effect effect, int effectData, UpdateType effectRate , float hitboxGrow) { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, - sound, soundVolume, soundPitch, effect, effectData, effectRate, null, hitboxMult)); + sound, soundVolume, soundPitch, effect, effectData, effectRate, null, hitboxGrow)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, - Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, double hitboxMult) + Sound sound, float soundVolume, float soundPitch, ParticleType particle, Effect effect, int effectData, UpdateType effectRate, float hitboxGrow) { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, - sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, hitboxMult)); + sound, soundVolume, soundPitch, effect, effectData, effectRate, particle, hitboxGrow)); } public void AddThrow(Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, - Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, double hitboxMult) + Sound sound, float soundVolume, float soundPitch, ParticleType particle, UpdateType effectRate, float hitboxMult) { _thrown.put(thrown, new ProjectileUser(this, thrown, thrower, callback, expireTime, hitPlayer, hitBlock, idle, false, diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java index 0259a4cd3..76a74e62a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java @@ -206,7 +206,7 @@ public class StackerManager extends MiniPlugin implements IThrown UtilAction.velocity(throwee, thrower.getLocation().getDirection(), 1.8, false, 0, 0.3, 2, false); - _projectileManager.AddThrow(throwee, thrower, this, -1, true, false, true, false, 2.4d); + _projectileManager.AddThrow(throwee, thrower, this, -1, true, false, true, false, 0.5f); //Portal Delay Manager.SetPortalDelay(thrower); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Illusion.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Illusion.java index f640e6181..dc0d6aef1 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Illusion.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Illusion.java @@ -34,6 +34,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilWorld; +import mineplex.core.disguise.disguises.DisguisePig; import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.minecraft.game.classcombat.Skill.SkillActive; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; @@ -120,14 +121,10 @@ public class Illusion extends SkillActive for (Player other : UtilServer.getPlayers()) if (UtilMath.offset2d(skel, other) < 70) inRange.add(other); - - Player[] disguiseList = new Player[inRange.size()]; - for (int i=0 ; i Rethrow if (hit.equals(data.GetThrower())) { - Manager.GetProjectile().AddThrow(data.GetThrown(), data.GetThrower(), this, -1, true, false, true, false, 2.4d); + Manager.GetProjectile().AddThrow(data.GetThrown(), data.GetThrower(), this, -1, true, false, true, false, 1f); return; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java index 0d2c14449..b039a7b08 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java @@ -85,7 +85,7 @@ public class PerkApple extends Perk implements IThrown org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.APPLE)); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 1d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java index 0701eb45f..5878156a5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java @@ -57,7 +57,7 @@ public class PerkAxeThrower extends Perk implements IThrown org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(player.getItemInHand().getType())); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 2.5d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.6f); //Remove Axe player.setItemInHand(null); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java index f61f6ede4..a815995cc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java @@ -72,7 +72,7 @@ public class PerkBaconBlast extends Perk implements IThrown Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, null, 1f, 1f, null, 1, UpdateType.SLOW, - 2d); + 0.5f); //Inform UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + ".")); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java index 7c1819810..769df0117 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java @@ -60,7 +60,7 @@ public class PerkBlockRestorer extends Perk implements IThrown org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.COMMAND)); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, false, false, true, false, 2d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, false, false, true, false, 0.5f); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java index 845c49f4d..ebda9a630 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockToss.java @@ -144,7 +144,7 @@ public class PerkBlockToss extends SmashPerk implements IThrown //Action UtilAction.velocity(block, cur.getLocation().getDirection(), mult, false, 0.2, 0, 1, true); Manager.GetProjectile().AddThrow(block, cur, this, -1, true, true, true, - null, 0, 0, null, 0, UpdateType.FASTEST, 2d); + null, 0, 0, null, 0, UpdateType.FASTEST, 1.5f); //Event PerkBlockThrowEvent blockEvent = new PerkBlockThrowEvent(cur); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java index 251872e4a..e802a911b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java @@ -123,7 +123,7 @@ public class PerkBoneRush extends SmashPerk implements IThrown { Item bone = player.getWorld().dropItem(player.getLocation().add(Math.random()*5 - 2.5, Math.random()*3, Math.random()*5 - 2.5), new ItemStack(Material.BONE)); UtilAction.velocity(bone, dir, 0.6 + 0.3 * Math.random(), false, 0, 0.1 + Math.random() * 0.05, 0.3, false); - Manager.GetProjectile().AddThrow(bone, player, this, -1, true, true, true, false, 1d); + Manager.GetProjectile().AddThrow(bone, player, this, -1, true, true, true, false, 0.5f); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java index 6a3f5e0c6..5050e26e3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java @@ -78,7 +78,7 @@ public class PerkCowBomb extends Perk implements IThrown Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, null, 1f, 1f, null, 1, UpdateType.SLOW, - 2d); + 0.5f); //Inform UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + ".")); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java index a429b9934..7fc965819 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperSulphurBomb.java @@ -79,7 +79,7 @@ public class PerkCreeperSulphurBomb extends SmashPerk implements IThrown Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, null, 1f, 1f, null, 1, UpdateType.SLOW, - 2.5d); + 0.5f); //Inform UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + ".")); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java index f68e1d8c2..17d725b8b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java @@ -79,7 +79,7 @@ public class PerkHammerThrow extends Perk implements IThrown UtilAction.velocity(item, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, true); //Projectile - Manager.GetProjectile().AddThrow(item, player, this, -1, true, true, true, false, 2.5d); + Manager.GetProjectile().AddThrow(item, player, this, -1, true, true, true, false, 0.6f); //Store _thrown.put(item, player); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java index b8e775ca7..725b1ab07 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInkBlast.java @@ -87,7 +87,7 @@ public class PerkInkBlast extends SmashPerk implements IThrown Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, null, 1f, 1f, Effect.SMOKE, 4, UpdateType.TICK, - 2d); + 0.5f); } //Inform diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java index af1019005..d7bf2c80f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java @@ -64,7 +64,7 @@ public class PerkIronHook extends Perk implements IThrown 1.8, false, 0, 0.2, 10, false); Manager.GetProjectile().AddThrow(item, player, this, -1, true, true, true, - Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 2d); + Sound.FIRE_IGNITE, 1.4f, 0.8f, ParticleType.CRIT, null, 0, UpdateType.TICK, 1f); //Inform UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java index ba0278d67..5ba2be119 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java @@ -89,7 +89,7 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown //Launch Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.PORK)); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 1d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 1f); ent.setPickupDelay(9999); //Sound diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java index 04cd10a79..022e13315 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java @@ -99,7 +99,7 @@ public class PerkRevealer extends Perk implements IThrown Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.DIAMOND)); UtilAction.velocity(ent, player.getLocation().getDirection(), 1.2, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 1d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java index 9027ed735..376276d17 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java @@ -194,7 +194,7 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown UtilAction.velocity(slime, player.getLocation().getDirection(), 1 + charge/2d, false, 0, 0.2, 10, true); Manager.GetProjectile().AddThrow(slime, player, this, -1, true, true, true, - null, 0, 0, null, 0, UpdateType.FASTEST, 2d); + null, 0, 0, null, 0, UpdateType.FASTEST, 1f); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java index e1e3e34cd..f46f3433e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java @@ -69,7 +69,7 @@ public class PerkThrower extends Perk implements IThrown //Throw UtilAction.velocity(throwee, thrower.getLocation().getDirection(), 1.4, false, 0, 0.3, 0.8, true); - Manager.GetProjectile().AddThrow(throwee, thrower, this, -1, true, false, true, false, 2d); + Manager.GetProjectile().AddThrow(throwee, thrower, this, -1, true, false, true, false, 1f); //Audio thrower.getWorld().playSound(thrower.getLocation(), Sound.SHEEP_IDLE, 2f, 3f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java index a4de878e9..e61587621 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java @@ -97,7 +97,7 @@ public class PerkWeb extends Perk implements IThrown org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation(), ItemStackFactory.Instance.CreateStack(Material.WEB)); UtilAction.velocity(ent, player.getLocation().getDirection(), 0.8, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 1d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java index e22705001..699067767 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWebShot.java @@ -76,7 +76,7 @@ public class PerkWebShot extends SmashPerk implements IThrown random.multiply(0.2); UtilAction.velocity(ent, player.getLocation().getDirection().multiply(-1).add(random), 1 + Math.random() * 0.4, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 2d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f); } //Inform diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java index 08259622f..161e77251 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java @@ -72,7 +72,7 @@ public class PerkWitherWeb extends Perk implements IThrown random.multiply(0.25); UtilAction.velocity(ent, player.getLocation().getDirection().add(random), 1 + Math.random() * 0.4, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 2d); + Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 0.5f); } //Inform diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java index 4b0eaf99f..0c97eb42b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java @@ -108,7 +108,7 @@ public class PerkWoolBomb extends Perk implements IThrown Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, null, 1f, 1f, null, 1, UpdateType.SLOW, - 2d); + 0.5f); _thrown.put(player, ent); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java index 74c5af7aa..47835d469 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkZombieBile.java @@ -100,7 +100,7 @@ public class PerkZombieBile extends SmashPerk implements IThrown org.bukkit.entity.Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.5, 0), ItemStackFactory.Instance.CreateStack(Material.ROTTEN_FLESH)); UtilAction.velocity(ent, player.getLocation().getDirection().add(rand), 0.8, false, 0, 0.2, 10, false); - Manager.GetProjectile().AddThrow(ent, player, this, System.currentTimeMillis() + 2000, true, true, true, false, 1.5d); + Manager.GetProjectile().AddThrow(ent, player, this, System.currentTimeMillis() + 2000, true, true, true, false, 0.5f); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java index 09e037d23..f2bba323b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java @@ -337,6 +337,9 @@ public class HolidayManager implements Listener @EventHandler public void coinPickup(PlayerPickupItemEvent event) { + if (UtilPlayer.isSpectator(event.getPlayer())) + return; + if (_coins.contains(event.getItem())) { event.setCancelled(true); @@ -352,8 +355,6 @@ public class HolidayManager implements Listener event.setCancelled(true); } } - - @EventHandler public void itemClean(UpdateEvent event) From c1c4e8b41711c83b703f368d0ca5b6b30be91078 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 4 Apr 2015 17:33:33 +1300 Subject: [PATCH 33/43] Disguises: Fixed DisguisePlayer not using a random UUID to prevent conflicts, fixed non-player living entities not being disguisable --- .../core/disguise/DisguiseManager.java | 20 ++++++++++++++++--- .../disguise/disguises/DisguisePlayer.java | 8 +++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 7d04d17fb..6942e3201 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -29,6 +29,7 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove; import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect; @@ -597,10 +598,23 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler packetInfo.setCancelled(true); } } - else if (packet instanceof PacketPlayOutSpawnEntity || packet instanceof PacketPlayOutNamedEntitySpawn) + else if (packet instanceof PacketPlayOutSpawnEntity || packet instanceof PacketPlayOutSpawnEntityLiving + || packet instanceof PacketPlayOutNamedEntitySpawn) { - int entityId = packet instanceof PacketPlayOutSpawnEntity ? ((PacketPlayOutSpawnEntity) packet).a - : ((PacketPlayOutNamedEntitySpawn) packet).a; + int entityId = -1; + + if (packet instanceof PacketPlayOutSpawnEntity) + { + entityId = ((PacketPlayOutSpawnEntity) packet).a; + } + else if (packet instanceof PacketPlayOutSpawnEntityLiving) + { + entityId = ((PacketPlayOutSpawnEntityLiving) packet).a; + } + else if (packet instanceof PacketPlayOutNamedEntitySpawn) + { + entityId = ((PacketPlayOutNamedEntitySpawn) packet).a; + } if (_futureDisguises.containsKey(entityId)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java index fa806d384..33126f3d6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java @@ -1,5 +1,7 @@ package mineplex.core.disguise.disguises; +import java.util.UUID; + import org.bukkit.Location; import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; @@ -31,7 +33,11 @@ public class DisguisePlayer extends DisguiseHuman public void setProfile(GameProfile profile) { - _profile = profile; + GameProfile newProfile = new GameProfile(UUID.randomUUID(), profile.getName()); + + newProfile.getProperties().putAll(profile.getProperties()); + + _profile = newProfile; } public BlockFace getSleepingDirection() From dc84621b6cad267ad38700ec98744394e0c5d640 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 4 Apr 2015 16:01:48 +1100 Subject: [PATCH 34/43] blizzard snowballs expire --- .../src/mineplex/core/projectile/ProjectileUser.java | 6 +++--- .../minecraft/game/classcombat/Skill/Mage/Blizzard.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java index 9d2abf3cb..251022932 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java @@ -49,7 +49,7 @@ public class ProjectileUser private int _effectData = 0; private UpdateType _effectRate = UpdateType.TICK; - private double _hitboxMult; + private double _hitboxGrow; public ProjectileUser(ProjectileManager throwInput, Entity thrown, LivingEntity thrower, IThrown callback, long expireTime, boolean hitPlayer, boolean hitBlock, boolean idle, boolean pickup, @@ -78,7 +78,7 @@ public class ProjectileUser _effectData = effectData; _effectRate = effectRate; - _hitboxMult = hitboxMult; + _hitboxGrow = hitboxMult; } public void Effect(UpdateEvent event) @@ -127,7 +127,7 @@ public class ProjectileUser ((CraftEntity)_thrown).getHandle().boundingBox.a( ((CraftEntity)_thrown).getHandle().motX, ((CraftEntity)_thrown).getHandle().motY, - ((CraftEntity)_thrown).getHandle().motZ).grow(_hitboxMult, _hitboxMult, _hitboxMult))) + ((CraftEntity)_thrown).getHandle().motZ).grow(_hitboxGrow, _hitboxGrow, _hitboxGrow))) { if (entity instanceof net.minecraft.server.v1_7_R4.Entity) { diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java index b95d909fb..5616119ee 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/Blizzard.java @@ -234,7 +234,7 @@ public class Blizzard extends SkillActive { Entry entry = snowBallIterator.next(); - if (!entry.getValue().isOnline()) + if (!entry.getKey().isValid() || entry.getKey().getTicksLived() > 60 || !entry.getValue().isOnline()) snowBallIterator.remove(); } } From 93abca0c0107205589ab84c1cb4cb025e939ef2a Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 4 Apr 2015 16:12:33 +1100 Subject: [PATCH 35/43] can no logner break levers and other usables in SG --- .../game/games/survivalgames/SurvivalGames.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index 9889abe2b..d1c49d258 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -246,20 +246,6 @@ public class SurvivalGames extends SoloGame BlockBreakAllow.add(Material.WEB.getId()); // Web BlockPlaceAllow.add(Material.WEB.getId()); - BlockBreakAllow.add(Material.TRIPWIRE.getId()); // Tripwire - BlockPlaceAllow.add(Material.TRIPWIRE.getId()); - - BlockBreakAllow.add(Material.TRIPWIRE_HOOK.getId()); // Wire Hook - BlockPlaceAllow.add(Material.TRIPWIRE_HOOK.getId()); - - BlockBreakAllow.add(Material.REDSTONE_WIRE.getId()); // Redstone Dust - BlockPlaceAllow.add(Material.REDSTONE_WIRE.getId()); - - BlockBreakAllow.add(Material.WOOD_PLATE.getId()); // Wood Pressure Plate - BlockPlaceAllow.add(Material.WOOD_PLATE.getId()); - - BlockBreakAllow.add(Material.LEVER.getId()); // Lever - BlockPlaceAllow.add(Material.LEVER.getId()); BlockBreakAllow.add(Material.LEAVES.getId()); // Leaves BlockBreakAllow.add(Material.LEAVES_2.getId()); // Leaves From 6c3fc3009ba61c5759e8ebafed9649dc6bd072e0 Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 6 Apr 2015 13:03:59 +1000 Subject: [PATCH 36/43] fixed sheep quest bug where players were unable to pick up sheep rapidly fixed bug where falling blocks were instantly hitting players --- .../src/nautilus/game/arcade/game/games/runner/Runner.java | 2 +- .../src/nautilus/game/arcade/game/games/sheep/SheepGame.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java index 67093233b..95a7aa264 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java @@ -189,7 +189,7 @@ public class Runner extends SoloGame implements IThrown byte data = block.getData(); MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR); FallingBlock ent = block.getWorld().spawnFallingBlock(block.getLocation(), id, data); - Manager.GetProjectile().AddThrow(ent, null, this, -1, true, false, false, false, 1f); + Manager.GetProjectile().AddThrow(ent, null, this, -1, true, false, false, false, 0.3f); blockIterator.remove(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index b00875e7b..769d08b71 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -259,7 +259,7 @@ public class SheepGame extends TeamGame for (Player player : GetPlayers(true)) { if (!Recharge.Instance.usable(player, "Sheep Stack")) - return; + continue; for (Entity ent : player.getWorld().getEntities()) { From cdb86d3ebbede7ce040dbacd7d843a508a5fdb3e Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 6 Apr 2015 17:17:36 +1000 Subject: [PATCH 37/43] champions exploit fixes and balance --- .../game/classcombat/Class/ClientClass.java | 38 +++++++++++++++++++ .../classcombat/Skill/Knight/AxeThrow.java | 11 +++--- .../classcombat/Skill/Mage/GlacialBlade.java | 4 +- .../game/classcombat/Skill/SkillFactory.java | 2 +- .../nautilus/game/arcade/ArcadeManager.java | 5 ++- .../games/champions/ChampionsDominate.java | 14 +++++++ .../game/games/champions/ChampionsTDM.java | 14 +++++++ .../games/champions/kits/KitAssassin.java | 2 + .../game/games/champions/kits/KitBrute.java | 2 + .../game/games/champions/kits/KitKnight.java | 2 + .../game/games/champions/kits/KitMage.java | 2 + .../game/games/champions/kits/KitRanger.java | 2 + 12 files changed, 89 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java index c42d12107..3d84208a3 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java @@ -26,6 +26,7 @@ import mineplex.minecraft.game.classcombat.Class.repository.token.SlotToken; import mineplex.minecraft.game.classcombat.Skill.ISkill; import mineplex.minecraft.game.classcombat.Skill.ISkill.SkillType; import mineplex.minecraft.game.classcombat.Skill.SkillFactory; +import mineplex.minecraft.game.classcombat.Skill.Knight.AxeThrow; import mineplex.minecraft.game.classcombat.item.ItemFactory; public class ClientClass @@ -372,6 +373,14 @@ public class ClientClass { _client.GetPlayer().getInventory().setItem(defaultItem.getKey(), defaultItem.getValue()); } + + for (ISkill skill : _skillMap.values()) + { + if (skill instanceof AxeThrow) + { + ((AxeThrow)skill).Reset(_client.GetPlayer()); + } + } } public void ResetToDefaults(boolean equipItems, boolean equipDefaultArmor) @@ -555,4 +564,33 @@ public class ClientClass } } + + //This is used to fix a dual class bug using Twitch broadcasting GUI (F6) + public void validateClassSkills(Player player) + { + if (_gameClass == null || _skillMap == null) + return; + + for (SkillType type : SkillType.values()) + { + if (type == SkillType.GlobalPassive) + continue; + + if (!_skillMap.containsKey(type)) + continue; + + ISkill skill = _skillMap.get(type); + + if (skill.GetClassType() != _gameClass.GetType()) + { + skill.Reset(player); + skill.RemoveUser(player); + + _skillMap.remove(type); + _lastSkillMap.remove(type); + + System.out.println("Removed " + skill.GetClassType() + " skill (" + skill.GetName() + ") for " + player.getName() + " "+ _gameClass.GetType()); + } + } + } } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java index 5fdbe380d..7101df6aa 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java @@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; 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.Skill.SkillActive; @@ -53,7 +54,7 @@ public class AxeThrow extends SkillActive implements IThrown SetDesc(new String[] { "Throw your axe with #0.7#0.1 velocity, ", - "dealing #6.5#0.5 damage.", + "dealing #5.5#0.5 damage.", "", "You pull your axe back to you when it", "collides with anything.", @@ -90,7 +91,7 @@ public class AxeThrow extends SkillActive implements IThrown player.setItemInHand(null); //Projectile - Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, false, 0.6f); + Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, false, 0.5f); //Store _thrown.put(item, player); @@ -111,7 +112,7 @@ public class AxeThrow extends SkillActive implements IThrown if (level <= 0) return; - double damage = 6.5 + 0.5 * level; + double damage = 5.5 + 0.5 * level; //Damage Event Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, @@ -186,7 +187,7 @@ public class AxeThrow extends SkillActive implements IThrown int level = getLevel(player); - if (item.getTicksLived() > 300 - level * 40) + if (item.getTicksLived() > 300 - level * 20) { _thrown.get(item).getInventory().addItem(item.getItemStack()); item.remove(); @@ -212,7 +213,7 @@ public class AxeThrow extends SkillActive implements IThrown } } } - + @Override public void Reset(Player player) { diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java index a0c06ff88..2c5cb4647 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java @@ -46,7 +46,7 @@ public class GlacialBlade extends SkillActive implements IThrown SetDesc(new String[] { "Swinging your sword releases a", - "shard of ice, dealing 4 damage", + "shard of ice, dealing 3.5 damage", "to anything it hits.", "", "Will not work if enemies are close." @@ -95,7 +95,7 @@ public class GlacialBlade extends SkillActive implements IThrown //Damage Factory.Damage().NewDamageEvent(target, data.GetThrower(), null, - DamageCause.CUSTOM, 4, false, true, false, + DamageCause.CUSTOM, 3.5, false, true, false, UtilEnt.getName(data.GetThrower()), GetName()); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java index bae3ebf03..ec45933d8 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/SkillFactory.java @@ -338,7 +338,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory AddSkill(new AxeThrow(this, "Roped Axe Throw", ClassType.Knight, SkillType.Axe, 1, 5, 0, 0, - 3000, -450, true, + 2200, -200, true, new Material[] {Material.IRON_AXE, Material.GOLD_AXE, Material.DIAMOND_AXE}, new Action[] {Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK})); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index e8fe0a152..6d2b7dbfa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -116,7 +116,7 @@ import nautilus.game.arcade.shop.ArcadeShop; public class ArcadeManager extends MiniPlugin implements IRelation { - // Modules + // Modules private BlockRestore _blockRestore; private Blood _blood; private Chat _chat; @@ -762,6 +762,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation player.setFireTicks(0); player.setFallDistance(0); + + player.eject(); + player.leaveVehicle(); player.setLevel(0); player.setExp(0f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index 2066d9589..a3b8b3edd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -2,6 +2,8 @@ package nautilus.game.arcade.game.games.champions; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.DeathMessageType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; @@ -120,4 +122,16 @@ public class ChampionsDominate extends Domination if (player.getOpenInventory().getTopInventory().getType() == InventoryType.CHEST) player.closeInventory(); } + + @EventHandler + public void validateSkills(UpdateEvent event) + { + if (event.getType() == UpdateType.SEC) + { + for (Player player : GetPlayers(true)) + { + Manager.getClassManager().Get(player).validateClassSkills(player); + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index 505ca592e..490688277 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -8,6 +8,8 @@ import org.bukkit.event.inventory.InventoryType; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.combat.DeathMessageType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.ArcadeManager; @@ -120,4 +122,16 @@ public class ChampionsTDM extends TeamDeathmatch if (player.getOpenInventory().getTopInventory().getType() == InventoryType.CHEST) player.closeInventory(); } + + @EventHandler + public void validateSkills(UpdateEvent event) + { + if (event.getType() == UpdateType.SEC) + { + for (Player player : GetPlayers(true)) + { + Manager.getClassManager().Get(player).validateClassSkills(player); + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitAssassin.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitAssassin.java index d4cfea278..cb1765619 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitAssassin.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitAssassin.java @@ -49,6 +49,8 @@ public class KitAssassin extends Kit @Override public void Selected(Player player) { + Manager.Clear(player); + _class.put(player, Manager.getClassManager().Get(player)); ClientClass clientClass = _class.get(player); IPvpClass pvpClass = Manager.getClassManager().GetClass("Assassin"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitBrute.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitBrute.java index 5a2be1d98..4462eb7a0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitBrute.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitBrute.java @@ -48,6 +48,8 @@ public class KitBrute extends Kit @Override public void Selected(Player player) { + Manager.Clear(player); + _class.put(player, Manager.getClassManager().Get(player)); ClientClass clientClass = _class.get(player); IPvpClass pvpClass = Manager.getClassManager().GetClass("Brute"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitKnight.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitKnight.java index e38d71a46..97bf4610d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitKnight.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitKnight.java @@ -45,6 +45,8 @@ public class KitKnight extends Kit @Override public void Selected(Player player) { + Manager.Clear(player); + AddPlayer(player); Manager.openClassShop(player); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitMage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitMage.java index 175496916..48e5b1296 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitMage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitMage.java @@ -45,6 +45,8 @@ public class KitMage extends Kit @Override public void Selected(Player player) { + Manager.Clear(player); + _class.put(player, Manager.getClassManager().Get(player)); ClientClass clientClass = _class.get(player); IPvpClass pvpClass = Manager.getClassManager().GetClass("Mage"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitRanger.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitRanger.java index 0db49711a..fd3789a38 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitRanger.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/kits/KitRanger.java @@ -45,6 +45,8 @@ public class KitRanger extends Kit @Override public void Selected(Player player) { + Manager.Clear(player); + _class.put(player, Manager.getClassManager().Get(player)); ClientClass clientClass = _class.get(player); IPvpClass pvpClass = Manager.getClassManager().GetClass("Ranger"); From e0a58ba165087faf92093167c41ae6a2f0f18c7e Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 6 Apr 2015 19:57:33 +1000 Subject: [PATCH 38/43] champions exploit fix update --- .../minecraft/game/classcombat/Class/ClientClass.java | 9 +++------ .../src/nautilus/game/arcade/ArcadeManager.java | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java index 3d84208a3..ae8816f3a 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Class/ClientClass.java @@ -584,12 +584,9 @@ public class ClientClass if (skill.GetClassType() != _gameClass.GetType()) { skill.Reset(player); - skill.RemoveUser(player); - - _skillMap.remove(type); - _lastSkillMap.remove(type); - - System.out.println("Removed " + skill.GetClassType() + " skill (" + skill.GetName() + ") for " + player.getName() + " "+ _gameClass.GetType()); + RemoveSkill(skill); + + System.out.println("[" + player.getName() + " / " + _gameClass.GetType() + "] Removed Invalid " + skill.GetClassType() + " Skill (" + skill.GetName() + ")"); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 6d2b7dbfa..c96a7d7b7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -116,7 +116,7 @@ import nautilus.game.arcade.shop.ArcadeShop; public class ArcadeManager extends MiniPlugin implements IRelation { - // Modules + // Modules private BlockRestore _blockRestore; private Blood _blood; private Chat _chat; From 4eb1f67d822dd180a50d7f93d07bc661cdb2817b Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 6 Apr 2015 04:13:13 -0700 Subject: [PATCH 39/43] Removed code to set default motd. --- .../src/mineplex/bungee/motd/MotdManager.java | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java index 56a2f0662..1ee1475a5 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -54,6 +54,7 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory public void run() { // Add in default MOTD listing to database + /* if (!_repository.elementExists("MainMotd")) { _repository.removeElement("MainMotd"); @@ -66,25 +67,17 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory lines.add(" §d§lHero Sale §a§l33% Off"); lines.add(" §a§lDouble Gems for 1.8 Players!"); - /* - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - lines.add("§a§l MOO"); - */ - updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines); - //updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMooplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines); } + */ GlobalMotd motd = _repository.getElement("MainMotd"); - _motdLines = motd.getMotd(); - _firstLine = motd.getHeadline(); + + if (motd != null) + { + _motdLines = motd.getMotd(); + _firstLine = motd.getHeadline(); + } InitialHandler.setCustomMotdFactory(this); } From 679d5faa9b1fdab1954d003104a843c5851febc1 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Mon, 6 Apr 2015 04:14:04 -0700 Subject: [PATCH 40/43] Motd pull on start. --- .../src/mineplex/bungee/motd/MotdManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java index 1ee1475a5..358e1d3b2 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java @@ -34,6 +34,7 @@ public class MotdManager implements Listener, Runnable, CustomMotdFactory _repository = new RedisDataRepository(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(), Region.ALL, GlobalMotd.class, "globalMotd"); + run(); } @EventHandler From 18ba446764a50bc0c11fccfb6eea4993bc9a45ea Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 7 Apr 2015 08:30:32 +1000 Subject: [PATCH 41/43] re-enabled MAC --- .../src/mineplex/core/antihack/AntiHack.java | 10 +++++----- .../src/mineplex/core/antihack/types/Reach.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index d14043a9a..7d203191d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -97,11 +97,11 @@ public class AntiHack extends MiniPlugin _movementDetectors = new ArrayList(); _combatDetectors = new ArrayList(); -// _movementDetectors.add(new Fly(this)); -// _movementDetectors.add(new Idle(this)); -// _movementDetectors.add(new Speed(this)); -// -// _combatDetectors.add(new Reach(this)); + _movementDetectors.add(new Fly(this)); + _movementDetectors.add(new Idle(this)); + _movementDetectors.add(new Speed(this)); + + _combatDetectors.add(new Reach(this)); _enabled = false; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Reach.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Reach.java index 257a35387..9bf8b4a00 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Reach.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Reach.java @@ -30,7 +30,7 @@ public class Reach extends MiniPlugin implements Detector public Reach (AntiHack host) { - super("Speed Detector", host.getPlugin()); + super("Reach Detector", host.getPlugin()); Host = host; } From 85c9f9010edde5acf0b4c6d2b277bfc8a4ac231d Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 10 Apr 2015 13:11:02 +1000 Subject: [PATCH 42/43] Added Twitch Rank fixes hitbox on glacial --- .../src/mineplex/core/common/Rank.java | 5 +++-- .../classcombat/Skill/Mage/GlacialBlade.java | 21 +------------------ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java index 32770cc1a..09ee3d266 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java @@ -14,14 +14,15 @@ public enum Rank SNR_MODERATOR("Sr.Mod", ChatColor.GOLD), MODERATOR("Mod", ChatColor.GOLD), HELPER("Helper", ChatColor.DARK_AQUA), - MAPDEV("Mapper", ChatColor.BLUE), - MAPLEAD("MapKing", ChatColor.DARK_PURPLE), + MAPDEV("MapTeam", ChatColor.BLUE), + MAPLEAD("MapLead", ChatColor.DARK_PURPLE), EVENT("Event", ChatColor.WHITE), //Staff ^^ YOUTUBE("YouTube", ChatColor.RED), + TWITCH("Twitch", ChatColor.DARK_PURPLE), LEGEND("Legend", ChatColor.GREEN), HERO("Hero", ChatColor.LIGHT_PURPLE), ULTRA("Ultra", ChatColor.AQUA), diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java index 2c5cb4647..e08ad1c21 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java @@ -27,8 +27,6 @@ import mineplex.minecraft.game.classcombat.Skill.SkillFactory; public class GlacialBlade extends SkillActive implements IThrown { - private float radius = 1.5f; - public GlacialBlade(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels, int energy, int energyMod, @@ -75,7 +73,7 @@ public class GlacialBlade extends SkillActive implements IThrown Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()).subtract(0, 0.2, 0), ItemStackFactory.Instance.CreateStack(370)); UtilAction.velocity(item, player.getLocation().getDirection(), 1.6, false, 0, 0.2, 10, false); Factory.Projectile().AddThrow(item, player, this, -1, true, true, true, - null, 0, 0, ParticleType.SNOW_SHOVEL, UpdateType.TICK, radius); + null, 0, 0, ParticleType.SNOW_SHOVEL, UpdateType.TICK, 0.4f); //Effect item.getWorld().playSound(item.getLocation(), Sound.ORB_PICKUP, 1f, 2f); @@ -124,21 +122,4 @@ public class GlacialBlade extends SkillActive implements IThrown { } - - @EventHandler - public void radiusSet(PlayerCommandPreprocessEvent event) - { - if (event.getMessage().startsWith("/gbr ")) - { - try - { - radius = Float.parseFloat(event.getMessage().split(" ")[1]); - event.getPlayer().sendMessage("Radius: " + radius); - } - catch(Exception e) - { - event.getPlayer().sendMessage("Radius FAIL: " + radius); - } - } - } } From 3d95a5cfa4036f398e249dcba7dcc588b409a152 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 10 Apr 2015 14:09:21 +1000 Subject: [PATCH 43/43] bloock toss fix --- .../classcombat/Skill/Brute/BlockToss.java | 29 ++++++++++--------- .../nautilus/game/arcade/ArcadeManager.java | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java index c7b6b4ed6..9bf9994fc 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java @@ -2,6 +2,7 @@ package mineplex.minecraft.game.classcombat.Skill.Brute; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import org.bukkit.Bukkit; import org.bukkit.Effect; @@ -264,26 +265,26 @@ public class BlockToss extends SkillCharge implements IThrown if (event.getType() != UpdateType.TICK) return; - HashSet fallen = new HashSet(); - - for (FallingBlock cur : _falling.keySet()) + Iterator fallIter = _falling.keySet().iterator(); + + while (fallIter.hasNext()) { - if (cur.isDead() || !cur.isValid()) - fallen.add(cur); - } - - for (FallingBlock cur : fallen) - { - _falling.remove(cur); - Block block = cur.getLocation().getBlock(); + FallingBlock fall = fallIter.next(); - if (block.getType() != cur.getMaterial()) + if (!fall.isDead() && fall.isValid()) continue; - + + fallIter.remove(); + + Block block = fall.getLocation().getBlock(); + + if (block.getType() != fall.getMaterial()) + continue; + block.setTypeIdAndData(0, (byte)0, false); //Block Replace - Factory.BlockRestore().Add(block, cur.getBlockId(), (byte)0, 10000); + Factory.BlockRestore().Add(block, fall.getBlockId(), (byte)0, 10000); //Effect block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index c96a7d7b7..69439f95f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -116,7 +116,7 @@ import nautilus.game.arcade.shop.ArcadeShop; public class ArcadeManager extends MiniPlugin implements IRelation { - // Modules + // Modules private BlockRestore _blockRestore; private Blood _blood; private Chat _chat;