diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 84322ff..3513ed8 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java index 654e737..6aa81db 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java @@ -26,6 +26,7 @@ import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BannerMeta; import org.bukkit.inventory.meta.BlockStateMeta; @@ -125,9 +126,11 @@ public class WorldShop { if (item.getType()==Material.ENCHANTED_BOOK) { if (item.getItemMeta() instanceof EnchantmentStorageMeta) { EnchantmentStorageMeta e = (EnchantmentStorageMeta)item.getItemMeta(); - for (int i=0;i effects = pot.getCustomEffects(); - - for (int i=0;i0)?" ":"")+"("+effects.get(i).getDuration()/1200+":"+df.format((effects.get(i).getDuration()/20)%60)+")"; - } - - if (effects.size()==0) { //Try this instead. It might be a legacy potion. - - String duration = " "+(pot.getBasePotionData().isExtended()?"(8:00)":(pot.getBasePotionData().isUpgraded())?"(1:30)":"(3:00)"); - String badduration = " "+(pot.getBasePotionData().isExtended()?"(4:00)":"(1:30)"); - String poisonduration = " "+(pot.getBasePotionData().isExtended()?"(1:30)":(pot.getBasePotionData().isUpgraded())?"(0:21)":"(0:45)"); - String luckduration = " (5:00)"; - String regenduration = " "+(pot.getBasePotionData().isExtended()?"(1:30)":(pot.getBasePotionData().isUpgraded())?"(0:22)":"(0:45)"); - String power = (pot.getBasePotionData().isUpgraded()?"II":""); - if (item.getType() == Material.LINGERING_POTION) { - duration = " "+(pot.getBasePotionData().isExtended()?"(2:00)":(pot.getBasePotionData().isUpgraded())?"(0:22)":"(0:45)"); - badduration = " "+(pot.getBasePotionData().isExtended()?"(1:00)":"(0:22)"); - poisonduration = " "+(pot.getBasePotionData().isExtended()?"(0:22)":(pot.getBasePotionData().isUpgraded())?"(0:05)":"(0:22)"); - luckduration = " (1:15)"; - regenduration = " "+(pot.getBasePotionData().isExtended()?"(0:22)":(pot.getBasePotionData().isUpgraded())?"(0:05)":"(0:11)"); + if (!pot.getItemFlags().contains(ItemFlag.HIDE_POTION_EFFECTS)) { + List effects = pot.getCustomEffects(); + + for (int i=0;i0)?" ":"")+"("+effects.get(i).getDuration()/1200+":"+df.format((effects.get(i).getDuration()/20)%60)+")"; } - switch (pot.getBasePotionData().getType()) { - case FIRE_RESISTANCE: - message+="\n"+ChatColor.BLUE+"Fire Resistance"+duration; - break; - case INSTANT_DAMAGE: - message+="\n"+ChatColor.RED+"Instant Damage "+power; - break; - case INSTANT_HEAL: - message+="\n"+ChatColor.BLUE+"Instant Health "+power; - break; - case INVISIBILITY: - message+="\n"+ChatColor.BLUE+"Invisibility"+duration; - break; - case JUMP: - message+="\n"+ChatColor.BLUE+"Jump Boost "+power+duration; - break; - case LUCK: - message+="\n"+ChatColor.BLUE+"Luck"+luckduration; - break; - case NIGHT_VISION: - message+="\n"+ChatColor.BLUE+"Night Vision"+duration; - break; - case POISON: - message+="\n"+ChatColor.RED+"Poison "+power+badduration; - break; - case REGEN: - message+="\n"+ChatColor.BLUE+"Regeneration "+power+duration; - break; - case SLOWNESS: - message+="\n"+ChatColor.RED+"Slowness"+badduration; - break; - case SPEED: - message+="\n"+ChatColor.BLUE+"Speed "+power+duration; - break; - case STRENGTH: - message+="\n"+ChatColor.BLUE+"Strength "+power+duration; - break; - case WATER_BREATHING: - message+="\n"+ChatColor.BLUE+"Water Breathing"+duration; - break; - case WEAKNESS: - message+="\n"+ChatColor.RED+"Weakness"+badduration; - break; - default: - message+="\n"+ChatColor.GRAY+"No Effects"; - break; + if (effects.size()==0) { //Try this instead. It might be a legacy potion. + + String duration = " "+(pot.getBasePotionData().isExtended()?"(8:00)":(pot.getBasePotionData().isUpgraded())?"(1:30)":"(3:00)"); + String badduration = " "+(pot.getBasePotionData().isExtended()?"(4:00)":"(1:30)"); + String poisonduration = " "+(pot.getBasePotionData().isExtended()?"(1:30)":(pot.getBasePotionData().isUpgraded())?"(0:21)":"(0:45)"); + String luckduration = " (5:00)"; + String regenduration = " "+(pot.getBasePotionData().isExtended()?"(1:30)":(pot.getBasePotionData().isUpgraded())?"(0:22)":"(0:45)"); + String power = (pot.getBasePotionData().isUpgraded()?"II":""); + if (item.getType() == Material.LINGERING_POTION) { + duration = " "+(pot.getBasePotionData().isExtended()?"(2:00)":(pot.getBasePotionData().isUpgraded())?"(0:22)":"(0:45)"); + badduration = " "+(pot.getBasePotionData().isExtended()?"(1:00)":"(0:22)"); + poisonduration = " "+(pot.getBasePotionData().isExtended()?"(0:22)":(pot.getBasePotionData().isUpgraded())?"(0:05)":"(0:22)"); + luckduration = " (1:15)"; + regenduration = " "+(pot.getBasePotionData().isExtended()?"(0:22)":(pot.getBasePotionData().isUpgraded())?"(0:05)":"(0:11)"); + } + switch (pot.getBasePotionData().getType()) { + case FIRE_RESISTANCE: + message+="\n"+ChatColor.BLUE+"Fire Resistance"+duration; + break; + case INSTANT_DAMAGE: + message+="\n"+ChatColor.RED+"Instant Damage "+power; + break; + case INSTANT_HEAL: + message+="\n"+ChatColor.BLUE+"Instant Health "+power; + break; + case INVISIBILITY: + message+="\n"+ChatColor.BLUE+"Invisibility"+duration; + break; + case JUMP: + message+="\n"+ChatColor.BLUE+"Jump Boost "+power+duration; + break; + case LUCK: + message+="\n"+ChatColor.BLUE+"Luck"+luckduration; + break; + case NIGHT_VISION: + message+="\n"+ChatColor.BLUE+"Night Vision"+duration; + break; + case POISON: + message+="\n"+ChatColor.RED+"Poison "+power+badduration; + break; + case REGEN: + message+="\n"+ChatColor.BLUE+"Regeneration "+power+duration; + break; + case SLOWNESS: + message+="\n"+ChatColor.RED+"Slowness"+badduration; + break; + case SPEED: + message+="\n"+ChatColor.BLUE+"Speed "+power+duration; + break; + case STRENGTH: + message+="\n"+ChatColor.BLUE+"Strength "+power+duration; + break; + case WATER_BREATHING: + message+="\n"+ChatColor.BLUE+"Water Breathing"+duration; + break; + case WEAKNESS: + message+="\n"+ChatColor.RED+"Weakness"+badduration; + break; + default: + message+="\n"+ChatColor.GRAY+"No Effects"; + break; + + } } } - } } diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 314fcb7..dcef123 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -5375,6 +5375,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } } + arr.setCustomName("HIT"); } } } @@ -5399,7 +5400,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener { ev.getProjectile().getType()==EntityType.TIPPED_ARROW)) { //Now we know this is a player who shot a regular old arrow. final Player p = (Player)ev.getEntity(); - ev.getProjectile().setCustomName("HIT"); //We need to give one back to them. if (ev.getProjectile().getType()==EntityType.ARROW) { //This was an arrow quiver. We need to verify that, check the player's inventory for one.