diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 802033a..a4b896f 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 5b7a7ef..fa4d416 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.5.4r6 +version: 3.6.0 commands: money: description: Tells the player the amount of money they are holding. @@ -86,4 +86,9 @@ commands: description: Apply an awakened artifact ability to an item. usage: /awakenedartifact_ability permission: TwosideKeeper.artifact + permission-message: No permissions! + mode: + description: Displays information about a mode. + usage: /mode + permission: TwosideKeeper.money permission-message: No permissions! \ No newline at end of file diff --git a/src/sig/plugin/TwosideKeeper/Artifact.java b/src/sig/plugin/TwosideKeeper/Artifact.java index 43aa16d..12235f7 100644 --- a/src/sig/plugin/TwosideKeeper/Artifact.java +++ b/src/sig/plugin/TwosideKeeper/Artifact.java @@ -185,7 +185,7 @@ public class Artifact { item.getType()!=Material.AIR && item.hasItemMeta() && item.getItemMeta().hasLore() && - (item.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Crafting Item") || + (GenericFunctions.searchfor(item.getItemMeta().getLore(),ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Crafting Item") || item.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Item"))) { //This is an artifact. return true; diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/BowMode.java b/src/sig/plugin/TwosideKeeper/HelperStructures/BowMode.java new file mode 100644 index 0000000..df9ebe5 --- /dev/null +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/BowMode.java @@ -0,0 +1,17 @@ +package sig.plugin.TwosideKeeper.HelperStructures; + +public enum BowMode { + CLOSE("Close Range"), + SNIPE("Sniping"), + DEBILITATION("Debilitation"); + + String coolname; + + BowMode(String coolname) { + this.coolname=coolname; + } + + public String GetCoolName() { + return this.coolname; + } +} diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 3f97f40..eb2afed 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -33,6 +33,10 @@ import org.bukkit.potion.PotionEffectType; import com.google.common.collect.Iterables; +import net.md_5.bungee.api.chat.ClickEvent; +import net.md_5.bungee.api.chat.ComponentBuilder; +import net.md_5.bungee.api.chat.HoverEvent; +import net.md_5.bungee.api.chat.TextComponent; import sig.plugin.TwosideKeeper.Artifact; import sig.plugin.TwosideKeeper.AwakenedArtifact; import sig.plugin.TwosideKeeper.MonsterController; @@ -40,6 +44,7 @@ import sig.plugin.TwosideKeeper.MonsterStructure; import sig.plugin.TwosideKeeper.PlayerStructure; import sig.plugin.TwosideKeeper.TwosideKeeper; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility; +import sig.plugin.TwosideKeeper.HelperStructures.BowMode; import sig.plugin.TwosideKeeper.HelperStructures.WorldShop; public class GenericFunctions { @@ -208,6 +213,20 @@ public class GenericFunctions { } } + public static int getMaxThornsLevel(LivingEntity e) { + int maxlv = 0; + ItemStack[] equips = e.getEquipment().getArmorContents(); + for (int i=0;i=maxlv) { + maxlv = equips[i].getEnchantmentLevel(Enchantment.THORNS); + } + } + } + return maxlv; + } + public static int getObscureHardenedItemBreaks(ItemStack item) { if (item.hasItemMeta() && @@ -347,1170 +366,1210 @@ public class GenericFunctions { } public static String UserFriendlyMaterialName(ItemStack type) { - if (type.hasItemMeta() && - type.getItemMeta().hasDisplayName()) { - return type.getItemMeta().getDisplayName(); - } - switch (type.getType()) { - case ACACIA_DOOR_ITEM:{ - return "Acacia Door"; + if (type!=null && + type.getType()!=Material.AIR) { + if (type.hasItemMeta() && + type.getItemMeta().hasDisplayName()) { + return type.getItemMeta().getDisplayName(); } - case JUNGLE_DOOR_ITEM:{ - return "Jungle Door"; - } - case BIRCH_DOOR_ITEM:{ - return "Birch Door"; - } - case DARK_OAK_DOOR_ITEM:{ - return "Dark Oak Door"; - } - case SPRUCE_DOOR_ITEM:{ - return "Spruce Door"; - } - case WOOD_DOOR:{ - return "Wooden Door"; - } - case BED_BLOCK:{ - return "Bed"; - } - case BOAT_ACACIA:{ - return "Acacia Boat"; - } - case BOAT_BIRCH:{ - return "Birch Boat"; - } - case BOAT_DARK_OAK:{ - return "Dark Oak Boat"; - } - case BOAT_JUNGLE:{ - return "Jungle Boat"; - } - case BOAT_SPRUCE:{ - return "Spruce Boat"; - } - case BREWING_STAND_ITEM:{ - return "Brewing Stand"; - } - case BURNING_FURNACE:{ - return "Furnace"; - } - case CAKE_BLOCK:{ - return "Cake"; - } - case CARROT_ITEM:{ - return "Carrot"; - } - case CARROT_STICK:{ - return "Carrot on a Stick"; - } - case CAULDRON_ITEM:{ - return "Cauldron"; - } - case CHORUS_FRUIT_POPPED:{ - return "Popped Chorus Fruit"; - } - case CLAY_BALL:{ - return "Clay"; - } - case COBBLE_WALL:{ - return "Cobblestone Wall"; - } - case COMMAND:{ - return "Command Block"; - } - case COMMAND_CHAIN:{ - return "Chain Command Block"; - } - case COMMAND_MINECART:{ - return "Minecart w/Command Block"; - } - case COMMAND_REPEATING:{ - return "Repeating Command Block"; - } - case CROPS:{ - return "Sugar Cane"; - } - case DAYLIGHT_DETECTOR_INVERTED:{ - return "Daylight Detector"; - } - case WOOD_SPADE:{ - return "Wooden Shovel"; - } - case STONE_SPADE:{ - return "Stone Shovel"; - } - case IRON_SPADE:{ - return "Iron Shovel"; - } - case GOLD_SPADE:{ - return "Gold Shovel"; - } - case DIAMOND_SPADE:{ - return "Diamond Shovel"; - } - case IRON_BARDING:{ - return "Iron Horse Armor"; - } - case GOLD_BARDING:{ - return "Gold Horse Armor"; - } - case DIAMOND_BARDING:{ - return "Diamond Horse Armor"; - } - case DIODE:{ - return "Redstone Repeater"; - } - case DIODE_BLOCK_OFF:{ - return "Redstone Repeater"; - } - case DIODE_BLOCK_ON:{ - return "Diamond Horse Armor"; - } - case DRAGONS_BREATH:{ - return "Dragon's Breath"; - } - case END_CRYSTAL:{ - return "Ender Crystal"; - } - case ENDER_STONE:{ - return "End Stone"; - } - case EXPLOSIVE_MINECART:{ - return "TNT Minecart"; - } - case FLOWER_POT_ITEM:{ - return "Flower Pot"; - } - case GLOWING_REDSTONE_ORE:{ - return "Redstone Ore"; - } - case GRILLED_PORK:{ - return "Cooked Porkchop"; - } - case HUGE_MUSHROOM_1:{ - return "Brown Mushroom"; - } - case HUGE_MUSHROOM_2:{ - return "Red Mushroom"; - } - case JACK_O_LANTERN:{ - return "Jack o'Lantern"; - } - case LEAVES:{ - switch (type.getDurability()) { - case 0:{ - return "Oak Leaves"; - } - case 1:{ - return "Spruce Leaves"; - } - case 2:{ - return "Birch Leaves"; - } - case 3:{ - return "Jungle Leaves"; + switch (type.getType()) { + case ACACIA_DOOR_ITEM:{ + return "Acacia Door"; + } + case JUNGLE_DOOR_ITEM:{ + return "Jungle Door"; + } + case BIRCH_DOOR_ITEM:{ + return "Birch Door"; + } + case DARK_OAK_DOOR_ITEM:{ + return "Dark Oak Door"; + } + case SPRUCE_DOOR_ITEM:{ + return "Spruce Door"; + } + case WOOD_DOOR:{ + return "Wooden Door"; + } + case BED_BLOCK:{ + return "Bed"; + } + case BOAT_ACACIA:{ + return "Acacia Boat"; + } + case BOAT_BIRCH:{ + return "Birch Boat"; + } + case BOAT_DARK_OAK:{ + return "Dark Oak Boat"; + } + case BOAT_JUNGLE:{ + return "Jungle Boat"; + } + case BOAT_SPRUCE:{ + return "Spruce Boat"; + } + case BREWING_STAND_ITEM:{ + return "Brewing Stand"; + } + case BURNING_FURNACE:{ + return "Furnace"; + } + case CAKE_BLOCK:{ + return "Cake"; + } + case CARROT_ITEM:{ + return "Carrot"; + } + case CARROT_STICK:{ + return "Carrot on a Stick"; + } + case CAULDRON_ITEM:{ + return "Cauldron"; + } + case CHORUS_FRUIT_POPPED:{ + return "Popped Chorus Fruit"; + } + case CLAY_BALL:{ + return "Clay"; + } + case COBBLE_WALL:{ + return "Cobblestone Wall"; + } + case COMMAND:{ + return "Command Block"; + } + case COMMAND_CHAIN:{ + return "Chain Command Block"; + } + case COMMAND_MINECART:{ + return "Minecart w/Command Block"; + } + case COMMAND_REPEATING:{ + return "Repeating Command Block"; + } + case CROPS:{ + return "Sugar Cane"; + } + case DAYLIGHT_DETECTOR_INVERTED:{ + return "Daylight Detector"; + } + case WOOD_SPADE:{ + return "Wooden Shovel"; + } + case STONE_SPADE:{ + return "Stone Shovel"; + } + case IRON_SPADE:{ + return "Iron Shovel"; + } + case GOLD_SPADE:{ + return "Gold Shovel"; + } + case DIAMOND_SPADE:{ + return "Diamond Shovel"; + } + case IRON_BARDING:{ + return "Iron Horse Armor"; + } + case GOLD_BARDING:{ + return "Gold Horse Armor"; + } + case DIAMOND_BARDING:{ + return "Diamond Horse Armor"; + } + case DIODE:{ + return "Redstone Repeater"; + } + case DIODE_BLOCK_OFF:{ + return "Redstone Repeater"; + } + case DIODE_BLOCK_ON:{ + return "Diamond Horse Armor"; + } + case DRAGONS_BREATH:{ + return "Dragon's Breath"; + } + case END_CRYSTAL:{ + return "Ender Crystal"; + } + case ENDER_STONE:{ + return "End Stone"; + } + case EXPLOSIVE_MINECART:{ + return "TNT Minecart"; + } + case FLOWER_POT_ITEM:{ + return "Flower Pot"; + } + case GLOWING_REDSTONE_ORE:{ + return "Redstone Ore"; + } + case GRILLED_PORK:{ + return "Cooked Porkchop"; + } + case HUGE_MUSHROOM_1:{ + return "Brown Mushroom"; + } + case HUGE_MUSHROOM_2:{ + return "Red Mushroom"; + } + case JACK_O_LANTERN:{ + return "Jack o'Lantern"; + } + case LEAVES:{ + switch (type.getDurability()) { + case 0:{ + return "Oak Leaves"; + } + case 1:{ + return "Spruce Leaves"; + } + case 2:{ + return "Birch Leaves"; + } + case 3:{ + return "Jungle Leaves"; + } } } - } - case LEAVES_2:{ - switch (type.getDurability()) { - case 0:{ - return "Acacia Leaves"; - } - case 1:{ - return "Dark Oak Leaves"; + case LEAVES_2:{ + switch (type.getDurability()) { + case 0:{ + return "Acacia Leaves"; + } + case 1:{ + return "Dark Oak Leaves"; + } } } - } - case LOG:{ - switch (type.getDurability()) { - case 0:{ - return "Oak Wood"; - } - case 1:{ - return "Spruce Wood"; - } - case 2:{ - return "Birch Wood"; - } - case 3:{ - return "Jungle Wood"; + case LOG:{ + switch (type.getDurability()) { + case 0:{ + return "Oak Wood"; + } + case 1:{ + return "Spruce Wood"; + } + case 2:{ + return "Birch Wood"; + } + case 3:{ + return "Jungle Wood"; + } } } - } - case LOG_2:{ - switch (type.getDurability()) { - case 0:{ - return "Acacia Wood"; - } - case 1:{ - return "Dark Oak Wood"; + case LOG_2:{ + switch (type.getDurability()) { + case 0:{ + return "Acacia Wood"; + } + case 1:{ + return "Dark Oak Wood"; + } } } - } - case WOOD:{ - switch (type.getDurability()) { - case 0:{ - return "Oak Wood Planks"; - } - case 1:{ - return "Spruce Wood Planks"; - } - case 2:{ - return "Birch Wood Planks"; - } - case 3:{ - return "Jungle Wood Planks"; - } - case 4:{ - return "Acacia Wood Planks"; - } - case 5:{ - return "Dark Oak Wood Planks"; + case WOOD:{ + switch (type.getDurability()) { + case 0:{ + return "Oak Wood Planks"; + } + case 1:{ + return "Spruce Wood Planks"; + } + case 2:{ + return "Birch Wood Planks"; + } + case 3:{ + return "Jungle Wood Planks"; + } + case 4:{ + return "Acacia Wood Planks"; + } + case 5:{ + return "Dark Oak Wood Planks"; + } } } - } - case MILK_BUCKET:{ - return "Milk"; - } - case NETHER_BRICK_ITEM:{ - return "Nether Bricks"; - } - case NETHER_WARTS:{ - return "Nether Wart"; - } - case NETHER_STALK:{ - return "Nether Wart"; - } - case GOLD_PLATE:{ - return "Gold Pressure Plate"; - } - case PISTON_BASE:{ - return "Piston"; - } - case PISTON_STICKY_BASE:{ - return "Sticky Piston"; - } - case PORK:{ - return "Raw Porkchop"; - } - case POTATO_ITEM:{ - return "Potato"; - } - case POWERED_MINECART:{ - return "Minecart w/Furnace"; - } - case RABBIT:{ - return "Raw Rabbit"; - } - case RABBIT_FOOT:{ - return "Rabbit's Foot"; - } - case RECORD_10:{ - return "Music Disc"; - } - case RECORD_11:{ - return "Music Disc"; - } - case RECORD_12:{ - return "Music Disc"; - } - case RECORD_3:{ - return "Music Disc"; - } - case RECORD_4:{ - return "Music Disc"; - } - case RECORD_5:{ - return "Music Disc"; - } - case RECORD_6:{ - return "Music Disc"; - } - case RECORD_7:{ - return "Music Disc"; - } - case RECORD_8:{ - return "Music Disc"; - } - case RECORD_9:{ - return "Music Disc"; - } - case REDSTONE_COMPARATOR:{ - return "Comparator"; - } - case REDSTONE_COMPARATOR_OFF:{ - return "Comparator"; - } - case REDSTONE_COMPARATOR_ON:{ - return "Comparator"; - } - case REDSTONE_LAMP_OFF:{ - return "Redstone Lamp"; - } - case REDSTONE_LAMP_ON:{ - return "Redstone Lamp"; - } - case REDSTONE_TORCH_OFF:{ - return "Redstone Torch"; - } - case REDSTONE_TORCH_ON:{ - return "Redstone Torch"; - } - case REDSTONE_WIRE:{ - return "Redstone"; - } - case SAPLING:{ - switch (type.getDurability()) { - case 0:{ - return "Oak Sapling"; - } - case 1:{ - return "Spruce Sapling"; - } - case 2:{ - return "Birch Sapling"; - } - case 3:{ - return "Jungle Sapling"; - } - case 4:{ - return "Acacia Sapling"; - } - case 5:{ - return "Dark Oak Sapling"; + case MILK_BUCKET:{ + return "Milk"; + } + case NETHER_BRICK_ITEM:{ + return "Nether Bricks"; + } + case NETHER_WARTS:{ + return "Nether Wart"; + } + case NETHER_STALK:{ + return "Nether Wart"; + } + case GOLD_PLATE:{ + return "Gold Pressure Plate"; + } + case PISTON_BASE:{ + return "Piston"; + } + case PISTON_STICKY_BASE:{ + return "Sticky Piston"; + } + case PORK:{ + return "Raw Porkchop"; + } + case POTATO_ITEM:{ + return "Potato"; + } + case POWERED_MINECART:{ + return "Minecart w/Furnace"; + } + case RABBIT:{ + return "Raw Rabbit"; + } + case RABBIT_FOOT:{ + return "Rabbit's Foot"; + } + case RECORD_10:{ + return "Music Disc"; + } + case RECORD_11:{ + return "Music Disc"; + } + case RECORD_12:{ + return "Music Disc"; + } + case RECORD_3:{ + return "Music Disc"; + } + case RECORD_4:{ + return "Music Disc"; + } + case RECORD_5:{ + return "Music Disc"; + } + case RECORD_6:{ + return "Music Disc"; + } + case RECORD_7:{ + return "Music Disc"; + } + case RECORD_8:{ + return "Music Disc"; + } + case RECORD_9:{ + return "Music Disc"; + } + case REDSTONE_COMPARATOR:{ + return "Comparator"; + } + case REDSTONE_COMPARATOR_OFF:{ + return "Comparator"; + } + case REDSTONE_COMPARATOR_ON:{ + return "Comparator"; + } + case REDSTONE_LAMP_OFF:{ + return "Redstone Lamp"; + } + case REDSTONE_LAMP_ON:{ + return "Redstone Lamp"; + } + case REDSTONE_TORCH_OFF:{ + return "Redstone Torch"; + } + case REDSTONE_TORCH_ON:{ + return "Redstone Torch"; + } + case REDSTONE_WIRE:{ + return "Redstone"; + } + case SAPLING:{ + switch (type.getDurability()) { + case 0:{ + return "Oak Sapling"; + } + case 1:{ + return "Spruce Sapling"; + } + case 2:{ + return "Birch Sapling"; + } + case 3:{ + return "Jungle Sapling"; + } + case 4:{ + return "Acacia Sapling"; + } + case 5:{ + return "Dark Oak Sapling"; + } } } - } - case SIGN_POST:{ - return "Sign"; - } - case WALL_SIGN:{ - return "Sign"; - } - case SKULL_ITEM:{ - return "Skull"; - } - case SMOOTH_BRICK:{ - return "Stone Brick"; - } - case SMOOTH_STAIRS:{ - return "Stone Brick Stairs"; - } - case LEATHER_HELMET:{ - return "Leather Cap"; - } - case LEATHER_CHESTPLATE:{ - return "Leather Tunic"; - } - case LEATHER_LEGGINGS:{ - return "Leather Pants"; - } - case STEP:{ - switch (type.getDurability()) { - case 0:{ - return "Stone Slab"; - } - case 1:{ - return "Sandstone Slab"; - } - case 2:{ - return "Fireproof Oak Wooden Slab"; - } - case 3:{ - return "Cobblestone Slab"; - } - case 4:{ - return "Bricks Slab"; - } - case 5:{ - return "Stone Brick Slab"; - } - case 6:{ - return "Nether Brick Slab"; - } - case 7:{ - return "Quartz Slab"; + case SIGN_POST:{ + return "Sign"; + } + case WALL_SIGN:{ + return "Sign"; + } + case SKULL_ITEM:{ + return "Skull"; + } + case SMOOTH_BRICK:{ + return "Stone Brick"; + } + case SMOOTH_STAIRS:{ + return "Stone Brick Stairs"; + } + case LEATHER_HELMET:{ + return "Leather Cap"; + } + case LEATHER_CHESTPLATE:{ + return "Leather Tunic"; + } + case LEATHER_LEGGINGS:{ + return "Leather Pants"; + } + case STEP:{ + switch (type.getDurability()) { + case 0:{ + return "Stone Slab"; + } + case 1:{ + return "Sandstone Slab"; + } + case 2:{ + return "Fireproof Oak Wooden Slab"; + } + case 3:{ + return "Cobblestone Slab"; + } + case 4:{ + return "Bricks Slab"; + } + case 5:{ + return "Stone Brick Slab"; + } + case 6:{ + return "Nether Brick Slab"; + } + case 7:{ + return "Quartz Slab"; + } } } - } - case SULPHUR:{ - return "Gunpowder"; - } - case TNT:{ - return "TNT"; - } - case POTION:{ - PotionMeta pm = (PotionMeta)type.getItemMeta(); - /* - return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); - */ - switch (pm.getBasePotionData().getType()) { - case AWKWARD: - return "Awkward Potion"; - case FIRE_RESISTANCE: - return "Potion of Fire Resistance"; - case INSTANT_DAMAGE: + case SULPHUR:{ + return "Gunpowder"; + } + case TNT:{ + return "TNT"; + } + case POTION:{ + PotionMeta pm = (PotionMeta)type.getItemMeta(); + /* + return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); + */ + switch (pm.getBasePotionData().getType()) { + case AWKWARD: + return "Awkward Potion"; + case FIRE_RESISTANCE: + return "Potion of Fire Resistance"; + case INSTANT_DAMAGE: + if (pm.getBasePotionData().isUpgraded()) { + return "Potion of Harming II"; + } else { + return "Potion of Harming"; + } + case INSTANT_HEAL: if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Harming II"; + return "Potion of Instant Health II"; } else { - return "Potion of Harming"; + return "Potion of Instant Health"; } - case INSTANT_HEAL: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Instant Health II"; - } else { - return "Potion of Instant Health"; - } - case INVISIBILITY: - return "Potion of Invisibility"; - case JUMP: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Jump Boost II"; - } else { - return "Potion of Jump Boost"; - } - case LUCK: - return "Potion of Luck"; - case MUNDANE: - return "Mundane Potion"; - case NIGHT_VISION: - return "Potion of Night Vision"; - case POISON: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Poison II"; - } else { - return "Potion of Poison"; - } - case REGEN: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Regeneration II"; - } else { - return "Potion of Regeneration"; - } - case SLOWNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Slowness II"; - } else { - return "Potion of Slowness"; - } - case SPEED: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Speed II"; - } else { - return "Potion of Speed"; - } - case STRENGTH: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Strength II"; - } else { - return "Potion of Strength"; - } - case THICK: - return "Thick Potion"; - case UNCRAFTABLE: - return "Potion"; - case WATER: - return "Water Bottle"; - case WATER_BREATHING: - return "Potion of Water Breathing"; - case WEAKNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Potion of Weakness II"; - } else { - return "Potion of Weakness"; - } - default: - return "Potion"; - } - } - case SPLASH_POTION:{ - PotionMeta pm = (PotionMeta)type.getItemMeta(); - /* - return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); - */ - switch (pm.getBasePotionData().getType()) { - case AWKWARD: - return "Awkward Splash Potion"; - case FIRE_RESISTANCE: - return "Splash Potion of Fire Resistance"; - case INSTANT_DAMAGE: + case INVISIBILITY: + return "Potion of Invisibility"; + case JUMP: if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Harming II"; + return "Potion of Jump Boost II"; } else { - return "Splash Potion of Harming"; + return "Potion of Jump Boost"; } - case INSTANT_HEAL: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Instant Health II"; - } else { - return "Splash Potion of Instant Health"; - } - case INVISIBILITY: - return "Splash Potion of Invisibility"; - case JUMP: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Jump Boost II"; - } else { - return "Splash Potion of Jump Boost"; - } - case LUCK: - return "Splash Potion of Luck"; - case MUNDANE: - return "Mundane Splash Potion"; - case NIGHT_VISION: - return "Splash Potion of Night Vision"; - case POISON: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Poison II"; - } else { - return "Splash Potion of Poison"; - } - case REGEN: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Regeneration II"; - } else { - return "Splash Potion of Regeneration"; - } - case SLOWNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Slowness II"; - } else { - return "Splash Potion of Slowness"; - } - case SPEED: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Speed II"; - } else { - return "Splash Potion of Speed"; - } - case STRENGTH: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Strength II"; - } else { - return "Splash Potion of Strength"; - } - case THICK: - return "Thick Splash Potion"; - case UNCRAFTABLE: - return "Splash Potion"; - case WATER: - return "Water Bottle"; - case WATER_BREATHING: - return "Splash Potion of Water Breathing"; - case WEAKNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Splash Potion of Weakness II"; - } else { - return "Splash Potion of Weakness"; - } - default: - return "Splash Potion"; - } - } - case TIPPED_ARROW:{ - PotionMeta pm = (PotionMeta)type.getItemMeta(); - /* - return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); - */ - switch (pm.getBasePotionData().getType()) { - case AWKWARD: - return "Awkward Arrow"; - case FIRE_RESISTANCE: - return "Arrow of Fire Resistance"; - case INSTANT_DAMAGE: + case LUCK: + return "Potion of Luck"; + case MUNDANE: + return "Mundane Potion"; + case NIGHT_VISION: + return "Potion of Night Vision"; + case POISON: if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Harming II"; + return "Potion of Poison II"; } else { - return "Arrow of Harming"; + return "Potion of Poison"; } - case INSTANT_HEAL: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Instant Health II"; - } else { - return "Arrow of Instant Health"; - } - case INVISIBILITY: - return "Arrow of Invisibility"; - case JUMP: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Jump Boost II"; - } else { - return "Arrow of Jump Boost"; - } - case LUCK: - return "Arrow of Luck"; - case MUNDANE: - return "Mundane Arrow"; - case NIGHT_VISION: - return "Arrow of Night Vision"; - case POISON: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Poison II"; - } else { - return "Arrow of Poison"; - } - case REGEN: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Regeneration II"; - } else { - return "Arrow of Regeneration"; - } - case SLOWNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Slowness II"; - } else { - return "Arrow of Slowness"; - } - case SPEED: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Speed II"; - } else { - return "Arrow of Speed"; - } - case STRENGTH: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Strength II"; - } else { - return "Arrow of Strength"; - } - case THICK: - return "Thick Arrow"; - case UNCRAFTABLE: - return "Arrow"; - case WATER: - return "Water Bottle"; - case WATER_BREATHING: - return "Arrow of Water Breathing"; - case WEAKNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Arrow of Weakness II"; - } else { - return "Arrow of Weakness"; - } - default: - return "Arrow"; - } - } - case LINGERING_POTION:{ - PotionMeta pm = (PotionMeta)type.getItemMeta(); - /* - return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); - */ - switch (pm.getBasePotionData().getType()) { - case AWKWARD: - return "Awkward Lingering Potion"; - case FIRE_RESISTANCE: - return "Lingering Potion of Fire Resistance"; - case INSTANT_DAMAGE: + case REGEN: if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Harming II"; + return "Potion of Regeneration II"; } else { - return "Lingering Potion of Harming"; + return "Potion of Regeneration"; } - case INSTANT_HEAL: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Instant Health II"; - } else { - return "Lingering Potion of Instant Health"; + case SLOWNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Potion of Slowness II"; + } else { + return "Potion of Slowness"; + } + case SPEED: + if (pm.getBasePotionData().isUpgraded()) { + return "Potion of Speed II"; + } else { + return "Potion of Speed"; + } + case STRENGTH: + if (pm.getBasePotionData().isUpgraded()) { + return "Potion of Strength II"; + } else { + return "Potion of Strength"; + } + case THICK: + return "Thick Potion"; + case UNCRAFTABLE: + return "Potion"; + case WATER: + return "Water Bottle"; + case WATER_BREATHING: + return "Potion of Water Breathing"; + case WEAKNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Potion of Weakness II"; + } else { + return "Potion of Weakness"; + } + default: + return "Potion"; + } + } + case SPLASH_POTION:{ + PotionMeta pm = (PotionMeta)type.getItemMeta(); + /* + return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); + */ + switch (pm.getBasePotionData().getType()) { + case AWKWARD: + return "Awkward Splash Potion"; + case FIRE_RESISTANCE: + return "Splash Potion of Fire Resistance"; + case INSTANT_DAMAGE: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Harming II"; + } else { + return "Splash Potion of Harming"; + } + case INSTANT_HEAL: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Instant Health II"; + } else { + return "Splash Potion of Instant Health"; + } + case INVISIBILITY: + return "Splash Potion of Invisibility"; + case JUMP: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Jump Boost II"; + } else { + return "Splash Potion of Jump Boost"; + } + case LUCK: + return "Splash Potion of Luck"; + case MUNDANE: + return "Mundane Splash Potion"; + case NIGHT_VISION: + return "Splash Potion of Night Vision"; + case POISON: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Poison II"; + } else { + return "Splash Potion of Poison"; + } + case REGEN: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Regeneration II"; + } else { + return "Splash Potion of Regeneration"; + } + case SLOWNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Slowness II"; + } else { + return "Splash Potion of Slowness"; + } + case SPEED: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Speed II"; + } else { + return "Splash Potion of Speed"; + } + case STRENGTH: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Strength II"; + } else { + return "Splash Potion of Strength"; + } + case THICK: + return "Thick Splash Potion"; + case UNCRAFTABLE: + return "Splash Potion"; + case WATER: + return "Water Bottle"; + case WATER_BREATHING: + return "Splash Potion of Water Breathing"; + case WEAKNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Splash Potion of Weakness II"; + } else { + return "Splash Potion of Weakness"; + } + default: + return "Splash Potion"; + } + } + case TIPPED_ARROW:{ + PotionMeta pm = (PotionMeta)type.getItemMeta(); + /* + return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); + */ + switch (pm.getBasePotionData().getType()) { + case AWKWARD: + return "Awkward Arrow"; + case FIRE_RESISTANCE: + return "Arrow of Fire Resistance"; + case INSTANT_DAMAGE: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Harming II"; + } else { + return "Arrow of Harming"; + } + case INSTANT_HEAL: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Instant Health II"; + } else { + return "Arrow of Instant Health"; + } + case INVISIBILITY: + return "Arrow of Invisibility"; + case JUMP: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Jump Boost II"; + } else { + return "Arrow of Jump Boost"; + } + case LUCK: + return "Arrow of Luck"; + case MUNDANE: + return "Mundane Arrow"; + case NIGHT_VISION: + return "Arrow of Night Vision"; + case POISON: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Poison II"; + } else { + return "Arrow of Poison"; + } + case REGEN: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Regeneration II"; + } else { + return "Arrow of Regeneration"; + } + case SLOWNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Slowness II"; + } else { + return "Arrow of Slowness"; + } + case SPEED: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Speed II"; + } else { + return "Arrow of Speed"; + } + case STRENGTH: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Strength II"; + } else { + return "Arrow of Strength"; + } + case THICK: + return "Thick Arrow"; + case UNCRAFTABLE: + return "Arrow"; + case WATER: + return "Water Bottle"; + case WATER_BREATHING: + return "Arrow of Water Breathing"; + case WEAKNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Arrow of Weakness II"; + } else { + return "Arrow of Weakness"; + } + default: + return "Arrow"; + } + } + case LINGERING_POTION:{ + PotionMeta pm = (PotionMeta)type.getItemMeta(); + /* + return "Lingering Potion of "+CapitalizeFirstLetters(pm.getBasePotionData().getType().toString().toLowerCase()); + */ + switch (pm.getBasePotionData().getType()) { + case AWKWARD: + return "Awkward Lingering Potion"; + case FIRE_RESISTANCE: + return "Lingering Potion of Fire Resistance"; + case INSTANT_DAMAGE: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Harming II"; + } else { + return "Lingering Potion of Harming"; + } + case INSTANT_HEAL: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Instant Health II"; + } else { + return "Lingering Potion of Instant Health"; + } + case INVISIBILITY: + return "Lingering Potion of Invisibility"; + case JUMP: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Jump Boost II"; + } else { + return "Lingering Potion of Jump Boost"; + } + case LUCK: + return "Lingering Potion of Luck"; + case MUNDANE: + return "Mundane Lingering Potion"; + case NIGHT_VISION: + return "Lingering Potion of Night Vision"; + case POISON: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Poison II"; + } else { + return "Lingering Potion of Poison"; + } + case REGEN: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Regeneration II"; + } else { + return "Lingering Potion of Regeneration"; + } + case SLOWNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Slowness II"; + } else { + return "Lingering Potion of Slowness"; + } + case SPEED: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Speed II"; + } else { + return "Lingering Potion of Speed"; + } + case STRENGTH: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Strength II"; + } else { + return "Lingering Potion of Strength"; + } + case THICK: + return "Thick Lingering Potion"; + case UNCRAFTABLE: + return "Lingering Potion"; + case WATER: + return "Lingering Water Bottle"; + case WATER_BREATHING: + return "Lingering Potion of Water Breathing"; + case WEAKNESS: + if (pm.getBasePotionData().isUpgraded()) { + return "Lingering Potion of Weakness II"; + } else { + return "Lingering Potion of Weakness"; + } + default: + return "Lingering Potion"; + } + } + case WOOD_STEP:{ + switch (type.getDurability()) { + case 0:{ + return "Oak Wood Slab"; } - case INVISIBILITY: - return "Lingering Potion of Invisibility"; - case JUMP: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Jump Boost II"; - } else { - return "Lingering Potion of Jump Boost"; + case 1:{ + return "Spruce Wood Slab"; } - case LUCK: - return "Lingering Potion of Luck"; - case MUNDANE: - return "Mundane Lingering Potion"; - case NIGHT_VISION: - return "Lingering Potion of Night Vision"; - case POISON: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Poison II"; - } else { - return "Lingering Potion of Poison"; + case 2:{ + return "Birch Wood Slab"; } - case REGEN: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Regeneration II"; - } else { - return "Lingering Potion of Regeneration"; + case 3:{ + return "Jungle Wood Slab"; } - case SLOWNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Slowness II"; - } else { - return "Lingering Potion of Slowness"; + case 4:{ + return "Acacia Wood Slab"; } - case SPEED: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Speed II"; - } else { - return "Lingering Potion of Speed"; + case 5:{ + return "Dark Oak Wood Slab"; } - case STRENGTH: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Strength II"; - } else { - return "Lingering Potion of Strength"; + } + } + case SAND:{ + switch (type.getDurability()) { + case 0:{ + return "Sand"; } - case THICK: - return "Thick Lingering Potion"; - case UNCRAFTABLE: - return "Lingering Potion"; - case WATER: - return "Lingering Water Bottle"; - case WATER_BREATHING: - return "Lingering Potion of Water Breathing"; - case WEAKNESS: - if (pm.getBasePotionData().isUpgraded()) { - return "Lingering Potion of Weakness II"; - } else { - return "Lingering Potion of Weakness"; + case 1:{ + return "Red Sand"; } - default: - return "Lingering Potion"; - } - } - case WOOD_STEP:{ - switch (type.getDurability()) { - case 0:{ - return "Oak Wood Slab"; - } - case 1:{ - return "Spruce Wood Slab"; - } - case 2:{ - return "Birch Wood Slab"; - } - case 3:{ - return "Jungle Wood Slab"; - } - case 4:{ - return "Acacia Wood Slab"; - } - case 5:{ - return "Dark Oak Wood Slab"; } } - } - case SAND:{ - switch (type.getDurability()) { - case 0:{ - return "Sand"; - } - case 1:{ - return "Red Sand"; + case INK_SACK:{ + switch (type.getDurability()) { + case 0:{ + return "Ink Sac"; + } + case 1:{ + return "Rose Red"; + } + case 2:{ + return "Cactus Green"; + } + case 3:{ + return "Cocoa Beans"; + } + case 4:{ + return "Lapis Lazuli"; + } + case 5:{ + return "Purple Dye"; + } + case 6:{ + return "Cyan Dye"; + } + case 7:{ + return "Light Gray Dye"; + } + case 8:{ + return "Gray Dye"; + } + case 9:{ + return "Pink Dye"; + } + case 10:{ + return "Lime Dye"; + } + case 11:{ + return "Dandelion Yellow"; + } + case 12:{ + return "Light Blue Dye"; + } + case 13:{ + return "Magenta Dye"; + } + case 14:{ + return "Orange Dye"; + } + case 15:{ + return "Bone Meal"; + } } } - } - case INK_SACK:{ - switch (type.getDurability()) { - case 0:{ - return "Ink Sac"; - } - case 1:{ - return "Rose Red"; - } - case 2:{ - return "Cactus Green"; - } - case 3:{ - return "Cocoa Beans"; - } - case 4:{ - return "Lapis Lazuli"; - } - case 5:{ - return "Purple Dye"; - } - case 6:{ - return "Cyan Dye"; - } - case 7:{ - return "Light Gray Dye"; - } - case 8:{ - return "Gray Dye"; - } - case 9:{ - return "Pink Dye"; - } - case 10:{ - return "Lime Dye"; - } - case 11:{ - return "Dandelion Yellow"; - } - case 12:{ - return "Light Blue Dye"; - } - case 13:{ - return "Magenta Dye"; - } - case 14:{ - return "Orange Dye"; - } - case 15:{ - return "Bone Meal"; + case HARD_CLAY:{ + return "Hardened Clay"; + } + case BANNER:{ + switch (15-type.getDurability()) { + case 0:{ + return "White Banner"; + } + case 1:{ + return "Orange Banner"; + } + case 2:{ + return "Magenta Banner"; + } + case 3:{ + return "Light Blue Banner"; + } + case 4:{ + return "Yellow Banner"; + } + case 5:{ + return "Lime Banner"; + } + case 6:{ + return "Pink Banner"; + } + case 7:{ + return "Gray Banner"; + } + case 8:{ + return "Light Gray Banner"; + } + case 9:{ + return "Cyan Banner"; + } + case 10:{ + return "Purple Banner"; + } + case 11:{ + return "Blue Banner"; + } + case 12:{ + return "Brown Banner"; + } + case 13:{ + return "Green Banner"; + } + case 14:{ + return "Red Banner"; + } + case 15:{ + return "Black Banner"; + } } } - } - case HARD_CLAY:{ - return "Hardened Clay"; - } - case BANNER:{ - switch (15-type.getDurability()) { - case 0:{ - return "White Banner"; - } - case 1:{ - return "Orange Banner"; - } - case 2:{ - return "Magenta Banner"; - } - case 3:{ - return "Light Blue Banner"; - } - case 4:{ - return "Yellow Banner"; - } - case 5:{ - return "Lime Banner"; - } - case 6:{ - return "Pink Banner"; - } - case 7:{ - return "Gray Banner"; - } - case 8:{ - return "Light Gray Banner"; - } - case 9:{ - return "Cyan Banner"; - } - case 10:{ - return "Purple Banner"; - } - case 11:{ - return "Blue Banner"; - } - case 12:{ - return "Brown Banner"; - } - case 13:{ - return "Green Banner"; - } - case 14:{ - return "Red Banner"; - } - case 15:{ - return "Black Banner"; + case STAINED_CLAY:{ + switch (type.getDurability()) { + case 0:{ + return "White Stained Clay"; + } + case 1:{ + return "Orange Stained Clay"; + } + case 2:{ + return "Magenta Stained Clay"; + } + case 3:{ + return "Light Blue Stained Clay"; + } + case 4:{ + return "Yellow Stained Clay"; + } + case 5:{ + return "Lime Stained Clay"; + } + case 6:{ + return "Pink Stained Clay"; + } + case 7:{ + return "Gray Stained Clay"; + } + case 8:{ + return "Light Gray Stained Clay"; + } + case 9:{ + return "Cyan Stained Clay"; + } + case 10:{ + return "Purple Stained Clay"; + } + case 11:{ + return "Blue Stained Clay"; + } + case 12:{ + return "Brown Stained Clay"; + } + case 13:{ + return "Green Stained Clay"; + } + case 14:{ + return "Red Stained Clay"; + } + case 15:{ + return "Black Stained Clay"; + } } } - } - case STAINED_CLAY:{ - switch (type.getDurability()) { - case 0:{ - return "White Stained Clay"; - } - case 1:{ - return "Orange Stained Clay"; - } - case 2:{ - return "Magenta Stained Clay"; - } - case 3:{ - return "Light Blue Stained Clay"; - } - case 4:{ - return "Yellow Stained Clay"; - } - case 5:{ - return "Lime Stained Clay"; - } - case 6:{ - return "Pink Stained Clay"; - } - case 7:{ - return "Gray Stained Clay"; - } - case 8:{ - return "Light Gray Stained Clay"; - } - case 9:{ - return "Cyan Stained Clay"; - } - case 10:{ - return "Purple Stained Clay"; - } - case 11:{ - return "Blue Stained Clay"; - } - case 12:{ - return "Brown Stained Clay"; - } - case 13:{ - return "Green Stained Clay"; - } - case 14:{ - return "Red Stained Clay"; - } - case 15:{ - return "Black Stained Clay"; + case WOOL:{ + switch (type.getDurability()) { + case 0:{ + return "White Wool"; + } + case 1:{ + return "Orange Wool"; + } + case 2:{ + return "Magenta Wool"; + } + case 3:{ + return "Light Blue Wool"; + } + case 4:{ + return "Yellow Wool"; + } + case 5:{ + return "Lime Wool"; + } + case 6:{ + return "Pink Wool"; + } + case 7:{ + return "Gray Wool"; + } + case 8:{ + return "Light Gray Wool"; + } + case 9:{ + return "Cyan Wool"; + } + case 10:{ + return "Purple Wool"; + } + case 11:{ + return "Blue Wool"; + } + case 12:{ + return "Brown Wool"; + } + case 13:{ + return "Green Wool"; + } + case 14:{ + return "Red Wool"; + } + case 15:{ + return "Black Wool"; + } } } - } - case WOOL:{ - switch (type.getDurability()) { - case 0:{ - return "White Wool"; - } - case 1:{ - return "Orange Wool"; - } - case 2:{ - return "Magenta Wool"; - } - case 3:{ - return "Light Blue Wool"; - } - case 4:{ - return "Yellow Wool"; - } - case 5:{ - return "Lime Wool"; - } - case 6:{ - return "Pink Wool"; - } - case 7:{ - return "Gray Wool"; - } - case 8:{ - return "Light Gray Wool"; - } - case 9:{ - return "Cyan Wool"; - } - case 10:{ - return "Purple Wool"; - } - case 11:{ - return "Blue Wool"; - } - case 12:{ - return "Brown Wool"; - } - case 13:{ - return "Green Wool"; - } - case 14:{ - return "Red Wool"; - } - case 15:{ - return "Black Wool"; + case THIN_GLASS:{ + return "Glass Pane"; + } + case STAINED_GLASS:{ + switch (type.getDurability()) { + case 0:{ + return "White Stained Glass"; + } + case 1:{ + return "Orange Stained Glass"; + } + case 2:{ + return "Magenta Stained Glass"; + } + case 3:{ + return "Light Blue Stained Glass"; + } + case 4:{ + return "Yellow Stained Glass"; + } + case 5:{ + return "Lime Stained Glass"; + } + case 6:{ + return "Pink Stained Glass"; + } + case 7:{ + return "Gray Stained Glass"; + } + case 8:{ + return "Light Gray Stained Glass"; + } + case 9:{ + return "Cyan Stained Glass"; + } + case 10:{ + return "Purple Stained Glass"; + } + case 11:{ + return "Blue Stained Glass"; + } + case 12:{ + return "Brown Stained Glass"; + } + case 13:{ + return "Green Stained Glass"; + } + case 14:{ + return "Red Stained Glass"; + } + case 15:{ + return "Black Stained Glass"; + } } } - } - case THIN_GLASS:{ - return "Glass Pane"; - } - case STAINED_GLASS:{ - switch (type.getDurability()) { - case 0:{ - return "White Stained Glass"; - } - case 1:{ - return "Orange Stained Glass"; - } - case 2:{ - return "Magenta Stained Glass"; - } - case 3:{ - return "Light Blue Stained Glass"; - } - case 4:{ - return "Yellow Stained Glass"; - } - case 5:{ - return "Lime Stained Glass"; - } - case 6:{ - return "Pink Stained Glass"; - } - case 7:{ - return "Gray Stained Glass"; - } - case 8:{ - return "Light Gray Stained Glass"; - } - case 9:{ - return "Cyan Stained Glass"; - } - case 10:{ - return "Purple Stained Glass"; - } - case 11:{ - return "Blue Stained Glass"; - } - case 12:{ - return "Brown Stained Glass"; - } - case 13:{ - return "Green Stained Glass"; - } - case 14:{ - return "Red Stained Glass"; - } - case 15:{ - return "Black Stained Glass"; + case STAINED_GLASS_PANE:{ + switch (type.getDurability()) { + case 0:{ + return "White Stained Glass Pane"; + } + case 1:{ + return "Orange Stained Glass Pane"; + } + case 2:{ + return "Magenta Stained Glass Pane"; + } + case 3:{ + return "Light Blue Stained Glass Pane"; + } + case 4:{ + return "Yellow Stained Glass Pane"; + } + case 5:{ + return "Lime Stained Glass Pane"; + } + case 6:{ + return "Pink Stained Glass Pane"; + } + case 7:{ + return "Gray Stained Glass Pane"; + } + case 8:{ + return "Light Gray Stained Glass Pane"; + } + case 9:{ + return "Cyan Stained Glass Pane"; + } + case 10:{ + return "Purple Stained Glass Pane"; + } + case 11:{ + return "Blue Stained Glass Pane"; + } + case 12:{ + return "Brown Stained Glass Pane"; + } + case 13:{ + return "Green Stained Glass Pane"; + } + case 14:{ + return "Red Stained Glass Pane"; + } + case 15:{ + return "Black Stained Glass Pane"; + } } } - } - case STAINED_GLASS_PANE:{ - switch (type.getDurability()) { - case 0:{ - return "White Stained Glass Pane"; - } - case 1:{ - return "Orange Stained Glass Pane"; - } - case 2:{ - return "Magenta Stained Glass Pane"; - } - case 3:{ - return "Light Blue Stained Glass Pane"; - } - case 4:{ - return "Yellow Stained Glass Pane"; - } - case 5:{ - return "Lime Stained Glass Pane"; - } - case 6:{ - return "Pink Stained Glass Pane"; - } - case 7:{ - return "Gray Stained Glass Pane"; - } - case 8:{ - return "Light Gray Stained Glass Pane"; - } - case 9:{ - return "Cyan Stained Glass Pane"; - } - case 10:{ - return "Purple Stained Glass Pane"; - } - case 11:{ - return "Blue Stained Glass Pane"; - } - case 12:{ - return "Brown Stained Glass Pane"; - } - case 13:{ - return "Green Stained Glass Pane"; - } - case 14:{ - return "Red Stained Glass Pane"; - } - case 15:{ - return "Black Stained Glass Pane"; + case YELLOW_FLOWER:{ + return "Dandelion"; + } + case RED_ROSE:{ + switch (type.getDurability()) { + case 0:{ + return "Poppy"; + } + case 1:{ + return "Blue Orchid"; + } + case 2:{ + return "Allium"; + } + case 3:{ + return "Azure Bluet"; + } + case 4:{ + return "Red Tulip"; + } + case 5:{ + return "Orange Tulip"; + } + case 6:{ + return "White Tulip"; + } + case 7:{ + return "Pink Tulip"; + } + case 8:{ + return "Oxeye Daisy"; + } } } - } - case YELLOW_FLOWER:{ - return "Dandelion"; - } - case RED_ROSE:{ - switch (type.getDurability()) { - case 0:{ - return "Poppy"; - } - case 1:{ - return "Blue Orchid"; - } - case 2:{ - return "Allium"; - } - case 3:{ - return "Azure Bluet"; - } - case 4:{ - return "Red Tulip"; - } - case 5:{ - return "Orange Tulip"; - } - case 6:{ - return "White Tulip"; - } - case 7:{ - return "Pink Tulip"; - } - case 8:{ - return "Oxeye Daisy"; + case WATER_LILY:{ + return "Lily Pad"; + } + case SUGAR_CANE_BLOCK:{ + return "Sugar Cane"; + } + case DOUBLE_PLANT:{ + switch (type.getDurability()) { + case 0:{ + return "Sunflower"; + } + case 1:{ + return "Lilac"; + } + case 2:{ + return "Double Tallgrass"; + } + case 3:{ + return "Large Fern"; + } + case 4:{ + return "Rose Bush"; + } + case 5:{ + return "Peony"; + } } } - } - case WATER_LILY:{ - return "Lily Pad"; - } - case SUGAR_CANE_BLOCK:{ - return "Sugar Cane"; - } - case DOUBLE_PLANT:{ - switch (type.getDurability()) { - case 0:{ - return "Sunflower"; - } - case 1:{ - return "Lilac"; - } - case 2:{ - return "Double Tallgrass"; - } - case 3:{ - return "Large Fern"; - } - case 4:{ - return "Rose Bush"; - } - case 5:{ - return "Peony"; - } + case BOAT:{ + return "Oak Boat"; + } + case CLAY_BRICK:{ + return "Brick"; + } + case BRICK:{ + return "Bricks"; + } + case FIREWORK:{ + return "Firework Rocket"; + } + case FIREWORK_CHARGE:{ + return "Firework Star"; + } + case EXP_BOTTLE:{ + return "Bottle o' Enchanting"; + } + case GOLD_SWORD:{ + return "Golden Sword"; + } + default:{ + return GenericFunctions.CapitalizeFirstLetters(type.getType().toString().replace("_", " ")); } } - case BOAT:{ - return "Oak Boat"; - } - case CLAY_BRICK:{ - return "Brick"; - } - case BRICK:{ - return "Bricks"; - } - case FIREWORK:{ - return "Firework Rocket"; - } - case FIREWORK_CHARGE:{ - return "Firework Star"; - } - case EXP_BOTTLE:{ - return "Bottle o' Enchanting"; - } - case GOLD_SWORD:{ - return "Golden Sword"; - } - default:{ - return GenericFunctions.CapitalizeFirstLetters(type.getType().toString().replace("_", " ")); + } else { + if (Math.random()<=0.01) { + switch ((int)((Math.random())*29)) { + case 0: return "Pleased to meet you"; + case 1: return "They aren't gonna like this."; + case 2: return "Dust'em, Pix!"; + case 3: return "A solid giggle should do the trick."; + case 4: return "Let's use ALL the colors!"; + case 5: return "Too tall...much too tall"; + case 6: return "I recommend skipping."; + case 7: return "Just a pinch!"; + case 8: return "You'll see more with your eyes closed."; + case 9: return "Whoa...dizzy."; + case 10: return "Nosey dewdrop..."; + case 11: return "Never look a tulip in the eye..."; + case 12: return "That squirrel looks familiar."; + case 13: return "C'mon you, let's dance! Ha!"; + case 14: return "Let's go around again! Ha!"; + case 15: return "I could go for a twirl... Whoa, whoa whoa ah, wooh!"; + case 16: return "Let's put on our thinking caps! Hmm... hmmhmm, hmmhmm...Ah, I got it!"; + case 17: return "Adoribus!"; + case 18: return "Fuzzy!"; + case 19: return "Delightify!"; + case 20: return "Transmogulate!"; + case 21: return "Cuddly incoming!"; + case 22: return "Zippy!"; + case 23: return "Vroom vroom!"; + case 24: return "Tut tut!"; + case 25: return "Hot foot!"; + case 26: return "Hugeify!"; + case 27: return "Tremendo!"; + case 28: return "Enormibus!"; + default: return "Lulu"; + } + } else { + return "Air"; } } } @@ -1791,6 +1850,121 @@ public class GenericFunctions { return false; } } + public static boolean isRanger(Player p) { + if (p.getEquipment().getItemInMainHand()!=null && p.getEquipment().getItemInMainHand().getType()==Material.BOW && + (p.getInventory().getExtraContents()[0]==null || p.getInventory().getExtraContents()[0].getType().toString().contains("ARROW")) && + AllLeatherArmor(p)) { + return true; + } else { + return false; + } + } + + public static boolean AllLeatherArmor(Player p) { + ItemStack[] equipment = p.getEquipment().getArmorContents(); + boolean leather=true; + for (int i=0;iPlayers are identified as 'Defenders' when they use a shield in their main hand.\n" + + ChatColor.GRAY+"->Base Damage reduction from shields increases from 5%->10%\n" + + ChatColor.WHITE+"->Blocking damage reduction increases from 50->70%\n" + + ChatColor.GRAY+"->When not blocking, you have Regeneration I. Blocking applies Regeneration II.\n" + + ChatColor.WHITE+"->Blocking gives 8 health (4 hearts) of Absorption damage.\n" + + ChatColor.GRAY+"->When hit while blocking, you build up Resistance, one level per hit, up to Resistance V (lasts 2 seconds)\n" + + ChatColor.WHITE+"->While blocking, you absorb 50% of all damage taken by party members.\n" + + ChatColor.GRAY+"->Blocking will aggro all nearby mobs to the blocking defender. They will glow indicate the aggro shift.\n" + + ChatColor.WHITE+"->Base Health increased by 10 (5 hearts)\n" + + ChatColor.GRAY+"->Getting hit as a defender increases saturation.\n" + + ChatColor.WHITE+"->Hitting mobs as a Defender aggros them to you.\n" + + ChatColor.GRAY+"->Knockback from attacks reduced by 75% while blocking.\n" + ; + } + case "striker":{ + return ChatColor.RED+""+ChatColor.BOLD+mode+" mode Perks: "+ChatColor.RESET+"\n" + + ChatColor.WHITE+"->Players are identified as 'Strikers' when they only carry a sword in their main hand. No off-hand items.\n" + + ChatColor.GRAY+"->10% passive damage increase.\n" + + ChatColor.WHITE+"->20% chance to critically strike.\n" + + ChatColor.GRAY+"->Every 10% of missing health increases your damage by 10%. (Ex. 99% damage increase at 99% lost hp.)\n" + + ChatColor.WHITE+"->Getting hit increases Speed by 1 Level. Stacks up to Speed V (Lasts five seconds.)\n" + + ChatColor.GRAY+"->Swinging your weapon stops nearby flying arrows. Each arrow deflected will give you a Strength buff. Stacks up to Strength V (Lasts five seconds.)\n" + + ChatColor.WHITE+"->Throwing your weapon while sneaking will perform a line drive. Enemies you charge through take x7 your base damage. This costs 5% of your durability (Unbreaking decreases this amount.)\n" + + ChatColor.GRAY+"->Strikers have a 20% chance to dodge incoming attacks from any damage source while moving.\n" + + ChatColor.WHITE+"->Hitting a target when both the player and the enemy are at full health deals x3 normal damage.\n" + ; + } + case "ranger":{ + return ChatColor.DARK_GREEN+""+ChatColor.BOLD+mode+" mode Perks: "+ChatColor.RESET+"\n" + + ChatColor.WHITE+"->Players are identified as 'Rangers' when they only carry a bow in their main hand. No off-hand items except for an arrow quiver. Can only be wearing leather armor, or no armor.\n" + + ChatColor.GRAY+"->Left-clicking mobs will cause them to be knocked back extremely far, basically in headshot range, when walls permit.\n" + + ChatColor.WHITE+"->Base Arrow Damage increases from x1->x4.\n" + + ChatColor.GRAY+"->Arrow speed massively increases. Your old max firing speed is the new minimum drawback speed.\n" + + ChatColor.WHITE+"->You can dodge 50% of all incoming attacks from any damage sources.\n" + + ChatColor.GRAY+"You have immunity to all Thorns damage.\n" + + ChatColor.WHITE+"Shift-Left Click to change Bow Modes.\n" + + ChatColor.GRAY+"- Close Range Mode (Default): \n" + + ChatColor.WHITE+" You gain the ability to deal headshots from any distance, even directly onto an enemy's face. (Old headshot behavior)\n" + + ChatColor.GRAY+"- Sniping Mode: \n" + + ChatColor.WHITE+" Headshot collision area increases by x3. Headshots deal x4 damage, but you also have Slowness VI while in this mode.\n" + + ChatColor.GRAY+"- Debilitation Mode:\n" + + ChatColor.WHITE+" Adds a stack of Poison when hitting non-poisoned targets (20 second duration). Hitting mobs in this mode refreshes the duration of the poison stacks. Headshots made in this mode will increase the level of Poison on the mob, making the mob more and more vulnerable.\n" + ; + } + default:{ + return "This mode either does not exist or has no perks!"; + } + } + } + public static boolean holdingNoShield(Player p) { return p.getInventory().getExtraContents()[0]==null; } @@ -2119,29 +2293,173 @@ public class GenericFunctions { return item; } + public static boolean HasFullRangerSet(Player p) { + + int rangerarmort1 = 0; //Count the number of each tier of sets. + int rangerarmort2 = 0; + int rangerarmort3 = 0; + int rangerarmort4 = 0; + + if (isRanger(p)) { + for (int i=0;i=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) { dodgechance+=0.01*p.getEquipment().getArmorContents()[i].getEnchantmentLevel(Enchantment.LUCK); } + ItemStack equip = p.getEquipment().getArmorContents()[i]; + if (isRanger(p) && equip!=null + && equip.getType()!=Material.AIR && + equip.hasItemMeta() && equip.getItemMeta().hasLore()) { + if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Jamdak Set")) { + dodgechance+=0.03; + } else + if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Darnys Set")) { + dodgechance+=0.05; + } else + if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Alikahn Set")) { + dodgechance+=0.08; + } else + if (equip.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.BOLD+"Lorasaadi Set")) { + dodgechance+=0.11; + } + } } + + PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId()); + if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand()) && p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) { dodgechance+=0.01*p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK); } - PlayerStructure pd = (PlayerStructure)TwosideKeeper.playerdata.get(p.getUniqueId()); if (isStriker(p) && pd.velocity>0) { dodgechance+=0.2; } + if (isRanger(p)) { + dodgechance+=0.5; + } return dodgechance; } + public static ItemStack applyModeName(ItemStack item) { + if (item!=null && + item.getType()!=Material.AIR && + item.hasItemMeta()) { + ItemMeta m = item.getItemMeta(); + if (m.hasDisplayName()) { + String name = m.getDisplayName(); + if (name.contains(" Mode)"+ChatColor.WHITE) && name.contains(ChatColor.GREEN+"(")) { + String newname = name.split(ChatColor.GREEN+"\\(")[0]+ChatColor.GREEN+"("+CapitalizeFirstLetters(getBowMode(item).GetCoolName())+" Mode)"+ChatColor.WHITE; + m.setDisplayName(newname); + item.setItemMeta(m); + return item; + } else { + String newname = name+" "+ChatColor.GREEN+"\\("+CapitalizeFirstLetters(getBowMode(item).name())+" Mode)"+ChatColor.WHITE; + m.setDisplayName(newname); + item.setItemMeta(m); + return item; + } + } else { + String newname = UserFriendlyMaterialName(item)+" "+ChatColor.GREEN+"("+CapitalizeFirstLetters(getBowMode(item).GetCoolName())+" Mode)"+ChatColor.WHITE; + m.setDisplayName(newname); + item.setItemMeta(m); + return item; + } + } + 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; + } + + public static BowMode getBowMode(ItemStack item) { + if (item!=null && + item.getType()!=Material.AIR && + item.hasItemMeta()) { + if (!item.getItemMeta().hasLore()) { + return BowMode.CLOSE; //The default. + } else { + ItemMeta m = item.getItemMeta(); + List oldlore = m.getLore(); + if (oldlore.size()>=1) { + String secondpart = oldlore.get(0).split(ChatColor.MAGIC+" BM")[1]; + return BowMode.valueOf(secondpart); + } else { + return BowMode.CLOSE; //The default. + } + } + } else { + return BowMode.CLOSE; + } + } + + public static ItemStack setBowMode(ItemStack item, BowMode mode) { + if (item!=null && + item.getType()!=Material.AIR && + item.hasItemMeta()) { + ItemMeta m = item.getItemMeta(); + if (m.hasLore()) { + List oldlore = m.getLore(); + if (oldlore.size()>=1) { + if (oldlore.get(0).contains(ChatColor.MAGIC+" BM")) { + oldlore.set(0, oldlore.get(0).split(ChatColor.MAGIC+" BM")[0]+ChatColor.MAGIC+" BM"+mode.name()); + } else { + oldlore.set(0, oldlore.get(0)+ChatColor.MAGIC+" BM"+mode.name()); + } + } else { + oldlore.add(ChatColor.MAGIC+" BM"+mode.name()); + } + m.setLore(oldlore); + item.setItemMeta(m); + } else { + List newlore = new ArrayList(); + newlore.add(ChatColor.MAGIC+" BM"+mode.name()); + m.setLore(newlore); + item.setItemMeta(m); + } + } + return item; + } + public static void AutoRepairItems(Player p) { for (int i=0;i<9;i++) { if (ArtifactAbility.containsEnchantment(ArtifactAbility.AUTOREPAIR, p.getInventory().getItem(i))) { @@ -2223,10 +2541,18 @@ public class GenericFunctions { target.setNoDamageTicks(20); } else { //Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,target,DamageCause.ENTITY_ATTACK,finaldmg)); - target.setHealth(0.00000000001); + target.setHealth(0.0001); target.damage(99999); - //TwosideKeeper.log("New Health."+target.getHealth(), 2); - target.setNoDamageTicks(20); + target.setHealth(0); } } + + public static boolean searchfor(List stringy, String searchfor) { + for (int i=0;i fakelore = new ArrayList(); + //Choose a green/yellow/white/brown color. + // Brown - Low Tier (3% - 62% max): Jamdak + // White - Middle Tier (5% - 70% max): Darnys + // Yellow - High Tier (8% - 82% max): Alikahn + // Green - Max Tier (11% - 94% max): Lorasaadi + switch (tier) { + default: { + sword_meta.setDisplayName(ChatColor.AQUA+""+ChatColor.BOLD+"Mega Jamdak Ranger "+GenericFunctions.UserFriendlyMaterialName(mat_type).replace("Leather ", "")); + if (mat_type.toString().contains("LEATHER")) { + fakelore.add(ChatColor.LIGHT_PURPLE+"Ranger Gear"); + fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Jamdak Set"); + fakelore.add(ChatColor.YELLOW+"+3% Dodge Chance"); + } + LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta; + lm.setColor(Color.fromRGB(128, 64, 0)); + }break; + case 2: { + sword_meta.setDisplayName(ChatColor.AQUA+""+ChatColor.BOLD+"Mega Darnys Ranger "+GenericFunctions.UserFriendlyMaterialName(mat_type).replace("Leather ", "")); + if (mat_type.toString().contains("LEATHER")) { + fakelore.add(ChatColor.LIGHT_PURPLE+"Ranger Gear"); + fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Darnys Set"); + fakelore.add(ChatColor.YELLOW+"+5% Dodge Chance"); + LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta; + lm.setColor(Color.fromRGB(224, 224, 224)); + } + }break; + case 3: { + sword_meta.setDisplayName(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Hardened Mega Alikahn Ranger "+GenericFunctions.UserFriendlyMaterialName(mat_type).replace("Leather ", "")); + if (mat_type.toString().contains("LEATHER")) { + fakelore.add(ChatColor.LIGHT_PURPLE+"Ranger Gear"); + fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Alikahn Set"); + fakelore.add(ChatColor.YELLOW+"+8% Dodge Chance"); + fakelore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+GetHardenedBreaks(mat_type)); + LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta; + lm.setColor(Color.fromRGB(64, 0, 64)); + } + }break; + case 4: { + sword_meta.setDisplayName(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Hardened Mega Lorasaadi Ranger "+GenericFunctions.UserFriendlyMaterialName(mat_type).replace("Leather ", "")); + if (mat_type.toString().contains("LEATHER")) { + fakelore.add(ChatColor.LIGHT_PURPLE+"Ranger Gear"); + fakelore.add(ChatColor.GOLD+""+ChatColor.BOLD+"Lorasaadi Set"); + fakelore.add(ChatColor.YELLOW+"+11% Dodge Chance"); + fakelore.add(ChatColor.GRAY+"Breaks Remaining: "+ChatColor.YELLOW+GetHardenedBreaks(mat_type)); + LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta; + lm.setColor(Color.fromRGB(0, 64, 0)); + } + }break; + } + sword_meta.setLore(fakelore); + raresword.setItemMeta(sword_meta); + raresword = addEnchantments(raresword,false); + return raresword; + } + private static int GetHardenedBreaks(Material type) { if (type.toString().contains("STONE")) { return (int)((Math.random()*3)+2); @@ -49,6 +110,9 @@ public class Loot { if (type.toString().contains("GOLD")) { return (int)((Math.random()*12)+10); } else + if (type.toString().contains("LEATHER")) { + return (int)((Math.random()*12)+10); + } else { return 5; } @@ -76,7 +140,7 @@ public class Loot { enchantment_level = (int)(((Math.random()*5)+6)*((hardened)?HARDENED_ENCHANT_MULT:1)); } else { - enchantment_level = (int)(((Math.random()*9)+1)*((hardened)?HARDENED_ENCHANT_MULT:1)); + enchantment_level = (int)(((Math.random()*6)+3)*((hardened)?HARDENED_ENCHANT_MULT:1)); } if (enchantment_level>MAX_ENCHANT_LEVEL) { diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java b/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java index 7a4724d..5711eb0 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/MonsterDifficulty.java @@ -20,6 +20,10 @@ public enum MonsterDifficulty { new LootStructure(Material.IRON_INGOT), new LootStructure(Material.DIAMOND), new LootStructure(Material.GOLD_NUGGET), + new LootStructure(Material.LEATHER_HELMET,1), + new LootStructure(Material.LEATHER_CHESTPLATE,1), + new LootStructure(Material.LEATHER_LEGGINGS,1), + new LootStructure(Material.LEATHER_BOOTS,1), }, new LootStructure[]{ //Legendary Loot new LootStructure(Material.STONE_SWORD, true), @@ -28,6 +32,10 @@ public enum MonsterDifficulty { new LootStructure(Material.GOLD_NUGGET,(int)((Math.random()*3)+1)), new LootStructure(Material.ENDER_PEARL,(int)((Math.random()*3)+1)), new LootStructure(Material.ENDER_CHEST), + new LootStructure(Material.LEATHER_HELMET,2), + new LootStructure(Material.LEATHER_CHESTPLATE,2), + new LootStructure(Material.LEATHER_LEGGINGS,2), + new LootStructure(Material.LEATHER_BOOTS,2), } ), DANGEROUS( @@ -46,6 +54,10 @@ public enum MonsterDifficulty { new LootStructure(Material.STONE_HOE, false), new LootStructure(Material.STONE_SPADE, false), new LootStructure(Material.FISHING_ROD, false), + new LootStructure(Material.LEATHER_HELMET,2), + new LootStructure(Material.LEATHER_CHESTPLATE,2), + new LootStructure(Material.LEATHER_LEGGINGS,2), + new LootStructure(Material.LEATHER_BOOTS,2), }, new LootStructure[]{ //Legendary Loot new LootStructure(Material.IRON_SWORD, true), @@ -58,6 +70,10 @@ public enum MonsterDifficulty { new LootStructure(Material.STONE_HOE, true), new LootStructure(Material.STONE_SPADE, true), new LootStructure(Material.FISHING_ROD, true), + new LootStructure(Material.LEATHER_HELMET,2), + new LootStructure(Material.LEATHER_CHESTPLATE,2), + new LootStructure(Material.LEATHER_LEGGINGS,2), + new LootStructure(Material.LEATHER_BOOTS,2), } ), DEADLY( @@ -81,6 +97,10 @@ public enum MonsterDifficulty { new LootStructure(Material.DIAMOND_HELMET, false), new LootStructure(Material.FISHING_ROD, false), new LootStructure(Material.BOW, false), + new LootStructure(Material.LEATHER_HELMET,2), + new LootStructure(Material.LEATHER_CHESTPLATE,2), + new LootStructure(Material.LEATHER_LEGGINGS,2), + new LootStructure(Material.LEATHER_BOOTS,2), }, new LootStructure[]{ //Legendary Loot new LootStructure(Material.DIAMOND_SWORD, true), @@ -94,6 +114,10 @@ public enum MonsterDifficulty { new LootStructure(Material.DIAMOND_BOOTS, true), new LootStructure(Material.DIAMOND_HELMET, true), new LootStructure(Material.FISHING_ROD, true), + new LootStructure(Material.LEATHER_HELMET,3), + new LootStructure(Material.LEATHER_CHESTPLATE,3), + new LootStructure(Material.LEATHER_LEGGINGS,3), + new LootStructure(Material.LEATHER_BOOTS,3), } ), HELLFIRE( @@ -122,6 +146,10 @@ public enum MonsterDifficulty { new LootStructure(Material.GOLD_HELMET, false), new LootStructure(Material.BOW, false), new LootStructure(Material.FISHING_ROD, false), + new LootStructure(Material.LEATHER_HELMET,3), + new LootStructure(Material.LEATHER_CHESTPLATE,3), + new LootStructure(Material.LEATHER_LEGGINGS,3), + new LootStructure(Material.LEATHER_BOOTS,3), }, new LootStructure[]{ //Legendary Loot new LootStructure(Material.GOLD_SWORD, true), @@ -140,6 +168,10 @@ public enum MonsterDifficulty { new LootStructure(Material.GOLD_HELMET, true), new LootStructure(Material.BOW, true), new LootStructure(Material.FISHING_ROD, true), + new LootStructure(Material.LEATHER_HELMET,4), + new LootStructure(Material.LEATHER_CHESTPLATE,4), + new LootStructure(Material.LEATHER_LEGGINGS,4), + new LootStructure(Material.LEATHER_BOOTS,4), } ); @@ -158,7 +190,7 @@ public enum MonsterDifficulty { return null; } - public List RandomizeDrops(double dropmult, boolean isBoss) { + public List RandomizeDrops(double dropmult, boolean isBoss, boolean isRanger) { List droplist = new ArrayList(); dropmult += 1; //Base dropmult is 1.0. if (Math.random() < dropmult % 1) @@ -174,7 +206,7 @@ public enum MonsterDifficulty { if (Math.random()0) { //This is a common roll. - ItemStack gen_loot = DistributeRandomLoot(this.loot_regular); + ItemStack gen_loot = DistributeRandomLoot(this.loot_regular, isRanger); TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4); droplist.add(gen_loot); } @@ -182,7 +214,7 @@ public enum MonsterDifficulty { if (Math.random()0) { //This is a common roll. - ItemStack gen_loot = DistributeRandomLoot(this.loot_rare); + ItemStack gen_loot = DistributeRandomLoot(this.loot_rare, isRanger); TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4); droplist.add(gen_loot); if (Math.random()<=0.2) { @@ -206,7 +238,7 @@ public enum MonsterDifficulty { if (Math.random()0) { //This is a common roll. - ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary); + ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary, isRanger); TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4); droplist.add(gen_loot); if (Math.random()<=0.2) { @@ -235,13 +267,13 @@ public enum MonsterDifficulty { } if (isBoss) { //50% of the time, we drop something great. if (Math.random()<=0.5 && this.loot_legendary.length>0) { - ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary); + ItemStack gen_loot = DistributeRandomLoot(this.loot_legendary, isRanger); TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4); droplist.add(gen_loot); } else if (this.loot_rare.length>0) { //Consolation Prize. - ItemStack gen_loot = DistributeRandomLoot(this.loot_rare); + ItemStack gen_loot = DistributeRandomLoot(this.loot_rare, isRanger); TwosideKeeper.log("Adding "+gen_loot.toString()+" to loot table.", 4); droplist.add(gen_loot); } @@ -251,7 +283,7 @@ public enum MonsterDifficulty { return droplist; } - private ItemStack DistributeRandomLoot(LootStructure[] lootlist) { + private ItemStack DistributeRandomLoot(LootStructure[] lootlist, boolean isRanger) { //Choose an item randomly from the loot list. if (lootlist.length>0) { //Choose an element. @@ -265,7 +297,16 @@ public enum MonsterDifficulty { return new ItemStack(ls.GetMaterial(),1,(short)(Math.random()*ls.GetMaterial().getMaxDurability())); } } else { - return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened()); + if (ls.GetMaterial().toString().contains("LEATHER")) { + if (isRanger) { + return Loot.GenerateRangerPiece(ls.GetMaterial(), ls.GetHardened(), ls.GetAmount()); + } else { + //Re-roll if a ranger did not kill, as we cannot reward ranger armor to non-rangers. + return DistributeRandomLoot(lootlist,isRanger); + } + } else { + return Loot.GenerateMegaPiece(ls.GetMaterial(), ls.GetHardened()); + } } } else { //Turn it into a normal item. diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java index 6f1387e..a37182a 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java @@ -110,7 +110,7 @@ public class WorldShop { String message = ""; if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()) { - message+="\n"+ChatColor.DARK_GRAY+"Item Type: "+ChatColor.ITALIC+ChatColor.GRAY+GenericFunctions.UserFriendlyMaterialName(item)+"\n"; + message+="\n"+ChatColor.DARK_GRAY+"Item Type: "+ChatColor.ITALIC+ChatColor.GRAY+GenericFunctions.UserFriendlyMaterialName(item.getType())+"\n"; } for (int i=0;i partyplayers; public List lastorder; @@ -102,6 +104,10 @@ public class Party { } Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set "+p.getName().toLowerCase()+" Party"+color+" "+partyplayers.size()*-1); Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard teams option "+p.getName().toLowerCase()+" color "+ConvertColor(color)); + + p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(TwosideKeeper.createHealthbar(((p.getHealth())/p.getMaxHealth())*100,p)); + TwosideKeeper.setPlayerMaxHealth(p); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(p)); } public void sortPlayers() { @@ -189,6 +195,12 @@ public class Party { if (partyplayers.size()>=2) { //partyplayers.get(i).sendMessage(ChatColor.DARK_GRAY+""+ChatColor.ITALIC+"Party buffs removed."); } + if (partyplayers.get(i)!=null && + partyplayers.get(i).isOnline()) { + partyplayers.get(i).getScoreboard().getTeam(partyplayers.get(i).getName().toLowerCase()).setSuffix(TwosideKeeper.createHealthbar(((partyplayers.get(i).getHealth())/partyplayers.get(i).getMaxHealth())*100,partyplayers.get(i))); + TwosideKeeper.setPlayerMaxHealth(partyplayers.get(i)); + partyplayers.get(i).getScoreboard().getTeam(partyplayers.get(i).getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(partyplayers.get(i))); + } partyplayers.remove(i); i--; } diff --git a/src/sig/plugin/TwosideKeeper/PlayerStructure.java b/src/sig/plugin/TwosideKeeper/PlayerStructure.java index d8b3813..05edb30 100644 --- a/src/sig/plugin/TwosideKeeper/PlayerStructure.java +++ b/src/sig/plugin/TwosideKeeper/PlayerStructure.java @@ -61,6 +61,7 @@ public class PlayerStructure { public boolean highwinder=false; public double highwinderdmg=0.0; public int nextarrowxp = 0; //How much bonus XP to give to an Artifact Bow. + public boolean hasfullrangerset=false; public double prev_weapondmg=0.0; public double prev_buffdmg=0.0; @@ -100,6 +101,7 @@ public class PlayerStructure { this.highwinder=false; this.highwinderdmg=0.0; this.nextarrowxp=0; + this.hasfullrangerset=false; this.last_strikerspell=TwosideKeeper.getServerTickTime(); //Set defaults first, in case this is a new user. loadConfig(); diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index f9a2a99..2bb7b5f 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -87,6 +87,7 @@ import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PotionSplashEvent; import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.CraftItemEvent; @@ -161,6 +162,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem; import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItemType; import sig.plugin.TwosideKeeper.HelperStructures.BankSession; +import sig.plugin.TwosideKeeper.HelperStructures.BowMode; import sig.plugin.TwosideKeeper.HelperStructures.CubeType; import sig.plugin.TwosideKeeper.HelperStructures.CustomRecipe; import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure; @@ -417,6 +419,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { */ //End Advertisements. + + LASTSERVERCHECK=getServerTickTime(); } @@ -493,6 +497,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } + if (GenericFunctions.isRanger(p) && + GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) { + p.removePotionEffect(PotionEffectType.SLOW); + p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,20,5)); + } + if (TwosideShops.PlayerHasPurchases(p)) { TwosideShops.PlayerSendPurchases(p); } @@ -515,7 +525,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (pd.highwinder && pd.target!=null && !pd.target.isDead()) { aPlugin.API.sendActionBarMessage(p, drawVelocityBar(pd.velocity,pd.highwinderdmg)); } - if (pd.target!=null && !pd.target.isDead() && pd.target.getLocation().distanceSquared(p.getLocation())>256) { + if (pd.target!=null && !pd.target.isDead() && pd.target.getLocation().getWorld().equals(p.getWorld()) && pd.target.getLocation().distanceSquared(p.getLocation())>256) { pd.target=null; } @@ -565,6 +575,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //Check damage reduction by sending an artifical "1" damage to the player. if (!p.isDead()) {log("Player is not dead.",5); setPlayerMaxHealth(p);} p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(createHealthbar(((p.getHealth())/p.getMaxHealth())*100,p)); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(p)); /*double old_weapondmg = pd.prev_weapondmg; double old_buffdmg = pd.prev_buffdmg; double old_partydmg = pd.prev_partydmg; @@ -661,6 +672,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { break; } } + PartyList.remove(j); j--; } else { @@ -813,6 +825,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { p.getLocation().add(0,0,0).getBlock().setType(Material.AIR); } if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) { + //GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE); + //p.sendMessage("This is bow mode "+GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())); /*for (int i=0;i0) { + ev.setDamage(ev.getDamage()+(ev.getDamage()*poisonlv*0.5)); + log("New damage set to "+ev.getDamage()+" from Poison "+poisonlv,3); + } + } + } } if (e instanceof Player) { @@ -3450,6 +3528,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //final double pcthp = ((p.getHealth())/p.getMaxHealth())*100; double dodgechance = GenericFunctions.CalculateDodgeChance(p); + + if (ev.getCause()==DamageCause.THORNS && + GenericFunctions.isRanger(p)) { + dodgechance=1; + } + if (Math.random()<=dodgechance) { //Cancel this event, we dodged the attack. p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f); @@ -3477,6 +3561,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { public void run() { if (p!=null) { p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(createHealthbar(((p.getHealth())/p.getMaxHealth())*100,p)); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(p)); } }} ,2); @@ -3659,6 +3744,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } + if (ev.getCause()==DamageCause.THORNS) { + ev.setDamage(GenericFunctions.getMaxThornsLevel(m)); + } + log("Final dmg is "+ev.getFinalDamage(),4); //Make this monster the player's new target. @@ -3691,20 +3780,29 @@ public class TwosideKeeper extends JavaPlugin implements Listener { ev.setDamage(DamageModifier.RESISTANCE,0); ev.setDamage(DamageModifier.ARMOR,0); + //log("Player dealt "+ev.getDamage(),2); + if (m.getType()==EntityType.ZOMBIE && MonsterController.getMonsterDifficulty((Monster)m)==MonsterDifficulty.HELLFIRE && !chargezombies.contains((Monster)m)) { chargezombies.add(new ChargeZombie((Monster)m)); } - ev.setDamage(CalculateWeaponDamage(p,m)); + + boolean preemptive = false; if (GenericFunctions.isStriker(p) && p.getHealth()==p.getMaxHealth() && m.getHealth()==m.getMaxHealth()) { //Deal triple damage. log("Triple damage!",5); - ev.setDamage(ev.getDamage()*3); + preemptive=true; + p.playSound(p.getLocation(), Sound.ENTITY_SHULKER_TELEPORT, 1f, 3.65f); } + + double rawdmg = CalculateWeaponDamage(p,m)*((preemptive)?3d:1d); + + ev.setDamage(rawdmg); + //Damage dealt by the player is calculated differently, therefore we will cancel the normal damage calculation in favor //of a new custom damage calculation. @@ -3731,6 +3829,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } } + } else { + double dmg = 2; + dmg+=p.getInventory().getItemInMainHand().getEnchantmentLevel(Enchantment.DAMAGE_ALL); + ev.setDamage(dmg); } if (m instanceof Monster) { if (m.getType()==EntityType.SPIDER && @@ -3787,6 +3889,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //Deal AoE damage. double checkrange = ArtifactAbility.calculateValue(ArtifactAbility.AOE, p.getEquipment().getItemInMainHand().getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.AOE, p.getEquipment().getItemInMainHand())); List entities = m.getNearbyEntities(checkrange, checkrange, checkrange); + int totalexp = 0; for (int i=0;i finallist = hitlist; Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { public void run() { @@ -3871,6 +3975,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (GenericFunctions.isWeapon(p.getEquipment().getItemInMainHand())) { GenericFunctions.RemovePermEnchantmentChance(p.getEquipment().getItemInMainHand(), p); } + if (GenericFunctions.isRanger(p)) { + Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { + public void run() { + m.setVelocity(m.getVelocity().setY(0.1).multiply(8)); + }} + ,1); + } //Artifact armor will receive a tiny bit of EXP. for (int i=0;i=64 || GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE) { + headshotvalx*=4; + headshotvaly*=6; + headshotvalz*=4; + } + if (GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) { + headshotvalx*=3; + headshotvaly*=12; + headshotvalz*=3; + } + } + log(headshotvalx+","+headshotvaly+","+headshotvalz,5); - if (ev.getDamager().getTicksLived()>=4) { + if (ev.getDamager().getTicksLived()>=4 || GenericFunctions.isRanger(p)) { if (Math.abs(arrowLoc.getY()-monsterHead.getY())<=headshotvaly) { - log("Height discrepancy is good.",5); - log("Height discrepancy is good.",5); if (Math.abs(arrowLoc.getZ()-monsterHead.getZ())<=headshotvalz && Math.abs(arrowLoc.getX()-monsterHead.getX())<=headshotvalx) { - ev.setDamage(ev.getDamage()*2.0); - p.sendMessage(ChatColor.DARK_RED+"Headshot! x2 Damage"); + + if (GenericFunctions.isRanger(p) && GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.SNIPE) { + ev.setDamage(ev.getDamage()*4.0); + p.sendMessage(ChatColor.DARK_RED+"Headshot! x4 Damage"); + p.playSound(p.getLocation(), Sound.ENTITY_LIGHTNING_IMPACT, 0.2f, 0.24f); + } else { + ev.setDamage(ev.getDamage()*2.0); + p.sendMessage(ChatColor.DARK_RED+"Headshot! x2 Damage"); + } headshot=true; } } } + + if (GenericFunctions.isRanger(p) && + GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.DEBILITATION) { + if (headshot && m.hasPotionEffect(PotionEffectType.BLINDNESS)) { + //Add to the current stack of BLINDNESS. + for (int i1=0;i10) { + AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), pd.nextarrowxp, p); + pd.nextarrowxp=0; + } + } + PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); dropmult+=pd.partybonus*0.33; //Party bonus increases drop rate by 33% per party member. ItemStack item = p.getEquipment().getItemInMainHand(); @@ -4152,6 +4319,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener { int unluckmult = 0; ms = (MonsterStructure)monsterdata.get(m.getUniqueId()); Player p = (Player)ms.GetTarget(); + + boolean isRanger=GenericFunctions.isRanger(p); + if (p.hasPotionEffect(PotionEffectType.LUCK) || p.hasPotionEffect(PotionEffectType.UNLUCK)) { for (int i=0;i drop = new ArrayList(); drop.addAll(droplist); @@ -4266,6 +4436,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { if (p!=null) { p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(createHealthbar(((p.getHealth())/p.getMaxHealth())*100,p)); setPlayerMaxHealth(p); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(p)); } }} ,5); @@ -4291,6 +4462,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { public void run() { if (p!=null) { p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(createHealthbar(((p.getHealth())/p.getMaxHealth())*100,p)); + p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(p)); } }} ,2); @@ -4387,7 +4559,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { GenericFunctions.RemovePermEnchantmentChance(p.getEquipment().getItemInMainHand(), p); if (ArtifactAbility.containsEnchantment(ArtifactAbility.EARTHWAVE, p.getEquipment().getItemInMainHand()) && pd.target!=null && !pd.target.isDead() && pd.last_shovelspell0) { - AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), pd.nextarrowxp, p); - pd.nextarrowxp=0; - } - } if (ev.getEntityType()==EntityType.PLAYER && (ev.getProjectile().getType()==EntityType.ARROW || ev.getProjectile().getType()==EntityType.TIPPED_ARROW)) { //Now we know this is a player who shot a regular old arrow. - //We need to give one back to them. + final Player p = (Player)ev.getEntity(); + //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. //Then queue a delayed event to add it back in if it's gone next tick. if (playerHasArrowQuiver(p)) { - log("A tipped arrow was shot. This could've been the arrow quiver. We will verify in 5 ticks.",5); + log("A tipped arrow was shot. This could've been the arrow quiver. We will verify in 1 tick.",5); final int ArrowQuiver_amt = playerGetArrowQuiverAmt(p,playerGetArrowQuiver(p)); boolean temp=false; //Check if it went in the off-hand slot. If so, put it back there. if (p.getInventory().getItemInOffHand().equals(p.getInventory().getItem(playerGetArrowQuiver(p)))) { @@ -4750,7 +4933,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } }} - ,5); + ,1); } } @@ -5401,7 +5584,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal. } - public String createHealthbar(double pcthp, Player p) { + public static String createHealthbar(double pcthp, Player p) { //IF YOU EVER UPDATE THIS YOU MUST UPDATE THE PLAYERDEATHEVENT DEATH MSG METHOD!!!! //Heart character: 2665 /*String bar = ChatColor.AQUA+" "; @@ -5461,6 +5644,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { String bar = " "; int length = 0; + if (pcthp==100) {bar += ((isHungry)?ChatColor.BLUE:ChatColor.AQUA)+""+Math.round(p.getHealth())+""+Character.toString((char)0x2665);} else if (pcthp>66) {bar += ((isHungry)?ChatColor.DARK_GREEN:ChatColor.GREEN)+""+Math.round(p.getHealth())+""+Character.toString((char)0x2665);} else if (pcthp>33) {bar += ((isHungry)?ChatColor.GOLD:ChatColor.YELLOW)+""+Math.round(p.getHealth())+""+Character.toString((char)0x2665);} else {bar += ((isHungry)?ChatColor.DARK_RED:ChatColor.RED)+""+Math.round(p.getHealth())+""+Character.toString((char)0x2665);} @@ -5685,7 +5869,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } - public void setPlayerMaxHealth(Player p) { + public static void setPlayerMaxHealth(Player p) { //Determine player max HP based on armor being worn. double hp=10; //Get the base max health. //Get all equips. @@ -5758,6 +5942,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } } + if (GenericFunctions.HasFullRangerSet(p)) { + hp += 20; + } + hp*=maxdeduction; if (p.getHealth()>=hp) { @@ -5770,7 +5958,21 @@ public class TwosideKeeper extends JavaPlugin implements Listener { p.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(hp); } + + public void updateTitle(final Player p, boolean headshot, boolean preemptive) { + if (preemptive) { + updateTitle(p,ChatColor.BLUE+"!"); + /* + Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { + public void run() { + updateTitle(p); + } + },15);*/ + } else { + updateTitle(p, headshot); + } + } public void updateTitle(final Player p, boolean headshot) { @@ -5797,7 +5999,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { final PlayerStructure pd2=pd; Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { public void run() { - if (Bukkit.getPlayer(pd2.name)!=null) { + if (Bukkit.getPlayer(pd2.name)!=null && pd2.target!=null) { String MonsterName = pd2.target.getType().toString().toLowerCase(); if (pd2.target.getCustomName()!=null) { MonsterName = pd2.target.getCustomName(); @@ -5972,9 +6174,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener { } boolean striker=false; + boolean ranger=false; if ((p instanceof Player) && GenericFunctions.isStriker((Player)p)) { striker=true; } + if ((p instanceof Player) && GenericFunctions.isRanger((Player)p)) { + ranger=true; + } int partylevel = 0; @@ -6090,7 +6296,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { *(1 + 0.1*partylevel) *(1 + 0.1*strengthlevel) *((10-weaknesslevel)*0.1) - *((striker)?1.1:1); + *((striker)?1.1:1) + *((ranger)?4.0:1); return finalamt; } @@ -6120,6 +6327,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener { int resistlevel = 0; int partylevel = 0; + if (target instanceof Player) { + if (GenericFunctions.HasFullRangerSet((Player)target)) { + dmgreduction+=20.0; + } + } + for (int i=0;i target_effects = target.getActivePotionEffects(); for (int i=0;i