diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 66ccf62..54ecde4 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 46e1219..5ec2a4b 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.10.1 +version: 3.10.2 commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java b/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java index 6755674..25e9b83 100644 --- a/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java +++ b/src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java @@ -341,6 +341,11 @@ public class EliteZombie extends EliteMonster{ bar.setColor(BarColor.RED); if (!targetlist.contains(damager) && (damager instanceof Player)) { targetlist.add((Player)damager); + if (targetlist.size()>4) { + double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4)); + m.setMaxHealth(baseHP+hpgain); + m.setHealth(m.getHealth()+hpgain); + } } if (!participantlist.contains(damager) && (damager instanceof Player)) { participantlist.add((Player)damager); @@ -526,9 +531,9 @@ public class EliteZombie extends EliteMonster{ } else { b.setType(storedblocks.get(b)); } - aPlugin.API.sendSoundlessExplosion(target_leap_loc, 4); SoundUtils.playGlobalSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f); } + aPlugin.API.sendSoundlessExplosion(target_leap_loc, 4); storedblocks.clear(); SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f); List nearbyplayers = GenericFunctions.getNearbyPlayers(target_leap_loc, radius); @@ -549,6 +554,11 @@ public class EliteZombie extends EliteMonster{ public void hitEvent(LivingEntity ent) { if (!targetlist.contains(ent) && (ent instanceof Player)) { targetlist.add((Player)ent); + if (targetlist.size()>4) { + double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4)); + m.setMaxHealth(baseHP+hpgain); + m.setHealth(m.getHealth()+hpgain); + } } if (Math.random()<=0.33) { if (ent.hasPotionEffect(PotionEffectType.POISON)) { diff --git a/src/sig/plugin/TwosideKeeper/CustomDamage.java b/src/sig/plugin/TwosideKeeper/CustomDamage.java index 380121c..836f27a 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -380,7 +380,11 @@ public class CustomDamage { if (getDamagerEntity(damager) instanceof Player) { Player p = (Player)getDamagerEntity(damager); PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); - return pd.partybonus*0.1; + if (pd.partybonus>6) { + return 6*0.1d; + } else { + return pd.partybonus*0.1; + } } return 0.0; } @@ -513,13 +517,17 @@ public class CustomDamage { removePermEnchantments(p,item); } + damage = IncreaseDamageDealtByElites(p, damager, damage); + damage = calculateDefenderAbsorption(p, damager, damage, reason); damage = sendDamageToDamagePool(p, damage, reason); damage = modifyFateBasedOnHolidayTreats(p, damage); - if (GenericFunctions.AttemptRevive(p, damage, reason)) { + damage = preventPoisonDamageFromKilling(p, damage, reason); + + if (damage>0 && GenericFunctions.AttemptRevive(p, damage, reason)) { damage=0; } } @@ -688,6 +696,33 @@ public class CustomDamage { return damage; } + private static double IncreaseDamageDealtByElites(Player p, Entity damager, double damage) { + LivingEntity shooter = getDamagerEntity(damager); + if (shooter!=null) { + LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(shooter); + if (les.isElite) { + for (EliteMonster bm : TwosideKeeper.elitemonsters) { + if (bm.getMonster().getUniqueId().equals(shooter.getUniqueId())) { + if (bm.getTargetList().size()>4) { + damage += damage*((bm.getTargetList().size()-4)*0.05); + } + } + } + } + } + return damage; + } + + private static double preventPoisonDamageFromKilling(Player p, double damage, String reason) { + if (reason!=null && reason.equalsIgnoreCase("POISON") && p.getHealth()<=damage) { + p.setHealth(1); + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + pd.slayermodehp=1; + return 0; + } + return damage; + } + private static double modifyFateBasedOnHolidayTreats(Player p, double damage) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (pd.lastcandyconsumed+409) {partylevel=9;} + if (partylevel>6) {partylevel=6;} if (p.getLocation().getY()>=0) {TwosideKeeper.log("Light level: "+p.getLocation().add(0,0,0).getBlock().getLightLevel(),5);} for (int i=0;i targetlist = new ArrayList(); protected List participantlist = new ArrayList(); @@ -63,6 +64,7 @@ public class EliteMonster { this.myspawn=m.getLocation(); bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SEGMENTED_6, BarFlag.CREATE_FOG); willpower_bar = m.getServer().createBossBar("Willpower", BarColor.PINK, BarStyle.SOLID, BarFlag.CREATE_FOG); + this.baseHP = m.getMaxHealth(); } public void runTick() { @@ -214,6 +216,12 @@ public class EliteMonster { bar.setColor(BarColor.GREEN); m.setHealth(Math.min(m.getHealth()+1,m.getMaxHealth())); } + if (m.getMaxHealth()>(baseHP+(baseHP*(0.25*((targetlist.size()>4)?(targetlist.size()-4):0))))) { + m.setMaxHealth((baseHP+(baseHP*(0.25*((targetlist.size()>4)?(targetlist.size()-4):0))))); + if (m.getHealth()>m.getMaxHealth()) { + m.setHealth(m.getMaxHealth()); + } + } } public void runPlayerLeaveEvent(Player p) { @@ -227,6 +235,11 @@ public class EliteMonster { bar.setColor(BarColor.RED); if (!targetlist.contains(damager) && (damager instanceof Player)) { targetlist.add((Player)damager); + if (targetlist.size()>4) { + double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4)); + m.setMaxHealth(baseHP+hpgain); + m.setHealth(m.getHealth()+hpgain); + } } if (!participantlist.contains(damager) && (damager instanceof Player)) { participantlist.add((Player)damager); @@ -263,6 +276,11 @@ public class EliteMonster { public void hitEvent(LivingEntity ent) { if (!targetlist.contains(ent) && (ent instanceof Player)) { targetlist.add((Player)ent); + if (targetlist.size()>4) { + double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4)); + m.setMaxHealth(baseHP+hpgain); + m.setHealth(m.getHealth()+hpgain); + } } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 6f0a774..1c39152 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -2571,8 +2571,9 @@ public class GenericFunctions { return pd.hasfullrangerset;*/ } - public static ItemStack applyModeName(ItemStack item) { - if (item!=null && + @Deprecated + public static void applyModeName(ItemStack item) { + /*if (item!=null && item.getType()!=Material.AIR && item.hasItemMeta()) { ItemMeta m = item.getItemMeta(); @@ -2599,12 +2600,12 @@ public class GenericFunctions { ItemMeta m = item.getItemMeta(); String newname = UserFriendlyMaterialName(item)+" "+ChatColor.GREEN+"("+CapitalizeFirstLetters(getBowMode(item).GetCoolName())+" Mode)"+ChatColor.WHITE; m.setDisplayName(newname); - item.setItemMeta(m); - return item; + item.setItemMeta(m);*/ + //return item; } - public static BowMode getBowMode(ItemStack item) { - if (item!=null && + public static BowMode getBowMode(Player p) { + /*if (item!=null && item.getType()!=Material.AIR && item.hasItemMeta()) { if (!item.getItemMeta().hasLore()) { @@ -2621,11 +2622,13 @@ public class GenericFunctions { } } else { return BowMode.CLOSE; - } + }*/ + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + return pd.rangermode; } - public static ItemStack setBowMode(ItemStack item, BowMode mode) { - if (item!=null && + public static void setBowMode(Player p, BowMode mode) { + /*if (item!=null && item.getType()!=Material.AIR && item.hasItemMeta()) { ItemMeta m = item.getItemMeta(); @@ -2650,6 +2653,10 @@ public class GenericFunctions { } } return item; + */ + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + pd.rangermode = mode; + GenericFunctions.sendActionBarMessage(p, ChatColor.BLUE+"Bow Mode: "+ChatColor.GOLD+mode.GetCoolName()+" Mode"+ChatColor.RESET, true); } public static void AutoRepairItems(Player p) { @@ -2783,7 +2790,7 @@ public class GenericFunctions { @SuppressWarnings("deprecation") public static void PerformDodge(Player p) { if (p.isOnGround() && PlayerMode.isRanger(p) && - (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE)) { + (GenericFunctions.getBowMode(p)==BowMode.CLOSE)) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (pd.last_dodge+GetModifiedCooldown(TwosideKeeper.DODGE_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) { PlayerTumbleEvent ev = new PlayerTumbleEvent(p); @@ -3447,6 +3454,7 @@ public class GenericFunctions { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); pd.lastdamagetaken=dmg; pd.lasthitdesc=reason; + pd.slayermodehp = p.getMaxHealth(); ItemStack[] equips = p.getEquipment().getArmorContents(); ItemStack[] hotbar = GenericFunctions.getHotbarItems(p); @@ -3455,7 +3463,6 @@ public class GenericFunctions { pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN, p)<=TwosideKeeper.getServerTickTime()) { pd.lastlifesavertime=TwosideKeeper.getServerTickTime(); RevivePlayer(p,p.getMaxHealth()); - pd.slayermodehp = p.getMaxHealth(); if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {GenericFunctions.applyStealth(p,false);} GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED, 20*10, 3, p, true); deAggroNearbyTargets(p); @@ -3489,7 +3496,7 @@ public class GenericFunctions { return revived; } - private static void RandomlyBreakBaubles(Player p, ItemStack[] hotbar) { + public static void RandomlyBreakBaubles(Player p, ItemStack[] hotbar) { for (int i=0;i<9;i++) { ItemSet set = ItemSet.GetSet(hotbar[i]); if (set!=null) { @@ -3529,8 +3536,8 @@ public class GenericFunctions { } } - private static void RevivePlayer(Player p, double healdmg) { - p.setHealth(healdmg); + public static void RevivePlayer(Player p, double healdmg) { + p.setHealth(Math.min(healdmg,p.getMaxHealth())); SoundUtils.playLocalSound(p, Sound.BLOCK_REDSTONE_TORCH_BURNOUT, 1.0f, 1.5f); for (PotionEffect eff : p.getActivePotionEffects()) { if (isBadEffect(eff.getType())) { @@ -3540,6 +3547,8 @@ public class GenericFunctions { }, 1); } } + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + pd.slayermodehp = Math.min(healdmg,p.getMaxHealth()); p.setFireTicks(0); CustomDamage.addIframe(40, p); //p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,20,0)); @@ -4473,7 +4482,7 @@ public class GenericFunctions { finalmsg=message+" "+prefix; if (important || (pd.lastimportantactionbarmsg+200) { + if (prefix.length()>0 || aPlugin.API.getLastXPBar(p).length() > 2) { aPlugin.API.sendActionBarMessage(p, String.format(aPlugin.API.getLastXPBar(p), finalmsg)); } else { if (message.length()>0) { @@ -4666,7 +4675,7 @@ public class GenericFunctions { @SuppressWarnings("deprecation") public static void PerformArrowBarrage(Player p) { if (p.isOnGround() && PlayerMode.isRanger(p) && - (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE)) { + (GenericFunctions.getBowMode(p)==BowMode.SNIPE)) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (pd.last_arrowbarrage+GetModifiedCooldown(TwosideKeeper.ARROWBARRAGE_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) { pd.last_arrowbarrage=TwosideKeeper.getServerTickTime(); @@ -4679,7 +4688,7 @@ public class GenericFunctions { @SuppressWarnings("deprecation") public static void PerformSiphon(Player p) { if (p.isOnGround() && PlayerMode.isRanger(p) && - (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.DEBILITATION)) { + (GenericFunctions.getBowMode(p)==BowMode.DEBILITATION)) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (pd.last_siphon+GetModifiedCooldown(TwosideKeeper.SIPHON_COOLDOWN,p)<=TwosideKeeper.getServerTickTime()) { List list = GenericFunctions.getNearbyMobs(p.getLocation(), 16); diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/EntityUtils.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/EntityUtils.java index c50ec19..ca9a29b 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/EntityUtils.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/EntityUtils.java @@ -29,7 +29,7 @@ public class EntityUtils { for (Entity e : ents) { if (e instanceof LivingEntity) { LivingEntityDifficulty diff = MonsterController.getLivingEntityDifficulty((LivingEntity)e); - if (e.getType()==type && !strongest.isStronger(diff)) { + if (e!=null && e.getType()==type && (strongest==null || !strongest.isStronger(diff))) { strongest = diff; } } diff --git a/src/sig/plugin/TwosideKeeper/PartyManager.java b/src/sig/plugin/TwosideKeeper/PartyManager.java index eed0bfd..c5d784e 100644 --- a/src/sig/plugin/TwosideKeeper/PartyManager.java +++ b/src/sig/plugin/TwosideKeeper/PartyManager.java @@ -90,7 +90,7 @@ public class PartyManager { int membercount = partymembers.size(); StringBuilder partydisplay = new StringBuilder(""); if (membercount>=2) { - int dmgbonus=((membercount-1)<10)?(membercount-1)*10:90; + int dmgbonus=((membercount-1)<6)?(membercount-1)*10:60; partydisplay.append(" +"+dmgbonus+"%DMG/DEF"); } return partydisplay.toString(); diff --git a/src/sig/plugin/TwosideKeeper/PlayerStructure.java b/src/sig/plugin/TwosideKeeper/PlayerStructure.java index f99b7b6..b61ded4 100644 --- a/src/sig/plugin/TwosideKeeper/PlayerStructure.java +++ b/src/sig/plugin/TwosideKeeper/PlayerStructure.java @@ -21,6 +21,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BookMeta; import org.bukkit.potion.PotionEffect; +import sig.plugin.TwosideKeeper.HelperStructures.BowMode; import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure; import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.ServerType; @@ -156,6 +157,7 @@ public class PlayerStructure { public long lastsneak=0; public long lastcombat=0; public long lastsantabox=0; + public BowMode rangermode=BowMode.CLOSE; public boolean isPlayingSpleef=false; diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 3c50d0b..d9e5269 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -1073,6 +1073,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { case "WITHER":{ LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.WITHER), MonsterDifficulty.ELITE); }break; + case "ELITE":{ + LivingEntity m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE); + }break; case "VACUUM":{ ItemStack[] remaining = InventoryUtils.insertItemsInVacuumCube(p, new ItemStack(Material.ENDER_PEARL,16), new ItemStack(Material.IRON_PICKAXE,1), new ItemStack(Material.GOLDEN_APPLE,64)); for (ItemStack items : remaining) { @@ -2636,7 +2639,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (PlayerMode.isRanger(p) && p.isSneaking() && p.getEquipment().getItemInMainHand().getType()==Material.BOW) { //Rotate Bow Modes. GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.SLOW,p); - BowMode mode = GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand()); + BowMode mode = GenericFunctions.getBowMode(p); PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); if (ev.getAction().name().contains("RIGHT")) { if (pd.lastbowmodeswitch+6>=getServerTickTime()) { @@ -2645,17 +2648,17 @@ public class TwosideKeeper extends JavaPlugin implements Listener { switch (mode) { case CLOSE:{ SoundUtils.playLocalSound(p, Sound.ENTITY_ZOMBIE_INFECT, 0.5f, 0.1f); - GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.SNIPE); + GenericFunctions.setBowMode(p,BowMode.SNIPE); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_arrowbarrage, ARROWBARRAGE_COOLDOWN)); }break; case SNIPE:{ SoundUtils.playLocalSound(p, Sound.BLOCK_BREWING_STAND_BREW, 0.5f, 0.1f); - GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.DEBILITATION); + GenericFunctions.setBowMode(p,BowMode.DEBILITATION); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_siphon, SIPHON_COOLDOWN)); }break; case DEBILITATION:{ SoundUtils.playLocalSound(p, Sound.BLOCK_CHEST_LOCKED, 0.5f, 3.5f); - GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.CLOSE); + GenericFunctions.setBowMode(p,BowMode.CLOSE); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_dodge, DODGE_COOLDOWN)); }break; } @@ -2667,24 +2670,28 @@ public class TwosideKeeper extends JavaPlugin implements Listener { switch (mode) { case CLOSE:{ SoundUtils.playLocalSound(p, Sound.BLOCK_BREWING_STAND_BREW, 0.5f, 0.1f); - GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.DEBILITATION); + GenericFunctions.setBowMode(p,BowMode.DEBILITATION); + //GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand()); + p.updateInventory(); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_siphon, SIPHON_COOLDOWN)); }break; case SNIPE:{ SoundUtils.playLocalSound(p, Sound.BLOCK_CHEST_LOCKED, 0.5f, 3.5f); - GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.CLOSE); + GenericFunctions.setBowMode(p,BowMode.CLOSE); + //GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand()); + p.updateInventory(); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_dodge, DODGE_COOLDOWN)); }break; case DEBILITATION:{ SoundUtils.playLocalSound(p, Sound.ENTITY_ZOMBIE_INFECT, 0.5f, 0.1f); - GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(),BowMode.SNIPE); + GenericFunctions.setBowMode(p,BowMode.SNIPE); + //GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand()); + p.updateInventory(); aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_arrowbarrage, ARROWBARRAGE_COOLDOWN)); }break; } pd.lastbowmodeswitch=getServerTickTime(); } - GenericFunctions.applyModeName(p.getEquipment().getItemInMainHand()); - p.updateInventory(); ev.setCancelled(true); return; } @@ -5658,7 +5665,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); if (PlayerMode.isRanger(p) && - GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE) { + GenericFunctions.getBowMode(p)==BowMode.CLOSE) { pd.fulldodge=true; } @@ -5782,7 +5789,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } if (isRanger) { - switch (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())) { + switch (GenericFunctions.getBowMode(p)) { case CLOSE:{ BowLogger.AddCloseMode(); }break; @@ -7006,7 +7013,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } if (PlayerMode.isRanger(p)) { LivingEntity findtarget = aPlugin.API.rayTraceTargetEntity(p,100); - if (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) { + if (GenericFunctions.getBowMode(p)==BowMode.SNIPE) { if (findtarget==null || !p.hasLineOfSight(findtarget)) { arr.setVelocity(arr.getVelocity().multiply(1000)); } else { @@ -7023,7 +7030,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); pd.lastarrowpower=arr.getVelocity().lengthSquared(); - pd.lastarrowwasinrangermode=(PlayerMode.isRanger(p)&&GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE); + pd.lastarrowwasinrangermode=(PlayerMode.isRanger(p)&&GenericFunctions.getBowMode(p)==BowMode.SNIPE); log("Arrow velocity is "+arr.getVelocity().lengthSquared(),5); arr.setCustomName("HIT"); if (arr.hasMetadata("INFINITEARROW")) {