diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 3e1b156..bd0a5de 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/CustomDamage.java b/src/sig/plugin/TwosideKeeper/CustomDamage.java index 5058b6c..91f4c90 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -98,6 +98,11 @@ public class CustomDamage { //Custom damage right here. flags = setFlag(flags,SPECIALATTACK); } + if (getDamagerEntity(damager) instanceof Player) { + Player p = (Player)getDamagerEntity(damager); + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + pd.lasthitproperties=NONE; + } if (!InvulnerableCheck(damager,target,flags)) { double dmg = 0.0; if (isFlagSet(flags,TRUEDMG)) { @@ -139,6 +144,7 @@ public class CustomDamage { dmg+=getBaseWeaponDamage(damage, weapon, damager, target, reason); if (weapon.getType()==Material.BOW) { if ((damager instanceof Projectile)) { + TwosideKeeper.log("This is a projectile! Reason: "+reason+", Damager: "+damager.toString(), 2); dmg += addMultiplierToPlayerLogger(damager,target,"Ranger Mult",dmg * calculateRangerMultiplier(weapon,damager)); double headshotdmg = addMultiplierToPlayerLogger(damager,target,"Headshot Mult",dmg * calculateHeadshotMultiplier(weapon,damager,target)); if (headshotdmg!=0.0) {headshot=true;} @@ -440,9 +446,9 @@ public class CustomDamage { int resistancelv = GenericFunctions.getPotionEffectLevel(PotionEffectType.DAMAGE_RESISTANCE, p); int resistance_duration = GenericFunctions.getPotionEffectDuration(PotionEffectType.DAMAGE_RESISTANCE, p); if (resistancelv>0) { - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,Math.max(resistance_duration,20*20),resistancelv-1),true); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE, Math.max(resistance_duration,20*20), resistancelv-1, p, true); } else { - p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.DAMAGE_RESISTANCE,p); } pd.swiftaegisamt--; TwosideKeeper.log(pd.swiftaegisamt+" stacks of Aegis remaining.", 5); @@ -1054,10 +1060,10 @@ public class CustomDamage { pd.iframetime=TwosideKeeper.getServerTickTime()+ticks; int level = GenericFunctions.getPotionEffectLevel(PotionEffectType.NIGHT_VISION, p); if (level==64) { - p.removePotionEffect(PotionEffectType.NIGHT_VISION); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.NIGHT_VISION,p); } - p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,ticks,0),true); - p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,ticks,64)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.GLOWING, ticks, 0, p, true); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.NIGHT_VISION,ticks,64, p); } } } @@ -1075,12 +1081,12 @@ public class CustomDamage { if (p!=null) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); pd.iframetime=0; - p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,1,1), true); - p.removePotionEffect(PotionEffectType.GLOWING); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.GLOWING,1,1,p,true); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.GLOWING,p); int level = GenericFunctions.getPotionEffectLevel(PotionEffectType.NIGHT_VISION, p); if (level==64) { - p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,1,1), true); - p.removePotionEffect(PotionEffectType.NIGHT_VISION); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.NIGHT_VISION,1,1,p,true); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.NIGHT_VISION,p); } } } @@ -1345,7 +1351,9 @@ public class CustomDamage { TwosideKeeper.log("Distance: "+(arrowLoc.distanceSquared(monsterHead)), 5); double headshotvaly=0.22/TwosideKeeper.HEADSHOT_ACC; + TwosideKeeper.log("In here.", 2); if (proj.getShooter() instanceof Player) { + TwosideKeeper.log("We somehow made it to here???", 2); Player p = (Player)proj.getShooter(); if (PlayerMode.isRanger(p) && GenericFunctions.getBowMode(weapon)==BowMode.SNIPE) { @@ -1374,18 +1382,18 @@ public class CustomDamage { if (Iterables.get(p.getActivePotionEffects(), i1).getType().equals(PotionEffectType.SLOW)) { int lv = Iterables.get(p.getActivePotionEffects(), i1).getAmplifier(); TwosideKeeper.log("New Slowness level: "+lv,5); - p.removePotionEffect(PotionEffectType.SLOW); - p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,99,lv+1)); - p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,99,lv+1)); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.SLOW,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SLOW,99,lv+1,p); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.DAMAGE_RESISTANCE,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE,99,lv+1,p); break; } } } else { - p.removePotionEffect(PotionEffectType.SLOW); - p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,99,0)); - p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,99,0)); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.SLOW,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SLOW,99,0,p); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.DAMAGE_RESISTANCE,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE,99,0,p); } final Player pl = p; Bukkit.getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("TwosideKeeper"), new Runnable() { @@ -1903,10 +1911,10 @@ public class CustomDamage { if (totalmoney>=0.01) { p_loc.setY(0); p.teleport(p_loc); - p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,20*2 /*Approx 2 sec of no movement.*/,10)); - p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,20*18 /*Approx 18 sec to reach height 100*/,6)); - p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*18 /*Approx 18 sec to reach height 100*/,6)); - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,20*26 /*Reduces fall damage temporarily.*/,500)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SLOW,20*2,10,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.REGENERATION,20*16,6,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.LEVITATION,20*18,6,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE,20*26,50,p); DecimalFormat df = new DecimalFormat("0.00"); double rand_amt = 0.0; if (totalmoney>5) { diff --git a/src/sig/plugin/TwosideKeeper/DeathManager.java b/src/sig/plugin/TwosideKeeper/DeathManager.java index d77cf81..da86302 100644 --- a/src/sig/plugin/TwosideKeeper/DeathManager.java +++ b/src/sig/plugin/TwosideKeeper/DeathManager.java @@ -16,6 +16,7 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure; +import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; public class DeathManager { static String Pick5Text = "Mercy (Pick 5 Lost Items)"; @@ -33,8 +34,8 @@ public class DeathManager { Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() { @Override public void run() { - p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,15,-2),true); - p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,15,100),true); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.LEVITATION,15,-2,p,true); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.JUMP,15,100,p,true); p.setVelocity(new Vector(0,0,0)); CustomDamage.removeIframe(p); Location loc = p.getLocation(); diff --git a/src/sig/plugin/TwosideKeeper/EliteMonster.java b/src/sig/plugin/TwosideKeeper/EliteMonster.java index f7feca3..573e38f 100644 --- a/src/sig/plugin/TwosideKeeper/EliteMonster.java +++ b/src/sig/plugin/TwosideKeeper/EliteMonster.java @@ -318,15 +318,15 @@ public class EliteMonster { if (Math.random()<=0.01) { Player p = ChooseRandomTarget(); //p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31)); - p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,20*5,-1)); - p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*1,7)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.JUMP,20*5,-1,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS,20*1,7,p); if (Math.random()<=0.25) { m.setTarget(p); } p.setFlying(false); p.setVelocity(new Vector(0,-1,0)); - p.removePotionEffect(PotionEffectType.LEVITATION); - p.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION,(int)(20*2.25),0)); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.LEVITATION,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.CONFUSION,(int)(20*2.25),0,p); p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f); p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f); } @@ -466,7 +466,7 @@ public class EliteMonster { dpslist.put(p.getName(), currentdps+dmg); if ((!p.hasPotionEffect(PotionEffectType.WEAKNESS) || GenericFunctions.getPotionEffectLevel(PotionEffectType.WEAKNESS, p)<9) && !PlayerMode.isRanger(p)) { - p.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS,35,9),true); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.WEAKNESS,35,9,p,true); } } last_regen_time=TwosideKeeper.getServerTickTime(); @@ -645,7 +645,7 @@ public class EliteMonster { private Player ChooseRandomTarget() { if (targetlist.size()>0) { Player p = targetlist.get((int)(Math.random() * targetlist.size())); - p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*1,7)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS,20*1,7,p); m.setTarget(p); TwosideKeeper.log("Set new target to "+p.getName(), 2); return p; @@ -690,7 +690,7 @@ public class EliteMonster { Player p = (Player)ent; if (storingenergy_hit>0) { p.playSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f); - p.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION,20*4,0)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.CONFUSION,20*4,0,p); TwosideKeeper.log("Got hit for "+storingenergy_hit+" damage!", 2); GenericFunctions.removeNoDamageTick(p, m); if (CustomDamage.ApplyDamage(storingenergy_hit, m, p, null, "Stored Energy")) { diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 6e270d7..5870933 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -40,6 +40,7 @@ import org.inventivetalent.glow.GlowAPI.Color; import com.google.common.collect.Iterables; +import aPlugin.DiscordMessageSender; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; @@ -1146,7 +1147,7 @@ public class GenericFunctions { case THICK: return "Thick Arrow"; case UNCRAFTABLE: - return "Arrow"; + return "Tipped Arrow"; case WATER: return "Water Bottle"; case WATER_BREATHING: @@ -1158,7 +1159,7 @@ public class GenericFunctions { return "Arrow of Weakness"; } default: - return "Arrow"; + return "Tipped Arrow"; } } case LINGERING_POTION:{ @@ -2721,11 +2722,54 @@ public class GenericFunctions { } ApplySwiftAegis(p); CustomDamage.addIframe(dodgeduration, p); - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,dodgeduration,2)); - //TwosideKeeper.log("Added "+dodgeduration+" glowing ticks to "+p.getName()+" for dodging.",3); + + + logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED,dodgeduration,2,p); } } } + + public static void logAndApplyPotionEffectToPlayer(PotionEffectType type, int ticks, int amplifier, Player p) { + logAndApplyPotionEffectToPlayer(type,ticks,amplifier,p,false); + } + + public static void logAndApplyPotionEffectToPlayer(PotionEffectType type, int ticks, int amplifier, Player p, boolean force) { + TwosideKeeper.log(ChatColor.WHITE+"Adding Potion Effect "+type.getName()+" "+WorldShop.toRomanNumeral((amplifier+1))+"("+amplifier+") to "+p.getName()+" with "+ticks+" tick duration. "+((force)?ChatColor.RED+"FORCED":""), TwosideKeeper.POTION_DEBUG_LEVEL); + if (p.hasPotionEffect(type)) { + TwosideKeeper.log(ChatColor.YELLOW+" Already had effect on Player "+p.getName()+". "+type.getName()+" "+WorldShop.toRomanNumeral((getPotionEffectLevel(type,p)+1))+"("+getPotionEffectLevel(type,p)+"), Duration: "+getPotionEffectDuration(type,p)+" ticks", TwosideKeeper.POTION_DEBUG_LEVEL); + if (!force) { + TwosideKeeper.log(ChatColor.RED+" This should not be overwritten due to no FORCE!", TwosideKeeper.POTION_DEBUG_LEVEL); + } + } + p.addPotionEffect(new PotionEffect(type,ticks,amplifier),force); + TwosideKeeper.log(ChatColor.GRAY+" Effect on Player "+p.getName()+" is now "+type.getName()+" "+WorldShop.toRomanNumeral((amplifier+1))+"("+amplifier+"), Duration: "+ticks+" ticks", TwosideKeeper.POTION_DEBUG_LEVEL); + if (amplifier==-1 || ticks==0) { + //Something really bad happened!!! + TwosideKeeper.log("OUT OF PARAMETERS! Reporting", TwosideKeeper.POTION_DEBUG_LEVEL); + StackTraceElement[] stacktrace = new Throwable().getStackTrace(); + StringBuilder stack = new StringBuilder("Mini stack tracer:"); + for (int i=0;i { - p.removePotionEffect(eff.getType()); + logAndRemovePotionEffectFromPlayer(eff.getType(),p); }, 1); } } @@ -3601,10 +3653,10 @@ public class GenericFunctions { if (resistancelv+swiftaegislv<9) { //Apply it directly. pd.swiftaegisamt+=swiftaegislv; - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration), (resistancelv+swiftaegislv)),true); + logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration), (resistancelv+swiftaegislv),p,true); } else { pd.swiftaegisamt+=Math.max(9-resistancelv,0); - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration), 9),true); + logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration),9,p,true); } } TwosideKeeper.log("New Aegis level: "+pd.swiftaegisamt,5); @@ -3639,12 +3691,12 @@ public class GenericFunctions { int currentlv = getPotionEffectLevel(type,p); PotionEffect neweffect = new PotionEffect(type,tick_duration,(currentlv+incr_amt= duration) { - p.removePotionEffect(type); - p.addPotionEffect(neweffect, true); + logAndRemovePotionEffectFromPlayer(type,p); + logAndApplyPotionEffectToPlayer(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true); } } else { - PotionEffect neweffect = new PotionEffect(type,tick_duration,0); - p.addPotionEffect(neweffect); + PotionEffect neweffect = new PotionEffect(type,tick_duration,0); + logAndApplyPotionEffectToPlayer(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p); } } diff --git a/src/sig/plugin/TwosideKeeper/SpleefGame.java b/src/sig/plugin/TwosideKeeper/SpleefGame.java index a611df7..49cec31 100644 --- a/src/sig/plugin/TwosideKeeper/SpleefGame.java +++ b/src/sig/plugin/TwosideKeeper/SpleefGame.java @@ -21,6 +21,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import sig.plugin.TwosideKeeper.HelperStructures.SpleefArena; +import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -328,7 +329,7 @@ public class SpleefGame implements Listener { (corner1.getBlockZ()>corner2.getBlockZ())?(corner1.getBlockZ()-2-(Math.random()*(corner1.getBlockZ()-corner2.getBlockZ()-4))):(corner2.getBlockZ()-2-(Math.random()*(corner2.getBlockZ()-corner1.getBlockZ()-4))) ), TeleportCause.PLUGIN); //Give players Resistance 100 so they can never die. - Bukkit.getServer().getPlayer(players.get(i).player).addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,99999,100)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE,99999,100,Bukkit.getServer().getPlayer(players.get(i).player)); } active=true; starttime=TwosideKeeper.getServerTickTime(); @@ -385,7 +386,7 @@ public class SpleefGame implements Listener { void RemovePlayer(SpleefPlayerData p, RemovePlayerReason rs) { p.ClearInventory(); p.RestoreInventory(); - Bukkit.getServer().getPlayer(p.player).removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.DAMAGE_RESISTANCE,Bukkit.getServer().getPlayer(p.player)); for (int i=0;i=0 && p.getLocation().getY()<=255 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,20,1)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED,20,1,p); } } if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand()) && p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().getY()<=255 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,20,1)); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED,20,1,p); //log("Apply speed. The light level here is "+p.getLocation().add(0,-1,0).getBlock().getLightLevel(),2); } @@ -729,10 +730,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (absorption_amt>0) { if (p.hasPotionEffect(PotionEffectType.ABSORPTION)) { int oldlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.ABSORPTION, p)+1; - p.removePotionEffect(PotionEffectType.ABSORPTION); - p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4)+oldlv)); + GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.ABSORPTION,p); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4)+oldlv,p); } else { - p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4))); + GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4),p); } } } @@ -941,6 +942,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { public static CustomPotion LIFE_VIAL; public static CustomPotion HARDENING_VIAL; + public static final int POTION_DEBUG_LEVEL=1; + public static final int DODGE_COOLDOWN=100; public static final int DEATHMARK_COOLDOWN=240; public static final int EARTHWAVE_COOLDOWN=300; @@ -1230,7 +1233,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (p.getLocation().add(0,0,0).getBlock().getType()==Material.PISTON_MOVING_PIECE) { p.getLocation().add(0,0,0).getBlock().setType(Material.AIR); } - if (SERVER_TYPE==ServerType.TEST && p.isOp()) { + if ((SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) && p.isOp()) { /*PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); pd.swordcombo=20;*/ /*float f = ((org.bukkit.craftbukkit.v1_9_R1.entity.CraftLivingEntity)p).getHandle().getAbsorptionHearts(); @@ -1238,6 +1241,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (args.length>0) { ((org.bukkit.craftbukkit.v1_9_R1.entity.CraftLivingEntity)p).getHandle().setAbsorptionHearts(Float.valueOf(args[0])); }*/ + + /* + StackTraceElement[] stacktrace = new Throwable().getStackTrace(); + StringBuilder stack = new StringBuilder("Mini stack tracer:"); + for (int i=0;i entities = player.getNearbyEntities(16, 16, 16); for (int i=0;inewartifact.getEnchantmentLevel(e)) { - log("Contains "+e.toString()+" "+newartifact.getEnchantmentLevel(e), 5); + log("Contains "+e.toString()+" "+newartifact.getEnchantmentLevel(e), 2); //These are the enchantments that clash. If the resultitem ones are greater, apply them to the new item. newartifact.addUnsafeEnchantment(e, artifact_item.getEnchantmentLevel(e)); - log("Applied "+e.getName()+" "+artifact_item.getEnchantmentLevel(e)+" to the artifact",5); + log("Applied "+e.getName()+" "+artifact_item.getEnchantmentLevel(e)+" to the artifact",2); } } for (int i=0;i