diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 6f34d22..7c4ba41 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 6e24160..e695d2a 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -1195,7 +1195,8 @@ public class CustomDamage { } private static void subtractWeaponDurability(Player p,ItemStack weapon) { - aPlugin.API.damageItem(p.getInventory(), weapon, 1); + //aPlugin.API.damageItem(p.getInventory(), weapon, 1); + aPlugin.API.damageItem(p, weapon, 1); } static void triggerEliteEvent(Player p, Entity damager) { @@ -1385,11 +1386,13 @@ public class CustomDamage { } static void leaderRallyNearbyMonsters(Monster m, Player p) { + LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(m); if ((MonsterController.isZombieLeader(m) || ( m.getCustomName()!=null && m.getCustomName().contains(ChatColor.MAGIC+"") )) && - !m.hasPotionEffect(PotionEffectType.GLOWING)) { + !m.hasPotionEffect(PotionEffectType.GLOWING) && !les.hasRallied) { rallyNearbyMonsters(m,p,24); + les.hasRallied=true; } } @@ -1401,6 +1404,7 @@ public class CustomDamage { mm.setTarget(p); LivingEntityStructure ms = LivingEntityStructure.getLivingEntityStructure(mm); ms.SetTarget(p); + ms.hasRallied=true; } } } diff --git a/src/sig/plugin/TwosideKeeper/Drops/SigDrop.java b/src/sig/plugin/TwosideKeeper/Drops/SigDrop.java index bdd9960..d2b92fc 100644 --- a/src/sig/plugin/TwosideKeeper/Drops/SigDrop.java +++ b/src/sig/plugin/TwosideKeeper/Drops/SigDrop.java @@ -154,7 +154,7 @@ public class SigDrop extends Drop{ } else { set = LivingEntityDifficulty.PickAnItemSet(PlayerMode.getPlayerMode(p),diff2); //This is the set we have to generate. } - TwosideKeeper.log("Set Chosen: "+set, 0); + TwosideKeeper.log("Set Chosen: "+set, 5); //Turn it into the appropriate piece if necessary. item = LivingEntityDifficulty.ConvertSetPieceIfNecessary(item, set); @@ -164,7 +164,7 @@ public class SigDrop extends Drop{ } item = Loot.GenerateSetPiece(item, set, isHardened, tierbonus); - TwosideKeeper.log("Final Item: "+item, 0); + TwosideKeeper.log("Final Item: "+item, 5); } else { item = Loot.GenerateMegaPiece(item.getType(), isHardened); } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 176cf07..ac0fba7 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -3338,7 +3338,7 @@ public class GenericFunctions { ItemUtils.addLore(item, ChatColor.AQUA+"Filtering:"); for (ItemStack it : items) { if (ItemUtils.isValidItem(it)) { - ItemUtils.addLore(item, ChatColor.DARK_AQUA+" - "+GenericFunctions.UserFriendlyMaterialName(it.getType(),it.getDurability())); + ItemUtils.addLore(item, ChatColor.DARK_AQUA+" - "+GenericFunctions.UserFriendlyMaterialName(it.getType(),it.getDurability())+(it.getItemMeta().hasLore()?ChatColor.AQUA+" w/Lore":"")); } } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java index 70f8bdf..ba7428f 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java @@ -106,7 +106,9 @@ public class InventoryUtils { } public static boolean InventoryContainSameMaterial(Inventory inv, ItemStack item) { for (ItemStack i : inv.getContents()) { - if (i!=null && item!=null && i.getType()==item.getType()) { + if (i!=null && item!=null && i.getType()==item.getType() && ( + (i.getItemMeta().hasLore() && item.getItemMeta().hasLore()) || + (!i.getItemMeta().hasLore() && !item.getItemMeta().hasLore()))) { return true; } } diff --git a/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java b/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java index 8ac958b..176ead9 100644 --- a/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java +++ b/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java @@ -24,6 +24,7 @@ public class LivingEntityStructure { //public long lastSpiderBallThrow = 0; public BossMonster bm = null; public boolean checkedforcubes=false; + public boolean hasRallied=false; public LivingEntityStructure(LivingEntity m) { target=null; diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 14eb685..d3f37a4 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -6693,24 +6693,60 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (isBoss && Math.random()<=0.5) { LivingEntityDifficulty diff = MonsterController.getLivingEntityDifficulty(m); + if (diff==LivingEntityDifficulty.END && Math.random()<=0.5) { + diff = LivingEntityDifficulty.HELLFIRE; + } + if (diff==LivingEntityDifficulty.HELLFIRE && Math.random()<=0.5) { + diff = LivingEntityDifficulty.DEADLY; + } + if (diff==LivingEntityDifficulty.DEADLY && Math.random()<=0.5) { + diff = LivingEntityDifficulty.DANGEROUS; + } + if (diff==LivingEntityDifficulty.DANGEROUS && Math.random()<=0.5) { + diff = LivingEntityDifficulty.NORMAL; + } switch (diff) { case DANGEROUS: - droplist.add(Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE)); + if (m.getWorld().getName().equalsIgnoreCase("world")) { + droplist.add(Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE)); + } else { + droplist.add(Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE)); + } break; case DEADLY: - droplist.add(Artifact.createArtifactItem(ArtifactItem.LOST_CORE)); + if (m.getWorld().getName().equalsIgnoreCase("world")) { + droplist.add(Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE)); + } else { + droplist.add(Artifact.createArtifactItem(ArtifactItem.LOST_CORE)); + } break; case ELITE: - droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE)); + if (m.getWorld().getName().equalsIgnoreCase("world")) { + droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE)); + } else { + droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE)); + } break; case END: - droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE)); + if (m.getWorld().getName().equalsIgnoreCase("world")) { + droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE)); + } else { + droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE)); + } break; case HELLFIRE: - droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE)); + if (m.getWorld().getName().equalsIgnoreCase("world")) { + droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE)); + } else { + droplist.add(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE)); + } break; default: - droplist.add(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE)); + if (m.getWorld().getName().equalsIgnoreCase("world")) { + droplist.add(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE)); + } else { + droplist.add(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE)); + } } } } @@ -9885,7 +9921,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } public static void breakdownItem(ItemStack item, Player p) { - SoundUtils.playLocalSound(p, Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f); - p.sendMessage(ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(item))+ChatColor.DARK_RED+" has broken!"); + if (p!=null) { + SoundUtils.playLocalSound(p, Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f); + p.sendMessage(ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(item))+ChatColor.DARK_RED+" has broken!"); + } } } \ No newline at end of file diff --git a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java index e94f9a4..08f9ba4 100644 --- a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java +++ b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java @@ -858,9 +858,9 @@ final class runServerHeartbeat implements Runnable { private void randomlyAggroNearbyEndermen(Player p) { //List ents = GenericFunctions.getNearbyMobs(p.getLocation(), 16); - List ments = CustomDamage.trimNonMonsterEntities(p.getNearbyEntities(16, 16, 16)); + List ments = CustomDamage.trimNonMonsterEntities(p.getNearbyEntities(8, 8, 8)); for (Monster m : ments) { - if (Math.random()<=0.05 && !m.hasPotionEffect(PotionEffectType.GLOWING)) { + if (!m.isDead() && Math.random()<=0.05 && !m.hasPotionEffect(PotionEffectType.GLOWING)) { m.setTarget(p); } }