package me.kaZep.Base; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.ConcurrentModificationException; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; import java.text.*; import me.kaZep.Commands.JobsDataInfo; import me.kaZep.Commands.JobsDataInfo.Job; import me.kaZep.Commands.commandBankEconomy; import net.jmhertlein.mctowns.MCTowns; import net.milkbowl.vault.economy.Economy; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Chunk; import org.bukkit.Color; import org.bukkit.DyeColor; import org.bukkit.Effect; import org.bukkit.FireworkEffect; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.Server; import org.bukkit.Sound; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BrewingStand; import org.bukkit.block.CreatureSpawner; import org.bukkit.block.Furnace; import org.bukkit.block.Jukebox; import org.bukkit.block.Sign; import org.bukkit.command.PluginCommand; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfigurationOptions; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Arrow; import org.bukkit.entity.Creature; import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Firework; import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.PigZombie; import org.bukkit.entity.Player; import org.bukkit.entity.Sheep; import org.bukkit.entity.Skeleton; import org.bukkit.entity.Wither; import org.bukkit.entity.Wolf; import org.bukkit.entity.Zombie; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.ShapedRecipe; import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.map.MapRenderer; import org.bukkit.map.MapView; import org.bukkit.material.MaterialData; import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.ServicesManager; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitScheduler; import org.bukkit.scoreboard.Team; import org.bukkit.util.Vector; import org.bukkit.enchantments.Enchantment; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import sig.ItemSets.ColorSet; import sig.ItemSets.ItemSet; import sig.ItemSets.ItemSetList; import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.bukkit.BukkitWorld; import com.sk89q.worldedit.data.DataException; import com.sk89q.worldedit.schematic.SchematicFormat; public class Main extends JavaPlugin { public final Logger logger = Logger.getLogger("Minecraft"); public static Economy economy = null; public ItemStack[] spleef_inventory_a,spleef_inventory_b; public ItemStack[] spleef4_inventory_a,spleef4_inventory_b,spleef4_inventory_c,spleef4_inventory_d; public ItemStack store_shovel=null; public double spleef_last_broken_block; public double spleef4_last_broken_block; public boolean turnedon=false; public long last_world_time=0; public long hold_diff=0; public long accumulator=0; public long last_mob_random_time=0; public long last_lightning_random_time=0; public long last_lava_dump_time=0; public long last_check_mob_time=0; public long last_spawner_check_time=0; public long last_bank_deposit_use_time=0; public String last_bank_deposit_user=""; public long last_bank_withdraw_use_time=0; public String last_bank_withdraw_user=""; public long last_boss_dungeon_time=0; public long last_player_death_time=0; public long last_sight_check_time=0; public long check_nether_time=0; public long check_lights_time=0; public long check_spleef_game=0; public boolean harrowing_night=false; public double randomitemchance = 800; public static long SERVER_TICK_TIME = 0; public int REVIVE_EFFECT=0; public Location REVIVE_EFFECT_LOC; public int BOSS_DEFEAT=0; public Location BOSS_DEFEAT_LOC; public int POLYMORPH=0; public Location POLYMORPH_LOC; public int LOGGING_UPDATE_COUNTS=-1; public int MAX_LOGGING_COUNT=12; public List LOGGING_LOGS; public boolean cleaned=false; public JobsDataInfo Woodcutter_job = new JobsDataInfo(); public JobsDataInfo Builder_job = new JobsDataInfo(); public JobsDataInfo Miner_job = new JobsDataInfo(); public JobsDataInfo Digger_job = new JobsDataInfo(); public JobsDataInfo Farmer_job = new JobsDataInfo(); public JobsDataInfo Hunter_job = new JobsDataInfo(); public JobsDataInfo Fisherman_job = new JobsDataInfo(); public JobsDataInfo Weaponsmith_job = new JobsDataInfo(); public JobsDataInfo Blacksmith_job = new JobsDataInfo(); public JobsDataInfo Cook_job = new JobsDataInfo(); public JobsDataInfo Brewer_job = new JobsDataInfo(); public JobsDataInfo Enchanter_job = new JobsDataInfo(); public JobsDataInfo Breeder_job = new JobsDataInfo(); public JobsDataInfo Explorer_job = new JobsDataInfo(); public JobsDataInfo Support_job = new JobsDataInfo(); public List jukeboxlist = null; public List furnacelist = null; public List brewingstandlist = null; public List animallist = null; public List explorerlist = null; public List supportstackslist = null; public List supportmoblist = null; public List hitmoblist = null; public List SPEED_CONTROL = null; public List supportplayers = null; public List hunterplayers = null; public List explorers = null; public List ARROW_SHOOTERS = null; public List TEMP_WEBS = null; public List TEMP_BLOCKS = null; public List playerdata_list = null; public List ninjavisible_list = null; public List revive_inventory_list = null; public List chunk_queue_list = null; public static List recycling_center_list = null; public DamageAPI DMGCALC = null; public long lastMessage = 0; public static ItemSetList ItemSetList = null; public FileWriter outputStream = null; public EnchantLevelDatabase ENCHANTMENT_DATA; File f; public Material[] RARE_BLOCKS = {Material.BEACON,Material.ANVIL,Material.ACTIVATOR_RAIL,Material.BEDROCK,Material.BOOKSHELF,Material.DAYLIGHT_DETECTOR,Material.COAL_ORE,Material.CLAY,Material.DIAMOND_ORE,Material.IRON_ORE,Material.REDSTONE_ORE,Material.EMERALD_ORE,Material.GOLD_ORE,Material.LAPIS_ORE,Material.OBSIDIAN,Material.MOSSY_COBBLESTONE,Material.MOB_SPAWNER,Material.NETHER_BRICK,Material.NETHER_FENCE,Material.JUKEBOX,Material.QUARTZ_ORE,Material.PORTAL,Material.PISTON_BASE,Material.REDSTONE_WIRE,Material.DISPENSER,Material.LOG,Material.MYCEL,Material.HUGE_MUSHROOM_1,Material.HUGE_MUSHROOM_2}; long GLOBAL_villagetimer=0,GLOBAL_templetimer=0,GLOBAL_cavetimer=0,GLOBAL_undergroundtimer=0,GLOBAL_nethertimer=0; public String[] ValidJobs = {"Woodcutter","Miner","Builder","Digger","Hunter","Fisherman","Weaponsmith","Blacksmith","Cook","Brewer","Enchanter","Breeder","Explorer","Support"}; public ChatColor[] JobColors = {ChatColor.GREEN,ChatColor.GRAY,ChatColor.WHITE,ChatColor.GOLD,ChatColor.RED,ChatColor.AQUA,ChatColor.DARK_PURPLE,ChatColor.GOLD, ChatColor.YELLOW,ChatColor.LIGHT_PURPLE,ChatColor.DARK_BLUE,ChatColor.DARK_GREEN,ChatColor.WHITE,ChatColor.DARK_RED}; private FileConfiguration accountsConfig = null; private File accountsConfigFile = null; public final PlayerListener pl = new PlayerListener(this); String pluginPrefix = ChatColor.DARK_GREEN+"[BankEconomy]"; public double Warning(LivingEntity l,int id) { double hp = l.getHealth(); if (hp>65) { //Bukkit.broadcastMessage("HP too high for ID "+id+". Removing entity "+l.getType().getName()+" with "+hp+" health."); l.remove(); } return hp; } public double Warning(double hp,int id) { if (hp>65) { //Bukkit.broadcastMessage("Main: HP too high for ID "+id+". HP was "+hp); } return hp; } public void onEnable() { getServer().getPluginManager().registerEvents(this.pl, this); cleaned=false; if (Bukkit.getPluginManager().isPluginEnabled("MCTowns")) { Bukkit.getLogger().info("MCTowns loaded."); } PluginDescriptionFile pdf = getDescription(); System.out.println("[" + getDescription().getName() + "] Status: Activated (mb: kaZep)"); System.out.println("[" + getDescription().getName() + "] PayDay: " + getConfig().getBoolean("payday.enabled")); System.out.println("[" + getDescription().getName() + "] Version: " + pdf.getVersion()); getCommand("bankeconomy").setExecutor(new commandBankEconomy(this)); getCommand("revive").setExecutor(new commandBankEconomy(this)); getCommand("tele").setExecutor(new commandBankEconomy(this)); getCommand("jobs").setExecutor(new commandBankEconomy(this)); getCommand("unenchant").setExecutor(new commandBankEconomy(this)); getCommand("sp").setExecutor(new commandBankEconomy(this)); getCommand("transfer").setExecutor(new commandBankEconomy(this)); getCommand("settings").setExecutor(new commandBankEconomy(this)); getCommand("maintenance").setExecutor(new commandBankEconomy(this)); getCommand("event").setExecutor(new commandBankEconomy(this)); //getCommand("dungeon").setExecutor(new commandBankEconomy(this)); getCommand("ticktime").setExecutor(new commandBankEconomy(this)); getCommand("line").setExecutor(new commandBankEconomy(this)); getCommand("rectangle").setExecutor(new commandBankEconomy(this)); setupEconomy(); getConfig().options().copyDefaults(true); getConfig().addDefault("start-balance", Integer.valueOf(0)); getConfig().addDefault("payday.enabled", Boolean.valueOf(false)); getConfig().addDefault("payday.time", Integer.valueOf(60)); getConfig().addDefault("payday.amount", Integer.valueOf(0)); getConfig().addDefault("fed.mobs", String.valueOf("")); getConfig().addDefault("maintenance-mode", Boolean.valueOf(false)); getConfig().addDefault("halloween-enabled", Boolean.valueOf(false)); getConfig().addDefault("thanksgiving-enabled", Boolean.valueOf(false)); getConfig().addDefault("item-cube-numb", Integer.valueOf(0)); getConfig().addDefault("server-tick-time", Long.valueOf(143000000l)); saveConfig(); SERVER_TICK_TIME = getConfig().getLong("server-tick-time"); getAccountsConfig().options().copyDefaults(true); //saveAccountsConfig() //Commented out; getConfig().set("spleefrequestatime", Integer.valueOf(0)); getConfig().set("spleefrequestbtime", Integer.valueOf(0)); getConfig().set("spleeflastrequesttime", Integer.valueOf(0)); getConfig().set("spleef4insession", Boolean.valueOf(false)); getConfig().set("spleefinsession", Boolean.valueOf(false)); jukeboxlist = new ArrayList(); furnacelist = new ArrayList(); brewingstandlist = new ArrayList(); animallist = new ArrayList(); explorerlist = new ArrayList(); supportstackslist = new ArrayList(); supportmoblist = new ArrayList(); hitmoblist = new ArrayList(); ENCHANTMENT_DATA = new EnchantLevelDatabase(); SPEED_CONTROL = new ArrayList(); supportplayers = new ArrayList(); hunterplayers = new ArrayList(); explorers = new ArrayList(); LOGGING_LOGS = new ArrayList(); ARROW_SHOOTERS = new ArrayList(); TEMP_WEBS = new ArrayList(); TEMP_BLOCKS = new ArrayList(); playerdata_list = new ArrayList(); ninjavisible_list = new ArrayList(); revive_inventory_list = new ArrayList(); chunk_queue_list = new ArrayList(); recycling_center_list = new ArrayList(); //Add in Twoside Recycling Center. RecyclingCenterNode Twoside_recycling_center = new RecyclingCenterNode(this); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1617, 67, -351)); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1618, 67, -351)); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1617, 67, -355)); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1618, 67, -355)); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1622, 67, -355)); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1623, 67, -355)); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1622, 67, -351)); Twoside_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1623, 67, -351)); recycling_center_list.add(Twoside_recycling_center); //Add in Sarayn Recycling Center. RecyclingCenterNode Sarayn_recycling_center = new RecyclingCenterNode(this); Sarayn_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1540, 57, 154)); Sarayn_recycling_center.addChest(new Location(Bukkit.getWorld("world"), 1541, 57, 154)); recycling_center_list.add(Sarayn_recycling_center); //Add Recipe for melon slice crafting. ShapedRecipe melon_slice = new ShapedRecipe(new ItemStack(Material.MELON, 8)); melon_slice.shape("a"); melon_slice.setIngredient('a', Material.MELON_BLOCK); Bukkit.addRecipe(melon_slice); //Add Recipe for nether star crafting. ShapedRecipe nether_star = new ShapedRecipe(new ItemStack(Material.NETHER_STAR, 2)); nether_star.shape("aaa", "bbb", "cbd"); nether_star.setIngredient('a', new MaterialData(Material.SKULL_ITEM, (byte) 1)); nether_star.setIngredient('b', Material.SOUL_SAND); nether_star.setIngredient('c', Material.NETHER_STAR); nether_star.setIngredient('d', Material.DIAMOND); Bukkit.addRecipe(nether_star); //Add Recipe for water source crafting. ItemStack water = new ItemStack(Material.WATER, 8); ItemMeta water_name = water.getItemMeta(); List waterlore = new ArrayList(); waterlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Infused with the power of a"); waterlore.add(ChatColor.AQUA+"Nether Star"+ChatColor.GRAY+""+ChatColor.ITALIC+", this water can"); waterlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"be carried without a bucket,"); waterlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"and does not evaporate when"); waterlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"placed in the Nether."); water_name.setLore(waterlore); water_name.setDisplayName(ChatColor.AQUA+"Enchanted Water"); water.setItemMeta(water_name); ShapedRecipe nether_water = new ShapedRecipe(water); nether_water.shape("aaa", "aba", "aaa"); nether_water.setIngredient('a', Material.WATER_BUCKET); nether_water.setIngredient('b', Material.NETHER_STAR); Bukkit.addRecipe(nether_water); //Add Battle Shovel recipe. ItemStack shovel = new ItemStack(Material.WOOD_SPADE); ItemMeta shovel_meta = shovel.getItemMeta(); List shovel_meta_lore = new ArrayList(); shovel_meta_lore.add(ChatColor.GOLD+"Whenever this shovel destroys"); shovel_meta_lore.add(ChatColor.GOLD+"a block, it releases 20 arrows"); shovel_meta_lore.add(ChatColor.GOLD+"that fire in the destructing"); shovel_meta_lore.add(ChatColor.GOLD+"player's facing direction."); shovel_meta.setLore(shovel_meta_lore); shovel_meta.setDisplayName(ChatColor.RED+"Battle Shovel"); shovel.setItemMeta(shovel_meta); shovel.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1); ShapedRecipe battle_shovel = new ShapedRecipe(shovel); battle_shovel.shape("-a-","-b-","-b-"); battle_shovel.setIngredient('a', Material.LAPIS_BLOCK); battle_shovel.setIngredient('b', Material.STICK); Bukkit.addRecipe(battle_shovel); //Add Recipe for orb of distortion ItemStack orb = new ItemStack(Material.SLIME_BALL, 1); ItemMeta orb_name = orb.getItemMeta(); List orblore = new ArrayList(); orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"This orb distorts space-time"); orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"around it, preventing anyone"); orblore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"from teleporting to its carrier."); orb_name.setLore(orblore); orb_name.setDisplayName(ChatColor.AQUA+"Orb of Distortion"); orb.setItemMeta(orb_name); orb.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1); ShapedRecipe distortion_orb = new ShapedRecipe(orb); distortion_orb.shape("aaa", "aba", "aaa"); distortion_orb.setIngredient('a', Material.ENDER_PEARL); distortion_orb.setIngredient('b', Material.ENDER_STONE); Bukkit.addRecipe(distortion_orb); //Add Recipe for rose of distortion ItemStack rose = new ItemStack(Material.RED_ROSE, 1); ItemMeta rose_name = rose.getItemMeta(); List roselore = new ArrayList(); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"This flower is infused with"); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"overwhelming magical power,"); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"causing it to never wilt."); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"The holder of this flower"); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"will also be resistant to"); roselore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"any "+ChatColor.RESET+"WITHER"+ChatColor.GRAY+""+ChatColor.ITALIC+" effects."); rose_name.setLore(roselore); rose_name.setDisplayName(ChatColor.AQUA+"Unwilting Flower"); rose.setItemMeta(rose_name); rose.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 1); ShapedRecipe witherless_rose = new ShapedRecipe(rose); witherless_rose.shape(" a ", "aba", " a "); witherless_rose.setIngredient('a', Material.NETHER_STAR); witherless_rose.setIngredient('b', Material.RED_ROSE); Bukkit.addRecipe(witherless_rose); //Add Recipe for pocket crafting table ItemStack table = new ItemStack(Material.WORKBENCH); ItemMeta table_name = table.getItemMeta(); table_name.setDisplayName(ChatColor.YELLOW+"Pocket Crafting Table"); List tablelore = new ArrayList(); tablelore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"This workbench can be"); tablelore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"used anywhere! Simply"); tablelore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"right click to open its"); tablelore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"crafting interface."); table_name.setLore(tablelore); table.setItemMeta(table_name); ShapelessRecipe portable_table = new ShapelessRecipe(table); portable_table.addIngredient(Material.WORKBENCH); portable_table.addIngredient(Material.CHEST); portable_table.addIngredient(Material.IRON_AXE); Bukkit.addRecipe(portable_table); //Add wood slab recombining recipes. ShapedRecipe oak_planks = new ShapedRecipe(new ItemStack(Material.WOOD, 1, (short) 0)); oak_planks.shape("aa"); oak_planks.setIngredient('a', new ItemStack(Material.WOOD_STEP, 1, (short) 0).getData()); Bukkit.addRecipe(oak_planks); ShapedRecipe spruce_planks = new ShapedRecipe(new ItemStack(Material.WOOD, 1, (short) 1)); spruce_planks.shape("aa"); spruce_planks.setIngredient('a', new ItemStack(Material.WOOD_STEP, 1, (short) 1).getData()); Bukkit.addRecipe(spruce_planks); ShapedRecipe birch_planks = new ShapedRecipe(new ItemStack(Material.WOOD, 1, (short) 2)); birch_planks.shape("aa"); birch_planks.setIngredient('a', new ItemStack(Material.WOOD_STEP, 1, (short) 2).getData()); Bukkit.addRecipe(birch_planks); ShapedRecipe jungle_planks = new ShapedRecipe(new ItemStack(Material.WOOD, 1, (short) 3)); jungle_planks.shape("aa"); jungle_planks.setIngredient('a', new ItemStack(Material.WOOD_STEP, 1, (short) 3).getData()); Bukkit.addRecipe(jungle_planks); //Add non-wood slab recombining recipes. ShapedRecipe stone = new ShapedRecipe(new ItemStack(Material.STONE, 1)); stone.shape("aa"); stone.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 0).getData()); Bukkit.addRecipe(stone); ShapedRecipe sandstone = new ShapedRecipe(new ItemStack(Material.SANDSTONE, 1)); sandstone.shape("aa"); sandstone.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 1).getData()); Bukkit.addRecipe(sandstone); ShapedRecipe cobblestone = new ShapedRecipe(new ItemStack(Material.COBBLESTONE, 1)); cobblestone.shape("aa"); cobblestone.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 3).getData()); Bukkit.addRecipe(cobblestone); ShapedRecipe bricks = new ShapedRecipe(new ItemStack(Material.BRICK, 1)); bricks.shape("aa"); bricks.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 4).getData()); Bukkit.addRecipe(bricks); ShapedRecipe stone_bricks = new ShapedRecipe(new ItemStack(Material.SMOOTH_BRICK, 1)); stone_bricks.shape("aa"); stone_bricks.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 5).getData()); Bukkit.addRecipe(stone_bricks); ShapedRecipe nether_bricks = new ShapedRecipe(new ItemStack(Material.NETHER_BRICK, 1)); nether_bricks.shape("aa"); nether_bricks.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 6).getData()); Bukkit.addRecipe(nether_bricks); ShapedRecipe nether_quartz = new ShapedRecipe(new ItemStack(Material.QUARTZ_BLOCK, 1)); nether_quartz.shape("aa"); nether_quartz.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 7).getData()); Bukkit.addRecipe(nether_quartz); //Add Recipes for chain armor crafting. ShapedRecipe chain_helmet = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_HELMET)); chain_helmet.shape("aaa","b b"); chain_helmet.setIngredient('a', Material.IRON_BLOCK); chain_helmet.setIngredient('b', Material.IRON_INGOT); Bukkit.addRecipe(chain_helmet); ShapedRecipe chain_chestplate = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_CHESTPLATE)); chain_chestplate.shape("b b","aba","aaa"); chain_chestplate.setIngredient('a', Material.IRON_BLOCK); chain_chestplate.setIngredient('b', Material.IRON_INGOT); Bukkit.addRecipe(chain_chestplate); ShapedRecipe chain_leggings = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_LEGGINGS)); chain_leggings.shape("bbb","a a","a a"); chain_leggings.setIngredient('a', Material.IRON_BLOCK); chain_leggings.setIngredient('b', Material.IRON_INGOT); Bukkit.addRecipe(chain_leggings); ShapedRecipe chain_boots = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_BOOTS)); chain_boots.shape("b b","a a"); chain_boots.setIngredient('a', Material.IRON_BLOCK); chain_boots.setIngredient('b', Material.IRON_INGOT); Bukkit.addRecipe(chain_boots); //Add Recipes for new Block armor crafting. ShapedRecipe iron_helmet = new ShapedRecipe(new ItemStack(Material.IRON_HELMET)); iron_helmet.shape("aaa","a a"); iron_helmet.setIngredient('a', Material.IRON_BLOCK); Bukkit.addRecipe(iron_helmet); ShapedRecipe iron_chestplate = new ShapedRecipe(new ItemStack(Material.IRON_CHESTPLATE)); iron_chestplate.shape("a a","aaa","aaa"); iron_chestplate.setIngredient('a', Material.IRON_BLOCK); Bukkit.addRecipe(iron_chestplate); ShapedRecipe iron_leggings = new ShapedRecipe(new ItemStack(Material.IRON_LEGGINGS)); iron_leggings.shape("aaa","a a","a a"); iron_leggings.setIngredient('a', Material.IRON_BLOCK); Bukkit.addRecipe(iron_leggings); ShapedRecipe iron_boots = new ShapedRecipe(new ItemStack(Material.IRON_BOOTS)); iron_boots.shape("a a","a a"); iron_boots.setIngredient('a', Material.IRON_BLOCK); Bukkit.addRecipe(iron_boots); ShapedRecipe gold_helmet = new ShapedRecipe(new ItemStack(Material.GOLD_HELMET)); gold_helmet.shape("aaa","a a"); gold_helmet.setIngredient('a', Material.GOLD_BLOCK); Bukkit.addRecipe(gold_helmet); ShapedRecipe gold_chestplate = new ShapedRecipe(new ItemStack(Material.GOLD_CHESTPLATE)); gold_chestplate.shape("a a","aaa","aaa"); gold_chestplate.setIngredient('a', Material.GOLD_BLOCK); Bukkit.addRecipe(gold_chestplate); ShapedRecipe gold_leggings = new ShapedRecipe(new ItemStack(Material.GOLD_LEGGINGS)); gold_leggings.shape("aaa","a a","a a"); gold_leggings.setIngredient('a', Material.GOLD_BLOCK); Bukkit.addRecipe(gold_leggings); ShapedRecipe gold_boots = new ShapedRecipe(new ItemStack(Material.GOLD_BOOTS)); gold_boots.shape("a a","a a"); gold_boots.setIngredient('a', Material.GOLD_BLOCK); Bukkit.addRecipe(gold_boots); ShapedRecipe diamond_helmet = new ShapedRecipe(new ItemStack(Material.DIAMOND_HELMET)); diamond_helmet.shape("aaa","a a"); diamond_helmet.setIngredient('a', Material.DIAMOND_BLOCK); Bukkit.addRecipe(diamond_helmet); ShapedRecipe diamond_chestplate = new ShapedRecipe(new ItemStack(Material.DIAMOND_CHESTPLATE)); diamond_chestplate.shape("a a","aaa","aaa"); diamond_chestplate.setIngredient('a', Material.DIAMOND_BLOCK); Bukkit.addRecipe(diamond_chestplate); ShapedRecipe diamond_leggings = new ShapedRecipe(new ItemStack(Material.DIAMOND_LEGGINGS)); diamond_leggings.shape("aaa","a a","a a"); diamond_leggings.setIngredient('a', Material.DIAMOND_BLOCK); Bukkit.addRecipe(diamond_leggings); ShapedRecipe diamond_boots = new ShapedRecipe(new ItemStack(Material.DIAMOND_BOOTS)); diamond_boots.shape("a a","a a"); diamond_boots.setIngredient('a', Material.DIAMOND_BLOCK); Bukkit.addRecipe(diamond_boots); // Add Recipe for fireproof Wooden Slab ItemStack slab = new ItemStack(Material.STEP, 3, (short) 2); ItemMeta slab_name = slab.getItemMeta(); slab_name.setDisplayName(ChatColor.RESET+"Fireproof Wood Slab"); slab.setItemMeta(slab_name); ShapedRecipe fireproof_wood_slab = new ShapedRecipe(slab); fireproof_wood_slab.shape(" a ","bbb"); fireproof_wood_slab.setIngredient('a', Material.SLIME_BALL); fireproof_wood_slab.setIngredient('b', Material.WOOD_STEP); Bukkit.addRecipe(fireproof_wood_slab); // Add high efficiency recipes for wool // White ShapedRecipe woolRecipe; for (int i = 0; i < 16; i++) { woolRecipe = new ShapedRecipe(new ItemStack(Material.WOOL, 8, (short) i)); woolRecipe.shape("aaa","aba", "aaa"); woolRecipe.setIngredient('a', Material.WOOL); woolRecipe.setIngredient('b', new MaterialData(Material.INK_SACK, (byte) (15 - i))); Bukkit.addRecipe(woolRecipe); } // Add Recipes for Item cube crafting. ItemStack temp = new ItemStack(Material.CHEST); ItemMeta tempmeta = temp.getItemMeta(); tempmeta.setDisplayName(ChatColor.YELLOW+"Item Cube"); List templore = new ArrayList(); templore.add(ChatColor.AQUA+"Contains 9 item slots."); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Click on an item and then"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"click the Item Cube to store"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"it inside. Right-Click the"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Item Cube to view its contents."); tempmeta.setLore(templore); temp.setItemMeta(tempmeta); ShapedRecipe item_cube = new ShapedRecipe(temp); item_cube.shape("aaa","aba","aaa"); item_cube.setIngredient('a', Material.CHEST); item_cube.setIngredient('b', Material.HOPPER); Bukkit.addRecipe(item_cube); temp = new ItemStack(Material.TRAPPED_CHEST); tempmeta = temp.getItemMeta(); tempmeta.setDisplayName(ChatColor.LIGHT_PURPLE+"Large Item Cube"); templore = new ArrayList(); templore.add(ChatColor.AQUA+"Contains 54 item slots."); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Click on an item and then"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"click the Item Cube to store"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"it inside. Right-Click the"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Item Cube to view its contents."); tempmeta.setLore(templore); temp.setItemMeta(tempmeta); item_cube = new ShapedRecipe(temp); item_cube.shape("cac","aba","cac"); item_cube.setIngredient('a', Material.ENDER_CHEST); item_cube.setIngredient('b', Material.HOPPER); item_cube.setIngredient('c', Material.DIAMOND_BLOCK); Bukkit.addRecipe(item_cube); temp = new ItemStack(Material.ENDER_CHEST); tempmeta = temp.getItemMeta(); tempmeta.setDisplayName(ChatColor.BLUE+"Ender Item Cube"); templore = new ArrayList(); templore.add(ChatColor.AQUA+"Contains 27 item slots."); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Click on an item and then"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"click the Item Cube to store"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"it inside. Right-Click the"); templore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Item Cube to view its contents."); tempmeta.setLore(templore); temp.setItemMeta(tempmeta); item_cube = new ShapedRecipe(temp); item_cube.shape("cac","aba","cac"); item_cube.setIngredient('a', Material.ENDER_CHEST); item_cube.setIngredient('b', Material.HOPPER); item_cube.setIngredient('c', Material.EMERALD_BLOCK); Bukkit.addRecipe(item_cube); ShapelessRecipe artifact_clay = new ShapelessRecipe(new ItemStack(Material.CLAY_BALL)); artifact_clay.addIngredient(Material.CLAY_BALL); artifact_clay.addIngredient(Material.EYE_OF_ENDER); Bukkit.addRecipe(artifact_clay); //Add deconversion recipes. ShapelessRecipe DeConv_diamond_chestplate = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_chestplate.addIngredient(Material.DIAMOND_CHESTPLATE); ShapelessRecipe DeConv_iron_chestplate = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_chestplate.addIngredient(Material.IRON_CHESTPLATE); ShapelessRecipe DeConv_gold_chestplate = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_chestplate.addIngredient(Material.GOLD_CHESTPLATE); ShapelessRecipe DeConv_chainmail_chestplate = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_chainmail_chestplate.addIngredient(Material.CHAINMAIL_CHESTPLATE); ShapelessRecipe DeConv_diamond_helmet = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_helmet.addIngredient(Material.DIAMOND_HELMET); ShapelessRecipe DeConv_iron_helmet = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_helmet.addIngredient(Material.IRON_HELMET); ShapelessRecipe DeConv_gold_helmet = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_helmet.addIngredient(Material.GOLD_HELMET); ShapelessRecipe DeConv_chainmail_helmet = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_chainmail_helmet.addIngredient(Material.CHAINMAIL_HELMET); ShapelessRecipe DeConv_diamond_leggings = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_leggings.addIngredient(Material.DIAMOND_LEGGINGS); ShapelessRecipe DeConv_iron_leggings = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_leggings.addIngredient(Material.IRON_LEGGINGS); ShapelessRecipe DeConv_gold_leggings = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_leggings.addIngredient(Material.GOLD_LEGGINGS); ShapelessRecipe DeConv_chainmail_leggings = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_chainmail_leggings.addIngredient(Material.CHAINMAIL_LEGGINGS); ShapelessRecipe DeConv_diamond_boots = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_boots.addIngredient(Material.DIAMOND_BOOTS); ShapelessRecipe DeConv_iron_boots = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_boots.addIngredient(Material.IRON_BOOTS); ShapelessRecipe DeConv_gold_boots = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_boots.addIngredient(Material.GOLD_BOOTS); ShapelessRecipe DeConv_chainmail_boots = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_chainmail_boots.addIngredient(Material.CHAINMAIL_BOOTS); ShapelessRecipe DeConv_diamond_pickaxe = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_pickaxe.addIngredient(Material.DIAMOND_PICKAXE); ShapelessRecipe DeConv_iron_pickaxe = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_pickaxe.addIngredient(Material.IRON_PICKAXE); ShapelessRecipe DeConv_gold_pickaxe = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_pickaxe.addIngredient(Material.GOLD_PICKAXE); ShapelessRecipe DeConv_stone_pickaxe = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); DeConv_stone_pickaxe.addIngredient(Material.STONE_PICKAXE); ShapelessRecipe DeConv_diamond_spade = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_spade.addIngredient(Material.DIAMOND_SPADE); ShapelessRecipe DeConv_iron_spade = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_spade.addIngredient(Material.IRON_SPADE); ShapelessRecipe DeConv_gold_spade = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_spade.addIngredient(Material.GOLD_SPADE); ShapelessRecipe DeConv_stone_spade = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); DeConv_stone_spade.addIngredient(Material.STONE_SPADE); ShapelessRecipe DeConv_diamond_axe = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_axe.addIngredient(Material.DIAMOND_AXE); ShapelessRecipe DeConv_iron_axe = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_axe.addIngredient(Material.IRON_AXE); ShapelessRecipe DeConv_gold_axe = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_axe.addIngredient(Material.GOLD_AXE); ShapelessRecipe DeConv_stone_axe = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); DeConv_stone_axe.addIngredient(Material.STONE_AXE); ShapelessRecipe DeConv_diamond_hoe = new ShapelessRecipe(new ItemStack(Material.DIAMOND)); DeConv_diamond_hoe.addIngredient(Material.DIAMOND_HOE); ShapelessRecipe DeConv_iron_hoe = new ShapelessRecipe(new ItemStack(Material.IRON_INGOT)); DeConv_iron_hoe.addIngredient(Material.IRON_HOE); ShapelessRecipe DeConv_gold_hoe = new ShapelessRecipe(new ItemStack(Material.GOLD_INGOT)); DeConv_gold_hoe.addIngredient(Material.GOLD_HOE); ShapelessRecipe DeConv_stone_hoe = new ShapelessRecipe(new ItemStack(Material.COBBLESTONE)); DeConv_stone_hoe.addIngredient(Material.STONE_HOE); Bukkit.addRecipe(DeConv_diamond_chestplate); Bukkit.addRecipe(DeConv_iron_chestplate); Bukkit.addRecipe(DeConv_gold_chestplate); Bukkit.addRecipe(DeConv_chainmail_chestplate); Bukkit.addRecipe(DeConv_diamond_leggings); Bukkit.addRecipe(DeConv_iron_leggings); Bukkit.addRecipe(DeConv_gold_leggings); Bukkit.addRecipe(DeConv_chainmail_leggings); Bukkit.addRecipe(DeConv_diamond_helmet); Bukkit.addRecipe(DeConv_iron_helmet); Bukkit.addRecipe(DeConv_gold_helmet); Bukkit.addRecipe(DeConv_chainmail_helmet); Bukkit.addRecipe(DeConv_diamond_boots); Bukkit.addRecipe(DeConv_iron_boots); Bukkit.addRecipe(DeConv_gold_boots); Bukkit.addRecipe(DeConv_chainmail_boots); Bukkit.addRecipe(DeConv_diamond_axe); Bukkit.addRecipe(DeConv_iron_axe); Bukkit.addRecipe(DeConv_gold_axe); Bukkit.addRecipe(DeConv_stone_axe); Bukkit.addRecipe(DeConv_diamond_pickaxe); Bukkit.addRecipe(DeConv_iron_pickaxe); Bukkit.addRecipe(DeConv_gold_pickaxe); Bukkit.addRecipe(DeConv_stone_pickaxe); Bukkit.addRecipe(DeConv_diamond_hoe); Bukkit.addRecipe(DeConv_iron_hoe); Bukkit.addRecipe(DeConv_gold_hoe); Bukkit.addRecipe(DeConv_stone_hoe); Bukkit.addRecipe(DeConv_diamond_spade); Bukkit.addRecipe(DeConv_iron_spade); Bukkit.addRecipe(DeConv_gold_spade); Bukkit.addRecipe(DeConv_stone_spade); ItemSetList = new ItemSetList(); ItemSetList.Init(); //Create a list of item sets. ItemSet set = new ItemSet("Acrobat",new ColorSet( Color.fromRGB(149, 193, 149), Color.fromRGB(133, 184, 133), Color.fromRGB(133, 184, 159), Color.fromRGB(159, 184, 133)), "Thin and light armor made for\n" + "nimble and precise movement.", "When getting hit, you will gain\n" + "40% movement speed.", "Every 20% of bonus movement speed\n" + "gives you 10% block chance.", "When jumping, you cannot be hit."); ItemSetList.addSet(set); DMGCALC = new DamageAPI(); //System.out.println("Running BankEconomy in "+this.getDataFolder().getAbsolutePath()); //System.out.println("File size: "+f.length()); checkJukeboxes(); updateTime(); runTick(); if (!getConfig().getBoolean("payday.enabled")) return; if (getConfig().getBoolean("payday.enabled")) { payDay(getConfig().getInt("payday.time")); } else { System.out.println("[BANKECONOMY ALERT] Error caused at 'payday.enabled'. Changed boolean to false."); getConfig().set("payday.enabled", Boolean.valueOf(false)); saveConfig(); } try { Metrics metrics = new Metrics(this); metrics.start(); } catch (IOException e) { System.out.println("[WARNING] " + getDescription().getName() + " didn't connect to McStats.org ! Please check your metrics settings."); } Woodcutter_job.setJobName("Woodcutter"); Woodcutter_job.setJobDescription("A woodcutter's job is to cut down and replenish the supplies of trees constantly in order to keep getting income."); Woodcutter_job.setAction(0, "BREAK"); Woodcutter_job.setExp(40, 10, 20, 1.03); Woodcutter_job.addData("WOOD", 0.01, 1, 0); Woodcutter_job.addData("WOOD W/ AXE", 0.025, 2, 0); Woodcutter_job.setAction(1, "PLACE"); Woodcutter_job.addData("SAPLINGS", 0.015, 1, 1); Woodcutter_job.addData("WOOD", 0.01, 0.25, 1); Woodcutter_job.addData("WOODEN PLANK", 0.00, 0.10, 1); Woodcutter_job.setBuffData("Leaves break instantly.", "Crafting planks gives 6 planks per wood instead of 4.", "Apples have a x4 higher rate of dropping from leaves. Breaking wood gives a Jump boost buff that lasts for 10 seconds. Axes last 200% longer.", "Axes you use will never break. Making them viable weapons as well.", "Crafting planks gives 10 planks per wood instead of 4. Saplings placed down will instantly grow trees.", "Cuts down a whole tree with one whack. Crafting planks gives 20 planks per wood. Each time you cut down a tree, you get a 4 HP boost (stacks) that lasts for one minute."); Miner_job.setJobName("Miner"); Miner_job.setJobDescription("A miner's job is to venture into caves and collect precious minerals from within, eventually coming out with such treasures for use in other production."); Miner_job.setAction(0, "BREAK"); Miner_job.setExp(60, 100, 65, 1.02); Miner_job.addData("STONE", 0.0025, 1, 0); Miner_job.addData("NETHERRACK", 0.005, 1, 0); Miner_job.addData("COAL", 0.0125, 3, 0); Miner_job.addData("GLOWSTONE", 0.015, 3, 0); Miner_job.addData("SANDSTONE", 0.015, 4, 0); Miner_job.addData("NETHER BRICK", 0.02, 3, 0); Miner_job.addData("QUARTZ ORE", 0.025, 4, 0); Miner_job.addData("LAPIS LAZULI ORE", 0.03, 5, 0); Miner_job.addData("MOSSY COBBLESTONE", 0.0375, 8, 0); Miner_job.addData("IRON ORE", 0.0375, 6, 0); Miner_job.addData("REDSTONE ORE", 0.05, 9, 0); Miner_job.addData("OBSIDIAN", 0.0625, 10, 0); Miner_job.addData("GOLD ORE", 0.0975, 12, 0); Miner_job.addData("DIAMOND ORE", 0.3125, 60, 0); Miner_job.addData("EMERALD ORE", 0.7625, 160, 0); Miner_job.setBuffData("Automatically mines ores next to each other when one ore is mined.", "Gain Quadruple the experience from mining ores. Pickaxes gain Efficiency III.", "Mining with a diamond pickaxe will mine out 3x3 blocks at a time when using diamond pickaxes. Pickaxes used gain Efficiency VI and Unbreaking IV.", "When holding a pickaxe, mobs that hit you only deal 25% damage.", "Mining blocks will stack a haste buff up to Haste V for 10 seconds.", "Mining ores will grant x2 the normal amount of minerals. Fortune is twice as effective, granting a possible total of x4 the normal minerals from ores."); Builder_job.setJobName("Builder"); Builder_job.setJobDescription("A builder's job is to use blocks in order to create and invent new buildings using materials that look nice."); Builder_job.setAction(0, "PLACE"); Builder_job.setExp(80, 150, 50, 1.02); Builder_job.addData("COBBLESTONE", 0.005, 1, 0); Builder_job.addData("WOODEN PLANK", 0.005, 2, 0); Builder_job.addData("WOOD", 0.01, 3, 0); Builder_job.addData("COBBLESTONE SLAB", 0.015, 3, 0); Builder_job.addData("COBBLESTONE STAIRS", 0.015, 3, 0); Builder_job.addData("STONE", 0.015, 4, 0); Builder_job.addData("WOODEN FENCE", 0.015, 3, 0); Builder_job.addData("WOODEN SLAB", 0.015, 3, 0); Builder_job.addData("STONE SLAB", 0.02, 4, 0); Builder_job.addData("WOODEN STAIRS", 0.02, 4, 0); Builder_job.addData("LAPIS BLOCK", 0.02, 3, 0); Builder_job.addData("SANDSTONE SLAB", 0.025, 4, 0); Builder_job.addData("NETHER BRICK STAIRS", 0.025, 5, 0); Builder_job.addData("NETHER BRICK", 0.03, 5, 0); Builder_job.addData("NETHER BRICK SLAB", 0.03, 5, 0); Builder_job.addData("NETHER BRICK FENCE", 0.03, 6, 0); Builder_job.addData("STONE BRICK SLAB", 0.03, 5, 0); Builder_job.addData("WOOL", 0.035, 7, 0); Builder_job.addData("STONE BRICK STAIRS", 0.04, 8, 0); Builder_job.addData("STONE BRICK", 0.04, 8, 0); Builder_job.addData("GLASS", 0.04, 8, 0); Builder_job.addData("QUARTZ SLAB", 0.05, 9, 0); Builder_job.addData("BRICKS SLAB", 0.05, 9, 0); Builder_job.addData("GLOWSTONE", 0.05, 10, 0); Builder_job.addData("HARDENED CLAY", 0.05, 10, 0); Builder_job.addData("STAINED CLAY", 0.05, 10, 0); Builder_job.addData("SANDSTONE STAIRS", 0.06, 10, 0); Builder_job.addData("SANDSTONE", 0.06, 10, 0); Builder_job.addData("QUARTZ STAIRS", 0.06, 12, 0); Builder_job.addData("BRICK STAIRS", 0.065, 9, 0); Builder_job.addData("QUARTZ BLOCK", 0.07, 14, 0); Builder_job.addData("BRICK", 0.075, 11, 0); Builder_job.setBuffData("Builders gain access to the 'line' tool. Typing /line will make building in straight lines easier.", "Builders gain access to the 'rectangle' tool. Typing /rectangle will make building in rectangles easier.", "When crafting irreversible Builder blocks, 75% of the materials used for crafting will be restored to your inventory. When cooking Builder blocks, the block results will be doubled.", "Gain experience orbs (equivalent to the job XP you get) as you build.", "Building will stack a jump boost buff up to Jump Boost X for 10 seconds.", "Builders gain the ability to fly when building. They immediately lose the ability to fly if they stop building for a moment, destroy a block, or enter combat. Every 100 Builder XP gained gives the Builder 5 Glowstone blocks and a stack of torches."); Digger_job.setJobName("Digger"); Digger_job.setJobDescription("A digger's job is to collect blocks from the ground that are collectible with a shovel. The digger may also convert some blocks to other types for more XP and money."); Digger_job.setAction(0, "BREAK"); Digger_job.setAction(1, "CRAFT"); Digger_job.setAction(2, "SMELT"); Digger_job.setExp(150, 100, 30, 1.02); Digger_job.addData("DIRT", 0.005, 1, 0); Digger_job.addData("GRASS", 0.005, 2, 0); Digger_job.addData("SAND", 0.01, 2, 0); Digger_job.addData("GRAVEL", 0.02, 5, 0); Digger_job.addData("SOUL SAND", 0.04, 8, 0); Digger_job.addData("CLAY", 0.05, 10, 0); Digger_job.addData("SANDSTONE", 0.02, 6, 1); Digger_job.addData("SMOOTH SANDSTONE", 0.02, 6, 1); Digger_job.addData("CHISELED SANDSTONE", 0.025, 7, 1); Digger_job.addData("BRICKS", 0.04, 8, 1); Digger_job.addData("GLASS", 0.015, 3, 2); Digger_job.addData("BRICK", 0.04, 8, 2); Digger_job.addData("HARDENED CLAY", 0.04, 8, 2); Digger_job.setBuffData("Ability to discover artifacts when digging up blocks.", "Shovels gain Unbreaking V and Efficiency IV.", "Destroying the bottom row of Sand or Gravel with a Wooden Shovel will destroy the whole stack instantly. Artifact discovery rate increased by 25%.", "Shovels you use will not break.", "Diggers can craft a Battle Shovel (Use a Lapis block with sticks to build it). Any blocks you destroy with it will shoot 20 arrows rapidly from the destroyed block's position in the direction you are facing.", "Artifacts will have a 100% identify rate."); /* Farmer_job.setJobName("Farmer"); Farmer_job.setJobDescription("A farmer's job is to sustain and continue to replenish what nature provides to turn them into sustainable food items and other useful things."); Farmer_job.setAction(0, "BREAK"); Farmer_job.setAction(1, "PLACE"); Farmer_job.setExp(150, 100, 20, 1.02); Farmer_job.addData("SUGAR CANE", 0.00, 1, 0); Farmer_job.addData("CACTUS", 0.00, 3, 0); Farmer_job.addData("BROWN MUSHROOM", 0.00, 3, 0); Farmer_job.addData("RED MUSHROOM", 0.00, 3, 0); Farmer_job.addData("WHEAT", 0.005, 2, 0); Farmer_job.addData("CARROT", 0.005, 2, 0); Farmer_job.addData("POTATO", 0.015, 3, 0); Farmer_job.addData("NETHER WART", 0.015, 3, 0); //Farmer_job.addData("PUMPKIN SEEDS", 0.02, 4, 0); Farmer_job.addData("PUMPKIN", 0.04, 8, 0); Farmer_job.addData("MELON", 0.05, 10, 0); Farmer_job.addData("SEEDS", 0.0025, 1, 1); Farmer_job.addData("PUMPKIN SEEDS", 0.005, 2, 1); Farmer_job.addData("MELON SEEDS", 0.005, 2, 1); //Farmer_job.addData("PUMPKIN", 0.00, -16, 1); Farmer_job.setBuffData("Hoes do not lose durability when used.", "Killing skeletons yields triple the amount of bones.", "Nearby crops grow 30% faster.", "Nearby crops grow 200% faster. Bonemeal grows things instantly. (Just like before the bonemeal nerf) in one use."); */ Hunter_job.setJobName("Hunter"); Hunter_job.setJobDescription("A hunter's job is to take care of the threats at night and protect others who may be in danger. Hunters that kill innocent creatures will be punished, thus they must resort to other methods for food."); Hunter_job.setAction(0, "HURT"); Hunter_job.setAction(1, "KILL"); Hunter_job.setExp(300, 250, 35, 1.01); Hunter_job.addData("SQUID", 0.00, 1, 0); Hunter_job.addData("SLIME", 0.005, 1, 0); Hunter_job.addData("ZOMBIE", 0.01, 2, 0); Hunter_job.addData("SPIDER", 0.01, 2, 0); Hunter_job.addData("SKELETON", 0.015, 3, 0); Hunter_job.addData("CHARGE ZOMBIE", 0.02, 4, 0); Hunter_job.addData("ZOMBIE NINJA", 0.025, 5, 0); Hunter_job.addData("SNIPER", 0.025, 5, 0); Hunter_job.addData("CREEPER", 0.025, 5, 0); Hunter_job.addData("VENOMOUS SPIDER", 0.025, 5, 0); Hunter_job.addData("SNARING SPIDER", 0.025, 5, 0); Hunter_job.addData("PIG ZOMBIE", 0.03, 6, 0); Hunter_job.addData("EXPLOSIVE CREEPER", 0.035, 7, 0); Hunter_job.addData("DESTRUCTIVE CREEPER", 0.035, 7, 0); Hunter_job.addData("GHAST", 0.04, 8, 0); Hunter_job.addData("ENDERMAN", 0.04, 8, 0); Hunter_job.addData("BLAZE", 0.05, 10, 0); Hunter_job.addData("ENDER DRAGON", 12.50, 250, 0); Hunter_job.addData("WITHER", 22.50, 450, 0); Hunter_job.addData("CHICKEN", 0.00, -2, 0); Hunter_job.addData("SHEEP", 0.00, -3, 0); Hunter_job.addData("PIG", 0.00, -4, 0); Hunter_job.addData("COW", 0.00, -6, 0); Hunter_job.addData("OCELOT", 0.00, -9, 0); Hunter_job.addData("WOLF", 0.00, -12, 0); Hunter_job.addData("MUSHROOM COW", 0.00, -20, 0); Hunter_job.addData("SQUID", 0.00, 0, 1); Hunter_job.addData("SLIME", 0.00, 0, 1); Hunter_job.addData("SPIDER", 0.02, 4, 1); Hunter_job.addData("ZOMBIE", 0.025, 5, 1); Hunter_job.addData("SKELETON", 0.035, 7, 1); Hunter_job.addData("CHARGE ZOMBIE", 0.05, 10, 1); Hunter_job.addData("ZOMBIE NINJA", 0.05, 10, 1); Hunter_job.addData("SNIPER", 0.05, 10, 1); Hunter_job.addData("VENOMOUS SPIDER", 0.05, 10, 1); Hunter_job.addData("SNARING SPIDER", 0.05, 10, 1); Hunter_job.addData("CREEPER", 0.05, 10, 1); Hunter_job.addData("PIG ZOMBIE", 0.08, 16, 1); Hunter_job.addData("EXPLOSIVE CREEPER", 0.08, 16, 1); Hunter_job.addData("DESTRUCTIVE CREEPER", 0.08, 16, 1); Hunter_job.addData("GHAST", 0.10, 12, 1); Hunter_job.addData("ENDERMAN", 0.125, 16, 1); Hunter_job.addData("BLAZE", 0.15, 20, 1); Hunter_job.addData("ENDER DRAGON", 100.00, 3000, 1); Hunter_job.addData("WITHER", 550.00, 7800, 1); Hunter_job.setBuffData("Damage dealt increased by 4.", "Sneaking gives you invisibility. Anything targeting you loses aggro.", "Swords inflict Poison II on mobs for 6 seconds. Movement speed increased by 20%.", "Each time you get hit, the next hit has a 10% increased stacking chance of blocking for 10 seconds. Hitting an enemy removes this buff.", "Attacks deal an additional 10 armor penetration damage.", "Damage dealt increased by 4, damage taken decreased by 30%, at night you are invisible. Health increased by 20."); Fisherman_job.setJobName("Fisherman"); Fisherman_job.setJobDescription("A fisherman's job is to catch fish. And more fish. And cook them."); Fisherman_job.setAction(0, "CATCH"); Fisherman_job.setAction(1, "SMELT"); Fisherman_job.setExp(30, 40, 6, 1.04); Fisherman_job.addData("RAW FISH", 0.175, 3, 0); Fisherman_job.addData("COOKED FISH", 0.125, 2, 1); Fisherman_job.setBuffData("Fishing rods have double the durability.", "Fish give double the exp orbs, two fish can be caught at the same time (25% chance)", "Up to four fish can be caught at one time. Sometimes fish will be automatically cooked. (Will gain exp and money for the cooked ones as well)", "Fish Catching Rate increased by 30%. You will always catch at least two fish (And gain the amount of money and xp earned for them). Fishing rods last 4x as long.", "Each successful catch will increase the fishing catch rate multiplicatively by 5%. Missing a fish will reset this rate.", "Fishing rods do 10 damage when hooking an enemy mob. Fishing rods do not run out of durability. Chance of catching fish increased by 50%. Holding a fishing rod gives the ability to fly for 5 seconds at a time."); Weaponsmith_job.setJobName("Weaponsmith"); Weaponsmith_job.setJobDescription("A weaponsmith's job is to craft weapons for others and themselves."); Weaponsmith_job.setAction(0, "CRAFT"); Weaponsmith_job.setExp(100, 100, 32, 1.05); Weaponsmith_job.addData("ARROW", 0.025, 4, 0); //Weaponsmith_job.addData("WOODEN SWORD", 0.05, 10, 0); Weaponsmith_job.addData("FLINT AND STEEL", 0.06, 12, 0); Weaponsmith_job.addData("BOW", 0.075, 12, 0); Weaponsmith_job.addData("IRON SWORD", 0.375, 75, 0); Weaponsmith_job.addData("GOLD SWORD", 0.50, 100, 0); Weaponsmith_job.addData("DIAMOND SWORD", 3.60, 280, 0); Weaponsmith_job.setBuffData("Crafting Weaponsmith items have a 10% chance of preserving materials used.", "Weapons crafted gain a free level 5 enchantment.", "Crafting Weaponsmith items have a 25% chance of preserving materials used.", "All weaponsmith items crafted gain +X Damage bonus enchantments. (Increases by weaponsmithing level)", "All weaponsmith items crafted gain +2% Lifesteal bonus enchantments. (Increases by 2% every weaponsmithing level after 30.)", "Weapons crafted gain free level 25 enchantments. Materials used in crafting have a 50% chance of being preserved. Weapons crafted have a 30% chance of stacking (duplicated), and 30% chance for every extra addition to the weapon stack."); Blacksmith_job.setJobName("Blacksmith"); Blacksmith_job.setJobDescription("A blacksmith's job is to provide tools, armor, and other crafted materials to others and themselves to protect them."); Blacksmith_job.setAction(0, "CRAFT"); Blacksmith_job.setExp(300, 180, 24, 1.06); //Blacksmith_job.addData("STONE HOE", 0.04, 7, 0); //Blacksmith_job.addData("STONE SHOVEL", 0.05, 8, 0); //Blacksmith_job.addData("STONE PICKAXE", 0.075, 15, 0); Blacksmith_job.addData("LEATHER BOOTS", 0.125, 8, 0); Blacksmith_job.addData("LEATHER CAP", 0.15, 14, 0); Blacksmith_job.addData("LEATHER PANTS", 0.175, 15, 0); Blacksmith_job.addData("LEATHER TUNIC", 0.20, 18, 0); Blacksmith_job.addData("IRON SHOVEL", 0.25, 18, 0); Blacksmith_job.addData("IRON HOE", 0.325, 38, 0); Blacksmith_job.addData("IRON AXE", 0.35, 40, 0); Blacksmith_job.addData("WEAK IRON BOOTS", 0.375, 80, 0); Blacksmith_job.addData("IRON PICKAXE", 0.40, 58, 0); Blacksmith_job.addData("WEAK IRON HELMET", 0.50, 100, 0); Blacksmith_job.addData("GOLDEN SHOVEL", 0.625, 23, 0); Blacksmith_job.addData("GOLDEN HOE", 0.65, 65, 0); Blacksmith_job.addData("GOLDEN AXE", 0.70, 70, 0); Blacksmith_job.addData("WEAK IRON LEGGINGS", 0.725, 140, 0); Blacksmith_job.addData("DIAMOND SHOVEL", 0.75, 90, 0); Blacksmith_job.addData("DIAMOND HOE", 0.8, 188, 0); Blacksmith_job.addData("DIAMOND AXE", 0.81, 196, 0); Blacksmith_job.addData("WEAK GOLDEN BOOTS", 0.825, 120, 0); Blacksmith_job.addData("WEAK IRON CHESTPLATE", 0.875, 175, 0); Blacksmith_job.addData("WEAK GOLDEN HELMET", 0.925, 150, 0); Blacksmith_job.addData("DIAMOND PICKAXE", 0.925, 290, 0); Blacksmith_job.addData("WEAK DIAMOND BOOTS", 1.0, 390, 0); Blacksmith_job.addData("WEAK GOLDEN LEGGINGS", 1.025, 170, 0); Blacksmith_job.addData("WEAK GOLDEN CHESTPLATE", 1.15, 192, 0); Blacksmith_job.addData("WEAK DIAMOND HELMET", 1.15, 480, 0); Blacksmith_job.addData("WEAK DIAMOND LEGGINGS", 1.325, 660, 0); Blacksmith_job.addData("WEAK DIAMOND CHESTPLATE", 1.50, 750, 0); Blacksmith_job.addData("CHAIN BOOTS", 0.375*5, 80*5, 0); Blacksmith_job.addData("CHAIN HELMET", 0.50*5, 100*5, 0); Blacksmith_job.addData("CHAIN LEGGINGS", 0.725*5, 140*5, 0); Blacksmith_job.addData("CHAIN CHESTPLATE", 0.875*5, 175*5, 0); Blacksmith_job.addData("IRON BOOTS", 0.375*10, 80*10, 0); Blacksmith_job.addData("IRON HELMET", 0.50*10, 100*10, 0); Blacksmith_job.addData("IRON LEGGINGS", 0.725*10, 140*10, 0); Blacksmith_job.addData("GOLDEN BOOTS", 0.825*10, 120*10, 0); Blacksmith_job.addData("IRON CHESTPLATE", 0.875*10, 175*10, 0); Blacksmith_job.addData("GOLDEN HELMET", 0.925*10, 150*10, 0); Blacksmith_job.addData("DIAMOND BOOTS", 1.0*10, 390*10, 0); Blacksmith_job.addData("GOLDEN LEGGINGS", 1.025*10, 170*10, 0); Blacksmith_job.addData("GOLDEN CHESTPLATE", 1.15*10, 192*10, 0); Blacksmith_job.addData("DIAMOND HELMET", 1.15*10, 480*10, 0); Blacksmith_job.addData("DIAMOND LEGGINGS", 1.325*10, 660*10, 0); Blacksmith_job.addData("DIAMOND CHESTPLATE", 1.50*10, 750*10, 0); Blacksmith_job.setBuffData("All crafted items are buffed with a Lv5 enchantment.", "All crafted items are buffed with a Lv10 enchantment.", "Crafting Blacksmith items have a 30% chance of preserving materials used.", "All blacksmith items crafted gain +2 Health bonus enchantments. (Increases by +2 per blacksmithing level after 30.)", "Blacksmiths gain the ability to craft armor they find back into ingots / materials, based on the remaining durability. (About 90% lossy)", "All crafted Blacksmith items stack between 2 and 5 of the same item, effectively multiplying the amount you craft. Items are buffed with a Lv20 enchantment and have a 50% chance to be enchanted with a level 30 enchantment."); Cook_job.setJobName("Cook"); Cook_job.setJobDescription("A cook's job is to provide food for others and themselves through cooking and crafting together ingredients."); Cook_job.setAction(0, "CRAFT"); Cook_job.setAction(1, "SMELT"); Cook_job.setExp(400, 250, 40, 1.04); Cook_job.addData("BREAD", 0.003125, 1.25, 0); Cook_job.addData("COOKIE", 0.016875, 0.45, 0); Cook_job.addData("MUSHROOM SOUP", 0.009375, 3.75, 0); Cook_job.addData("PUMPKIN PIE", 0.0375, 15, 0); Cook_job.addData("GOLDEN CARROT", 0.0875, 35, 0); Cook_job.addData("CAKE", 0.10625, 21.25, 0); Cook_job.addData("GOLDEN APPLE", 0.1125, 45, 0); Cook_job.addData("COOKED FISH", 0.06, 24, 1); Cook_job.addData("BAKED POTATO", 0.08, 32, 1); Cook_job.addData("COOKED CHICKEN", 0.09, 36, 1); Cook_job.addData("GRILLED PORK", 0.12, 48, 1); Cook_job.addData("COOKED BEEF", 0.20, 80, 1); Cook_job.setBuffData("Double the amount of cooking time with one fuel item in the furnace.", "Food that is cooked/crafted gives double the amount of hunger restoration and heals 1 Heart of Health (2HP) when eaten.", "Food that is cooked/crafted gain magical buffs that apply when someone eats them. These last for 60 seconds.", "Increases buff strength of all food items by 1.", "Increases bonus effect duration of all food items by x4.", "Food that is cooked/crafted gain a 'Saturation' magical buff that lasts for 2 minutes and heals 3 hearts (6HP) for the player that eats it. All food magical buffs' durations will be increased an additional 3 minutes long and the strength of those buffs increase by 1. Food results that are cooked/crafted will be doubled."); Brewer_job.setJobName("Brewer"); Brewer_job.setJobDescription("A brewer's job is to create potions for others and themselves in order to change the outcome of situations."); Brewer_job.setAction(0, "BREW"); Brewer_job.setExp(100, 55, 3, 1.05); Brewer_job.addData("SUGAR", 0.01, 2, 0); Brewer_job.addData("SPIDER EYE", 0.015, 2, 0); Brewer_job.addData("REDSTONE", 0.025, 2, 0); Brewer_job.addData("GLOWSTONE DUST", 0.025, 2, 0); Brewer_job.addData("GUNPOWDER", 0.03, 2, 0); Brewer_job.addData("FERMENTED SPIDER EYE", 0.035, 4, 0); Brewer_job.addData("GLISTERING MELON", 0.035, 4, 0); Brewer_job.addData("NETHER WART", 0.04, 4, 0); Brewer_job.addData("GOLDEN CARROT", 0.05, 5, 0); Brewer_job.addData("BLAZE POWDER", 0.05, 6, 0); Brewer_job.addData("MAGMA CREAM", 0.075, 8, 0); Brewer_job.addData("GHAST TEAR", 0.30, 20, 0); Brewer_job.setBuffData("Gain access to the Teleport potion. Water Bottle + Lapis Lazuli. Throwing it will teleport you to the thrown location.", "Potions can stack up to 2 at a time. Gain access to the Eye of Wonder potion. Teleport potion + Eye of Ender. Drinking it will reveal mobs' nametags nearby. Throwing it will turn stone into glass temporarily, revealing nearby ores within.", "Potions you throw have double the duration. Potions can stack up to 4 at a time. The stacking amount goes up by 1 with each Brewer level after 20.", "Gain the ability to create Strength potions with Strength IV buffs. Heal potions created by you heal 4x their normal amount.", "Gain access to the Potion of Fury (Gives you attack speed. Strength Potion + Blaze Rod) and Potion of Resistance (Heal Potion + Obsidian) Potions.", "Potions thrown by you last for 30 minutes. Potions can stack up to 64 at a time. Brewing wait time decreased by 4x the normal time."); Enchanter_job.setJobName("Enchanter"); Enchanter_job.setJobDescription("An enchanter's job is to enchant items in order to make them more powerful and useful for everyday tasks."); Enchanter_job.setAction(0, "ENCHANT"); Enchanter_job.setExp(90, 50, 15, 1.08); Enchanter_job.addExtraData("Each level of enchantment multiplies your income and exp gain exponentially."); Enchanter_job.addExtraData("Ex. If PROTECTION gives $0.08 and 4XP, PROTECTION III would give you x9 exp and money: $0.72 and 36XP."); Enchanter_job.addExtraData(""); Enchanter_job.addExtraData("Enchanters also gain some exp and income if job buffs automatically enchant items, such as the Weaponsmith/Blacksmith job. Note this is a very small amount and does not give as much as enchanting an item of your own."); Enchanter_job.addData("PROTECTION", 0.08, 4, 0); Enchanter_job.addData("SMITE", 0.10, 8, 0); Enchanter_job.addData("FIRE PROTECTION", 0.10, 6, 0); Enchanter_job.addData("BANE OF ARTHROPODS", 0.12, 8, 0); Enchanter_job.addData("FEATHER FALLING", 0.14, 10, 0); Enchanter_job.addData("SHARPNESS", 0.15, 14, 0); Enchanter_job.addData("POWER", 0.15, 14, 0); Enchanter_job.addData("EFFICIENCY", 0.15, 14, 0); Enchanter_job.addData("BLAST PROTECTION", 0.20, 16, 0); Enchanter_job.addData("THORNS", 0.20, 16, 0); Enchanter_job.addData("KNOCKBACK", 0.20, 18, 0); Enchanter_job.addData("PUNCH", 0.20, 18, 0); Enchanter_job.addData("FIRE ASPECT", 0.22, 20, 0); Enchanter_job.addData("FLAME", 0.22, 20, 0); Enchanter_job.addData("AQUA AFFINITY", 0.25, 16, 0); Enchanter_job.addData("RESPIRATION", 0.30, 20, 0); Enchanter_job.addData("UNBREAKING", 0.35, 24, 0); Enchanter_job.addData("INFINITY", 0.40, 40, 0); Enchanter_job.addData("LOOTING", 0.40, 30, 0); Enchanter_job.addData("FORTUNE", 0.50, 40, 0); Enchanter_job.addData("SILK TOUCH", 0.50, 40, 0); Enchanter_job.setBuffData("Whenever you gain experience, the amount you gain is doubled.", "Enchantments consume 25% less of your exp. (Lv20 enchantment costs 15 levels) Enchantments gain an extra stat enchantment bonus.", "Enchantments are more potent. (Gain extra enchantments, bonus enchantments, and higher levels than normal.)", "Gain the ability to choose one type of enchantment/bonus enchantment to add to an item when enchanting.", "Gain the ability to enchant legendary-tier items. (Has an unusually higher level of enchantment than normal)", "Enchanters receive quadruple the amount of experience from orbs. Enchanting consumes 75% less of your exp. (Lv20 enchantment costs 5 levels) Enchantments are at least level 5 or higher. Extra bonus enchantments are very likely, and super enchantments are added as well."); Breeder_job.setJobName("Breeder"); Breeder_job.setJobDescription("A breeder's job is to populate and continue to grow animals and make sure there's plenty of animals in the area."); Breeder_job.setAction(0, "BREED"); Breeder_job.setAction(1, "DYE"); Breeder_job.setAction(2, "SHEAR"); Breeder_job.setExp(70, 60, 8, 1.03); Breeder_job.addExtraData("In areas where there are little to no animals, breeders get 20x the amount of money and xp."); Breeder_job.addData("CHICKEN", 0.01, 2, 0); Breeder_job.addData("PIG", 0.02, 4, 0); Breeder_job.addData("SHEEP", 0.02, 4, 0); Breeder_job.addData("COW", 0.03, 4, 0); Breeder_job.addData("OCELOT", 0.04, 8, 0); Breeder_job.addData("WOLF", 0.06, 10, 0); Breeder_job.addData("MUSHROOM COW", 0.20, 16, 0); Breeder_job.addData("HORSE", 0.30, 30, 0); Breeder_job.addData("SHEEP", 0.02, 2, 1); Breeder_job.addData("SHEEP", 0.002, 0.2, 2); Breeder_job.addData("MUSHROOM COW", 0.005, 1, 2); Breeder_job.setBuffData("Nearby Sheep and Chickens reproduce wool and eggs at double the rate.", "Breeding animals may yield twins and triplets half the time.", "Feeding animals will give you the item back half the time.", "Animals will become enticed by you whenever you are nearby, requiring no food to breed animals. Animals will be able to breed again at double the normal rate.", "Wolves and horses you tame gain +150 Health, making these companions much more useful in fighting, and surviving longer. Feeding them one time will heal them completely. For each wolf and horse near you, you gain +2 Health.", "Breeding animals will give between 2-5 of that animal, all of them will be grown up. Sheep will always regrow their wool instantly after shearing them, shears do not break. Chickens will give 64 eggs if you kill one. Cows and Pigs drop a stack of meat when killing them. Feeding pigs will give them a saddle."); Explorer_job.setJobName("Explorer"); Explorer_job.setJobDescription("An explorer's job is to explore the whole world looking for new things and checking out places that are unusual."); Explorer_job.setAction(0, "TASKS"); Explorer_job.setExp(400, 80, 20, 1.01); Explorer_job.addExtraData("You gain variable amounts of EXP and money for doing various tasks:"); Explorer_job.addData("Walking Around: ", 0.005, 1, 0); Explorer_job.addData("Looking around and being aware of your surroundings: ", 0.01, 2, 0); Explorer_job.addData("Interacting with unusual blocks: ", 0.05, 25, 0); Explorer_job.addData("Checking out villages, temples, caves, underground areas, the nether: ", 0.50, 50, 0); Explorer_job.addData("Load a new region:", 0.00, 6, 0); Explorer_job.addData("Creating maps and uncovering new areas on them (Underground rewards more!): ", 0.01, 8, 0); Explorer_job.setBuffData("Movement speed increased by 20%.", "Players lose no exp on death. When taking fatal damage, you will regain all health. This effect can be used once every hour.", "Don't lose any money on death. Reviving costs 75% less.", "When crafting maps, you will also gain 32 paper to zoom the map out completely. (Or use to create more maps.)", "Increased movement speed to 40%.", "When holding a pickaxe, it will detect ores around you based on what the pickaxe is made of."); Support_job.setJobName("Support"); Support_job.setJobDescription("A support's job is to provide assistance and keep others alive by providing potions to heal, materials to allow others to craft things, and being useful overall."); /*Support_job.setAction(0, "GIVE"); Support_job.setAction(1, "CRAFT"); Support_job.setAction(2, "SPLASH");*/ Support_job.setAction(0, "Supporting Situations"); Support_job.setExp(100, 100, 5, 1.03); Support_job.addExtraData("Give players items to earn some money. Note that if they give it back you lose the xp you gained from it. Setting people on fire will clear all experience you've earned for that level."); /*Support_job.addData("TORCH", 0.005, 1, 0); Support_job.addData("WOOD", 0.005, 1, 0); Support_job.addData("COAL", 0.005, 1, 0); Support_job.addData("IRON", 0.005, 1, 0); Support_job.addData("POTIONS", 0.005, 1, 0); Support_job.addData("FOOD", 0.005, 1, 0); Support_job.addData("ARMOR", 0.005, 1, 0); Support_job.addData("WEAPONS", 0.005, 1, 0); Support_job.addData("FOOD", 0.015, 2, 1); Support_job.addData("IRON SWORD", 0.015, 3, 1); Support_job.addData("IRON ARMOR", 0.025, 5, 1); Support_job.addData("DIAMOND SWORD", 0.075, 8, 1); Support_job.addData("POTIONS, SPLASH POTIONS", 0.10, 5, 1); Support_job.addData("DIAMOND ARMOR", 0.20, 20, 1); Support_job.addData("NIGHT VISION", 0.10, 5, 2); Support_job.addData("SPEED", 0.15, 6, 2); Support_job.addData("STRENGTH", 0.40, 9, 2); Support_job.addData("FIRE RESISTANCE", 0.50, 12, 2); Support_job.addData("HEALING", 0.30, 14, 2);*/ Support_job.addData("-Light up dark areas.", 0.01, 2, 0); Support_job.addData("-Help kill things with others.", 0.05, 6, 0); Support_job.addData("-Clear out lava areas to allow for safe passage.", 0.15, 60, 0); Support_job.addData("-Providing materials that someone ran out of.", 1.05, 90, 0); Support_job.addData("-Healing someone when they are low in health.", 2.40, 120, 0); Support_job.addData("-Dousing or using a fire resistance potion on someone burning.", 4.80, 240, 0); Support_job.setBuffData("Everyone around you gains +2 Armor.", "Everyone around you gains +10 more Maximum Health.", "Everyone around you gains +4 Armor. Everyone's hunger degrades at half the speed. Players with 8 HP or less take half the damage from hits.", "When a nearby player is low in health, if you have health splash potions, one of your potions will be automatically consumed to heal them.", "Provide a Fire Resistance buff to everyone around you.", "Everyone around you gains Regeneration. You gain +5 Armor. Everyone around you gains +20 more Health. You gain +10 more health. Everyone around you including yourself moves 20% faster."); } public void onDisable() { saveAccountsConfig(); getConfig().set("server-tick-time", Long.valueOf(SERVER_TICK_TIME)); saveConfig(); saveAccountsConfig(); PluginDescriptionFile pdf = getDescription(); System.out.println("[" + pdf.getName() + "] The plugin has been disabled succesfully."); } public void updateTopSPLEEFSigns() { String name[] = {"","",""}; int rating[] = {-9999,-9999,-9999}, wins[] = {0,0,0}, losses[] = {0,0,0}; //Get list of all players on the server. OfflinePlayer playerlist[] = Bukkit.getOfflinePlayers(); for (int i=0;i=20) { if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[0]) { //This beats the top record, move everything down. name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1]; name[1]=name[0];rating[1]=rating[0];wins[1]=wins[0];losses[1]=losses[0]; name[0]=playerlist[i].getName().toLowerCase(); rating[0]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); wins[0]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); losses[0]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } else if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[1]) { //This beats the 2nd record, move everything down. name[2]=name[1];rating[2]=rating[1];wins[2]=wins[1];losses[2]=losses[1]; name[1]=playerlist[i].getName().toLowerCase(); rating[1]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); wins[1]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); losses[1]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } else if (getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating")>rating[2]) { //This beats the 3rd record, move everything down. name[2]=playerlist[i].getName().toLowerCase(); rating[2]=(int)getAccountsConfig().getDouble(playerlist[i].getName().toLowerCase()+".spleefrating"); wins[2]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleefwins"); losses[2]=getAccountsConfig().getInt(playerlist[i].getName().toLowerCase()+".spleeflosses"); } } } } Sign sign = (Sign)Bukkit.getWorld("world").getBlockAt(1611,85,42).getState(); sign.setLine(0, "");sign.setLine(2, "");sign.setLine(3, ""); sign.setLine(1, ChatColor.BOLD+name[0]); sign.update(); sign = (Sign)Bukkit.getWorld("world").getBlockAt(1611,84,43).getState(); sign.setLine(0, "");sign.setLine(2, "");sign.setLine(3, ""); sign.setLine(1, ChatColor.BOLD+"Wins: "+ChatColor.DARK_GREEN+wins[0]); sign.update(); sign = (Sign)Bukkit.getWorld("world").getBlockAt(1611,84,41).getState(); sign.setLine(0, "");sign.setLine(2, "");sign.setLine(3, ""); sign.setLine(1, ChatColor.BOLD+"Losses: "+ChatColor.DARK_GREEN+losses[0]); sign.update(); sign = (Sign)Bukkit.getWorld("world").getBlockAt(1612,84,42).getState(); sign.setLine(0, "");sign.setLine(2, "");sign.setLine(3, ""); sign.setLine(1, ChatColor.BOLD+"RATING: "+ChatColor.DARK_GREEN+rating[0]/10); sign.update(); sign = (Sign)Bukkit.getWorld("world").getBlockAt(1611,85,39).getState(); sign.setLine(0, ChatColor.BOLD+name[1]); sign.setLine(1, "Rating: "+rating[1]/10); sign.setLine(2, ChatColor.ITALIC+"Wins: "+wins[1]); sign.setLine(3, ChatColor.ITALIC+"Losses: "+losses[1]); sign.update(); sign = (Sign)Bukkit.getWorld("world").getBlockAt(1611,84,37).getState(); sign.setLine(0, ChatColor.BOLD+name[2]); sign.setLine(1, "Rating: "+rating[2]/10); sign.setLine(2, ChatColor.ITALIC+"Wins: "+wins[2]); sign.setLine(3, ChatColor.ITALIC+"Losses: "+losses[2]); sign.update(); } public void runTick() { final Main plugin = this; this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){ public void run(){ SERVER_TICK_TIME++; for (int i=0;i arrows = Bukkit.getWorld("world").getEntities(); for (int j=0;j60) { //Remove old arrows that have existed long enough. (2 seconds) arrows.get(j).remove(); } } } if (shooter.timer<=0) { ARROW_SHOOTERS.remove(i); i--; } } for (int i=0;ininjavisible_list.get(i).resettime) { //Recloak this ninja if it's still alive. List entities = Bukkit.getWorld("world").getEntities(); for (int j=0;j0) { Bukkit.getWorld("world").playEffect(new Location(POLYMORPH_LOC.getWorld(),POLYMORPH_LOC.getX()+(Math.random()-Math.random())*2,POLYMORPH_LOC.getY()+(Math.random())*2+2,POLYMORPH_LOC.getZ()+(Math.random()-Math.random())*2), Effect.STEP_SOUND, Material.EMERALD_BLOCK); Bukkit.getWorld("world").playEffect(new Location(POLYMORPH_LOC.getWorld(),POLYMORPH_LOC.getX()+(Math.random()-Math.random())*2,POLYMORPH_LOC.getY()+(Math.random())*2+2,POLYMORPH_LOC.getZ()+(Math.random()-Math.random())*2), Effect.STEP_SOUND, Material.WATER); if (POLYMORPH==1) { Bukkit.getWorld("world").playEffect(new Location(POLYMORPH_LOC.getWorld(),POLYMORPH_LOC.getX()+(Math.random()-Math.random())*2,POLYMORPH_LOC.getY()+(Math.random())*2+2,POLYMORPH_LOC.getZ()+(Math.random()-Math.random())*2), Effect.POTION_BREAK, 0); } POLYMORPH--; } if (BOSS_DEFEAT>0) { if (BOSS_DEFEAT%4==0) { Bukkit.getWorld("world").playEffect(BOSS_DEFEAT_LOC.add(Math.random()*5-Math.random()*5, BOSS_DEFEAT/20, Math.random()*5-Math.random()*5), Effect.SMOKE, 0); } if (BOSS_DEFEAT==1) { Bukkit.getWorld("world").playEffect(BOSS_DEFEAT_LOC, Effect.ZOMBIE_DESTROY_DOOR, 0); } BOSS_DEFEAT--; } if (REVIVE_EFFECT>0) { switch (REVIVE_EFFECT) { //starts at 90. case 90: case 88: case 86: case 84: case 82: case 80: { Bukkit.getWorld("world").playEffect(new Location(REVIVE_EFFECT_LOC.getWorld(),REVIVE_EFFECT_LOC.getX(),REVIVE_EFFECT_LOC.getY()+(90-REVIVE_EFFECT)/2,REVIVE_EFFECT_LOC.getZ()), Effect.MOBSPAWNER_FLAMES, 0); }break; case 89: case 85: case 79: case 75: case 70: case 65: case 60: case 55: case 50: case 45: case 40: case 35: case 30: case 25: case 20: case 15: case 10: case 5:{ Bukkit.getWorld("world").playEffect(new Location(REVIVE_EFFECT_LOC.getWorld(),REVIVE_EFFECT_LOC.getX()+(Math.random()-Math.random())*2,REVIVE_EFFECT_LOC.getY(),REVIVE_EFFECT_LOC.getZ()+(Math.random()-Math.random())*2), Effect.EXTINGUISH, 0); }break; case 87: case 83: case 77: case 72: case 67: case 62: case 57: case 52: case 47: case 42: case 37: case 32: case 27: case 22: case 17: case 12: case 7: { Bukkit.getWorld("world").playEffect(new Location(REVIVE_EFFECT_LOC.getWorld(),REVIVE_EFFECT_LOC.getX()+(Math.random()-Math.random())*2,REVIVE_EFFECT_LOC.getY()+(Math.random())*2,REVIVE_EFFECT_LOC.getZ()+(Math.random()-Math.random())*2), Effect.SMOKE, (int)(Math.random()*9)); }break; } Bukkit.getWorld("world").playEffect(new Location(REVIVE_EFFECT_LOC.getWorld(),REVIVE_EFFECT_LOC.getX()+(Math.random()-Math.random())*2,REVIVE_EFFECT_LOC.getY()+(Math.random())*2,REVIVE_EFFECT_LOC.getZ()+(Math.random()-Math.random())*2), Effect.STEP_SOUND, Material.BEACON); REVIVE_EFFECT--; //Bukkit.getPlayer("sigonasr2").sendMessage(REVIVE_EFFECT+""); } List lineofsight_check = new ArrayList(); if (Main.SERVER_TICK_TIME%100==0) { //This is for events that occur once every 5 seconds. List world_entities = Bukkit.getWorld("world").getEntities(); for (int i=0;il.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))) { DecimalFormat df = new DecimalFormat("#0.0"); //Bukkit.broadcastMessage("Healing for "+(+5+(0.2*(l.getMaxHealth()/l.getHealth())))+" health. "+df.format(l.getHealth())+"/"+l.getMaxHealth()+" HP"); l.setHealth(l.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))); } } } } world_entities = Bukkit.getWorld("world_nether").getEntities(); for (int i=0;il.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))) { DecimalFormat df = new DecimalFormat("#0.0"); //Bukkit.broadcastMessage("Healing for "+(+5+(0.2*(l.getMaxHealth()/l.getHealth())))+" health. "+df.format(l.getHealth())+"/"+l.getMaxHealth()+" HP"); l.setHealth(l.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))); } } } } world_entities = Bukkit.getWorld("world_the_end").getEntities(); for (int i=0;il.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))) { DecimalFormat df = new DecimalFormat("#0.0"); //Bukkit.broadcastMessage("Healing for "+(+5+(0.2*(l.getMaxHealth()/l.getHealth())))+" health. "+df.format(l.getHealth())+"/"+l.getMaxHealth()+" HP"); l.setHealth(l.getHealth()+5+(0.2*(l.getMaxHealth()/l.getHealth()))); } } } } } for (int zx=0;zx2) { Bukkit.getPlayer("sigonasr2").sendMessage("Previous Time: "+Bukkit.getWorld("world").getTime()); Bukkit.getWorld("world").setTime((long) (Bukkit.getWorld("world").getTime()-((Bukkit.getWorld("world").getTime()-last_world_time)/2.0d))); last_world_time = Bukkit.getWorld("world").getTime(); Bukkit.getPlayer("sigonasr2").sendMessage("New Time: "+Bukkit.getWorld("world").getTime()); } }*/ //last_world_time = Main.SERVER_TICK_TIME; if (p.getWorld().getName().compareTo("world")==0) { //Bukkit.getWorld("world").spawnEntity(p.getLocation(), EntityType.EXPERIENCE_ORB); //Bukkit.getWorld("world").dropItemNaturally(p.getLocation(), new ItemStack(Material.DIRT)); if (getConfig().getBoolean("halloween-enabled") && Main.SERVER_TICK_TIME%10==0) { //1551,69,275 Location testloc = new Location(p.getWorld(),1551,69,-275); if (p.getLocation().distanceSquared(testloc)<900) { //p.sendMessage("In range."); //We are close enough to the sheep pen. Check out the sheep. List ents = p.getNearbyEntities(15, 15, 15); for (int i=0;i nearbylist = p.getNearbyEntities(15, 15, 5); List nearbylist2 = p.getNearbyEntities(3, 3, 5); for (int l=0;l10) { for (int l=0;l nearby = p.getNearbyEntities(30, 30, 30); boolean exists=false; for (int m=0;m e_list = Bukkit.getWorld("world").getEntitiesByClass(EnderDragon.class).iterator(); boolean first=false; while (e_list.hasNext()) { //p.sendMessage("Moving Enderdragon to "+new Location(p.getWorld(),p.getLocation().getBlockX()+i,-50,p.getLocation().getBlockZ()+j)); EnderDragon next = e_list.next(); if (!first) { first=true; } else { next.remove(); } }*/ } } } } } } if (Main.SERVER_TICK_TIME%20==0) { for (int d=0;d0 && chunk_queue_list.get(0).isLoaded() && chunk_queue_list.get(0).getWorld().getName().equalsIgnoreCase("world")) { //Load up this chunk if it's loaded and check things. //Attempt to load up the custom chunk. List debugmessages = new ArrayList(); FileConfiguration customchunk = reloadChunksConfig(chunk_queue_list.get(0).getX(), chunk_queue_list.get(0).getZ()); if (!customchunk.contains("animal-reset2")) { customchunk.set("animal-reset2", Long.valueOf(Main.SERVER_TICK_TIME+17280000)); Chunk c = chunk_queue_list.get(0); Random r = new Random(); for (int x=0;x<16;x++) { for (int z=0;z<16;z++) { if (r.nextDouble()<=0.000244140625) { Block b = Bukkit.getWorld("world").getBlockAt(x+c.getX()*16,Bukkit.getWorld("world").getHighestBlockYAt(x+c.getX()*16, z+c.getZ()*16),z+c.getZ()*16); if (b.getType()!=Material.WATER && b.getType()!=Material.ICE && b.getType()!=Material.LAVA && !b.getBiome().name().equalsIgnoreCase("ocean") && !b.getBiome().name().equalsIgnoreCase("river")) { if (b.getType()==Material.SNOW || b.getType()==Material.DIRT || b.getType()==Material.SAND || b.getType()==Material.LEAVES || b.getType()==Material.GRASS || b.getType()==Material.GRAVEL || b.getType()==Material.STONE || b.getType()==Material.COBBLESTONE || b.getType()==Material.MYCEL || b.getType()==Material.BROWN_MUSHROOM || b.getType()==Material.RED_MUSHROOM) { if (b.getBiome().name().equalsIgnoreCase("plains")) { //Best place for things to spawn. Any mob type can spawn here. //Choose a mob type randomly. EntityType[] mobs = {EntityType.COW,EntityType.HORSE,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN,EntityType.WOLF}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } } else { if (b.getBiome().name().equalsIgnoreCase("forest")) { //Wolves can still spawn here. Horses cannot. //Choose a mob type randomly. EntityType[] mobs = {EntityType.COW,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN,EntityType.WOLF}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } }else { if (b.getBiome().name().equalsIgnoreCase("jungle")) { //Chance to spawn ocelots here. EntityType[] mobs = {EntityType.COW,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN,EntityType.OCELOT}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } }else { //Choose a mob type randomly. EntityType[] mobs = {EntityType.COW,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } } } } } } } ////Bukkit.getLogger().info("Biome here is "+b.getBiome().name()); } } } else { //Check the value and regenerate if necessary. if (Main.SERVER_TICK_TIME>customchunk.getLong("animal-reset2")) { customchunk.set("animal-reset2", Long.valueOf(Main.SERVER_TICK_TIME+17280000)); Chunk c = chunk_queue_list.get(0); Random r = new Random(); for (int x=0;x<16;x++) { for (int z=0;z<16;z++) { if (r.nextDouble()<=0.000244140625) { Block b = Bukkit.getWorld("world").getBlockAt(x+c.getX()*16,Bukkit.getWorld("world").getHighestBlockYAt(x+c.getX()*16, z+c.getZ()*16),z+c.getZ()*16); if (b.getType()!=Material.WATER && b.getType()!=Material.ICE && b.getType()!=Material.LAVA && !b.getBiome().name().equalsIgnoreCase("ocean") && !b.getBiome().name().equalsIgnoreCase("river")) { if (b.getType()==Material.SNOW || b.getType()==Material.DIRT || b.getType()==Material.SAND || b.getType()==Material.LEAVES || b.getType()==Material.GRASS || b.getType()==Material.GRAVEL || b.getType()==Material.STONE || b.getType()==Material.COBBLESTONE || b.getType()==Material.MYCEL || b.getType()==Material.BROWN_MUSHROOM || b.getType()==Material.RED_MUSHROOM) { if (b.getBiome().name().equalsIgnoreCase("plains")) { //Best place for things to spawn. Any mob type can spawn here. //Choose a mob type randomly. EntityType[] mobs = {EntityType.COW,EntityType.HORSE,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN,EntityType.WOLF}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } } else { if (b.getBiome().name().equalsIgnoreCase("forest")) { //Wolves can still spawn here. Horses cannot. //Choose a mob type randomly. EntityType[] mobs = {EntityType.COW,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN,EntityType.WOLF}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } }else { if (b.getBiome().name().equalsIgnoreCase("jungle")) { //Chance to spawn ocelots here. EntityType[] mobs = {EntityType.COW,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN,EntityType.OCELOT}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } }else { //Choose a mob type randomly. EntityType[] mobs = {EntityType.COW,EntityType.PIG,EntityType.SHEEP,EntityType.CHICKEN}; int i=(int)(Math.random()*4)+2; EntityType selected = mobs[(int)(mobs.length*Math.random())]; ////Bukkit.getLogger().info("Spawned "+i+" "+selected.getName()+" in Biome "+b.getBiome().name()+" for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+"."); debugmessages.add(" Spawned: "+i+" "+selected.getName()); while (i>0) { LivingEntity f = (LivingEntity)Bukkit.getWorld("world").spawnEntity(b.getLocation().add(Math.random()*10-Math.random()*10,1,Math.random()*10-Math.random()*10), selected); f.setRemoveWhenFarAway(false); //This should be a permanent mob. i--; } } } } } } } ////Bukkit.getLogger().info("Biome here is "+b.getBiome().name()); } } } } if (!customchunk.contains("diamond-generate")) { customchunk.set("diamond-generate", Boolean.valueOf(true)); Chunk c = chunk_queue_list.get(0); int adddiamond=0; for (int x=0;x<16;x++) { for (int y=5;y<25;y++) { for (int z=0;z<16;z++) { Block b = Bukkit.getWorld("world").getBlockAt(x+c.getX()*16,y,z+c.getZ()*16); if (b!=null && b.getType()==Material.STONE) { if (Math.random()<=0.000625) { int i=(int)(Math.random()*8.0d)+1; while (i>0) { Block d = c.getBlock(x+(int)(Math.random()*i)-(int)(Math.random()*i), y+(int)(Math.random()*i)-(int)(Math.random()*i), z+(int)(Math.random()*i)-(int)(Math.random()*i)); adddiamond++; b.setType(Material.DIAMOND_ORE); i--; } //Make a patch between 1 and 8. } } } } } ////Bukkit.getLogger().info("Generated "+adddiamond+" new diamonds for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()); if (adddiamond>0) { debugmessages.add(" Added "+adddiamond+" diamond"+((adddiamond!=1)?"s":"")+"."); } } if (!customchunk.contains("limit-ore-generation")) { customchunk.set("limit-ore-generation", Boolean.valueOf(true)); Chunk c = chunk_queue_list.get(0); int removeore=0,totalore=0,newore=0; for (int x=0;x<16;x++) { for (int y=5;y<96;y++) { for (int z=0;z<16;z++) { Block b = Bukkit.getWorld("world").getBlockAt(x+c.getX()*16,y,z+c.getZ()*16); if (b!=null && (b.getType()==Material.COAL_ORE || b.getType()==Material.IRON_ORE || b.getType()==Material.GOLD_ORE || b.getType()==Material.REDSTONE_ORE || b.getType()==Material.LAPIS_ORE || b.getType()==Material.DIAMOND_ORE)) { if (Math.random()<=0.60) { removeore++; b.setType(Material.STONE); //Make a patch between 1 and 8. } totalore++; } } } } for (int x=0;x<16;x++) { for (int y=5;y<96;y++) { for (int z=0;z<16;z++) { Block b = Bukkit.getWorld("world").getBlockAt(x+c.getX()*16,y,z+c.getZ()*16); if (b!=null && (b.getType()==Material.COAL_ORE || b.getType()==Material.IRON_ORE || b.getType()==Material.GOLD_ORE || b.getType()==Material.REDSTONE_ORE || b.getType()==Material.LAPIS_ORE || b.getType()==Material.DIAMOND_ORE)) { newore++; } } } } ////Bukkit.getLogger().info("Removed "+removeore+"/"+totalore+" ore for chunk "+e.getChunk().getX()+","+e.getChunk().getZ()+". There are now "+newore+" ores left."); debugmessages.add(" Removed: "+removeore+"/"+totalore+" ores."); } saveChunksConfig(customchunk, chunk_queue_list.get(0).getX(), chunk_queue_list.get(0).getZ()); if (debugmessages.size()>0) { for (int i=0;i nearby = p.getNearbyEntities(20, 12, 20); //List nearby2 = p.getNearbyEntities(10, 6, 10); for (int i=0;i200) { l.setCustomNameVisible(false); } } } } } } if (Main.SERVER_TICK_TIME%60==0) { if (p.getWorld().getName().compareTo("world")==0) { List nearby = p.getNearbyEntities(30, 30, 30); Location nearestwolf = null; int minions=0; for (int i=0;i nearby = p.getNearbyEntities(30, 30, 30); try { for (int i=0;i13000) { //Bukkit.getPlayer("sigonasr2").sendMessage("It's night now..."); turnedon=true; for (int x=1562;x<1645;x++) { for (int y=64;y<80;y++) { for (int z=-357;z<-211;z++) { Block theblock=Bukkit.getWorld("world").getBlockAt(x,y,z); if (theblock.getType()==Material.REDSTONE_LAMP_OFF) { theblock.setType(Material.REDSTONE_LAMP_ON); } } } } } if (turnedon==true && Bukkit.getWorld("world").getTime()<13000) { turnedon=false; //Bukkit.getPlayer("sigonasr2").sendMessage("It's day now..."); for (int x=1562;x<1645;x++) { for (int y=64;y<80;y++) { for (int z=-357;z<-211;z++) { Block theblock=Bukkit.getWorld("world").getBlockAt(x,y,z); if (theblock.getType()==Material.REDSTONE_LAMP_ON) { theblock.setType(Material.REDSTONE_LAMP_OFF); } } } } } } if (Main.SERVER_TICK_TIME%10==0) { if (getConfig().getBoolean("spleef4insession")) { //Check to see if we fall off. if ((p.getLocation().getX()<1585 || p.getLocation().getX()>1600 || p.getLocation().getZ()<24 || p.getLocation().getZ()>39 || p.getLocation().getY()<86.5d) && ( (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequesta4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestb4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestc4player"))==0 || p.getName().compareTo(getConfig().getString("spleefrequestd4player"))==0))) { //You lose. //See if we're the winner. int countdead=0; //We're looking for 3. Player winningplayer = p,losingplayer = p; if (getConfig().getString("spleefrequesta4player").compareTo("none")==0) { countdead++; } else { if (getConfig().getString("spleefrequesta4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequesta4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequesta4player")); } } if (getConfig().getString("spleefrequestb4player").compareTo("none")==0) { countdead++; } else { if (getConfig().getString("spleefrequestb4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestb4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestb4player")); } } if (getConfig().getString("spleefrequestc4player").compareTo("none")==0) { countdead++; } else { if (getConfig().getString("spleefrequestc4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestc4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestc4player")); } } if (getConfig().getString("spleefrequestd4player").compareTo("none")==0) { countdead++; } else { if (getConfig().getString("spleefrequestd4player").compareTo(p.getName().toLowerCase())==0) { losingplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestd4player")); } else { winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestd4player")); } } if (countdead==2) { getConfig().set("spleef4insession", Boolean.valueOf(false)); //Stand someplace else when you win. //Losing player has losing player stuff happen. //This was a player that lost. //Move them out, give them back their stuff. Location newloc = p.getLocation(); //Look for the special shovel for the sake of storing it. /* ItemStack[] shovelstack = p.getInventory().getContents(); boolean shovelfound=false; ItemStack shovel = shovelstack[0]; for (int i=0;i=400) { //WE have come to a standstill. Pick winner based on who has more blocks. int player_a_blocks=0,player_b_blocks=0; for (int i=Bukkit.getPlayer(getConfig().getString("spleefrequestaplayer")).getLocation().getBlockX()-4;iplayer_b_blocks) { blockwinner=1; } else { blockwinner=2; } } else if ((p.getLocation().getY()<86.5d || p.getLocation().getZ()<52.0d || p.getLocation().getZ()>65.0d || p.getLocation().getX()>1628.0d || p.getLocation().getX()<1615.0d) || blockwinner!=0) { //We lose. Other player wins. getConfig().set("spleefinsession", Boolean.valueOf(false)); //Find out if we're player A, or player B. Player winningplayer,losingplayer; if (p.getName().toLowerCase().compareTo(getConfig().getString("spleefrequestaplayer"))==0 || blockwinner==2) { //We're player A. //Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestbplayer")+" is the winner of this spleef game! "+getConfig().getString("spleefrequestaplayer")+" loses."); losingplayer=p; winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestbplayer")); double val1,val2,value,newval1,newval2; if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefrating")) { val1 = getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefrating"); } else { val1 = 1000.0d; } if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefrating")) { val2 = getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefrating"); } else { val2 = 1000.0d; } value = 1.0d/(1.0d+Math.pow(10.0d, ((val2-val1)/400.0d))); if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefwins")) { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleefwins")+1)); } else { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(1)); } if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleeflosses")) { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleeflosses"))); } else { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(0)); } if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefwins")) { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleefwins"))); } else { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(0)); } if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleeflosses")) { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleeflosses")+1)); } else { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(1)); } newval1 = (val1+Math.round(((50.0d/((getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(1.0d-value)))); newval2 = (val2+Math.round(((50.0d/((getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(0.0d-value)))); getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval1)); getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval2)); Location newloc = winningplayer.getLocation(); Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestbplayer")+"["+(int)newval1/10+"] is the winner of this spleef game! "+getConfig().getString("spleefrequestaplayer")+"["+(int)newval2/10+"] loses."); newloc.setX(1622.5d); newloc.setY(87.0d); newloc.setZ(51.65d); winningplayer.teleport(newloc); updateTopSPLEEFSigns(); //saveAccountsConfig() //Commented out; } else { //We're player B. //Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestaplayer")+" is the winner of this spleef game! "+getConfig().getString("spleefrequestbplayer")+" loses."); losingplayer=p; winningplayer=Bukkit.getPlayer(getConfig().getString("spleefrequestaplayer")); double val1,val2,value,newval1,newval2; if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefrating")) { val1 = getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefrating"); } else { val1 = 1000.0d; } if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefrating")) { val2 = getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefrating"); } else { val2 = 1000.0d; } value = 1.0d/(1.0d+Math.pow(10.0d, ((val2-val1)/400.0d))); if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleefwins")) { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleefwins")+1)); } else { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(1)); } if (getAccountsConfig().contains(winningplayer.getName().toLowerCase()+".spleeflosses")) { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(winningplayer.getName().toLowerCase()+".spleeflosses"))); } else { getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(0)); } if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleefwins")) { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleefwins"))); } else { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefwins", Integer.valueOf(0)); } if (getAccountsConfig().contains(losingplayer.getName().toLowerCase()+".spleeflosses")) { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(getAccountsConfig().getInt(losingplayer.getName().toLowerCase()+".spleeflosses")+1)); } else { getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleeflosses", Integer.valueOf(1)); } newval1 = ((val1+Math.round((50.0d/((getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(winningplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(1.0d-value)))); newval2 = ((val2+Math.round((50.0d/((getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleefwins")+getAccountsConfig().getDouble(losingplayer.getName().toLowerCase()+".spleeflosses"))/20.0d))*(0.0d-value)))); getAccountsConfig().set(winningplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval1)); getAccountsConfig().set(losingplayer.getName().toLowerCase()+".spleefrating",Double.valueOf(newval2)); Location newloc = winningplayer.getLocation(); Bukkit.broadcastMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+getConfig().getString("spleefrequestaplayer")+"["+(int)newval1/10+"] is the winner of this spleef game! "+getConfig().getString("spleefrequestbplayer")+"["+(int)newval2/10+"] loses."); newloc.setX(1622.5d); newloc.setY(87.0d); newloc.setZ(51.65d); winningplayer.teleport(newloc); updateTopSPLEEFSigns(); //saveAccountsConfig() //Commented out; } //Look for the special shovel. /* ItemStack[] shovelstack = Bukkit.getPlayer(getConfig().getString("spleefrequestaplayer")).getInventory().getContents(); boolean shovelfound=false; ItemStack shovel = shovelstack[0]; Bukkit.getPlayer("sigonasr2").sendMessage("Starting shovel check."); for (int i=0;i78.0d && p.getLocation().getZ()>53.0d && p.getLocation().getZ()<64.0d && p.getLocation().getX()<1627.0d && p.getLocation().getX()>1616.0d) { Location newloc = p.getLocation(); newloc.setX(1622.5d); newloc.setY(87.0d); newloc.setZ(51.65d); p.teleport(newloc); p.sendMessage(ChatColor.RED+"[SPLEEF] "+ChatColor.YELLOW+"You are a spectator! What are you thinking?!"); } } } } } } }, 1l, 1l); } public String healthbar(double curHP,double maxHP) { //隨�ソス隨�ソス int bits=(int)(Math.ceil(curHP/maxHP*10)); String bar=" "; if (bits>6) { bar+=ChatColor.GREEN+""; } else if (bits>3) { bar+=ChatColor.YELLOW+""; } else { bar+=ChatColor.RED+""; } for (int i=0;i=17) { if (bits>6) { bar+=ChatColor.GREEN+""; } else if (bits>3) { bar+=ChatColor.YELLOW+""; } else { bar+=ChatColor.RED+""; } } else { if (bits>6) { bar+=ChatColor.DARK_GREEN+""; } else if (bits>3) { bar+=ChatColor.GOLD+""; } else { bar+=ChatColor.DARK_RED+""; } } for (int i=0;i=10) { PersistentExplorerList eve = new PersistentExplorerList(p.getName().toLowerCase()); eve.event=1; eve.data=p.getExp(); eve.data2=p.getLevel(); eve.expiretime=Main.SERVER_TICK_TIME+1200; explorers.add(eve); } } if (explorers.get(i).event==1 && explorers.get(i).name.compareTo(p.getName().toLowerCase())==0) { exppoint=i; //p.setTotalExperience(p.getTotalExperience()+explorers.get(j).data); //p.sendMessage("Your experience: "+explorers.get(i).data+"/"+p.getTotalExperience()); } else if (explorers.get(i).event==2 && explorers.get(i).name.compareTo(p.getName().toLowerCase())==0) { deadpoint=i; } if (exppoint!=-1 && deadpoint!=-1) { p.setExp(explorers.get(exppoint).data); p.setLevel((int)explorers.get(exppoint).data2); explorers.get(exppoint).event=-1; explorers.get(deadpoint).event=-1; exppoint=-1; deadpoint=-1; } */ if (explorers.get(i).event==-1 || explorers.get(i).expiretimegetPlayerData(list[i]).furytime) { getPlayerData(list[i]).furytime=0; list[i].sendMessage(ChatColor.RED+""+ChatColor.ITALIC+"Fury Potion effect has worn off..."); } if (getPlayerData(list[i]).invulntime!=0 && Main.SERVER_TICK_TIME>getPlayerData(list[i]).invulntime) { getPlayerData(list[i]).invulntime=0; list[i].sendMessage(ChatColor.RED+""+ChatColor.ITALIC+"Invulnerability Potion effect has worn off..."); } if (hasJobBuff("Hunter", list[i],Job.JOB40)) { if (Bukkit.getWorld("world").getTime()>13000) { list[i].addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY,200,1,true)); } } if (hasJobBuff("Hunter", list[i], Job.JOB30A)) { getPlayerData(list[i]).blockstack=0; } if (list[i].getAllowFlight() && hasJobBuff("Builder", list[i], Job.JOB40) && SERVER_TICK_TIME-getPlayerData(list[i]).lastflighttime>=200) { if (list[i].getGameMode()!=GameMode.CREATIVE) { list[i].setAllowFlight(false); list[i].setFlying(false); } list[i].sendMessage(ChatColor.DARK_RED+""+ChatColor.ITALIC+"Flight disabled..."); } if (list[i].getAllowFlight() && hasJobBuff("Fisherman", list[i], Job.JOB40) && !list[i].isOnGround() && SERVER_TICK_TIME-getPlayerData(list[i]).lastflighttime>=100) { if (list[i].getGameMode()!=GameMode.CREATIVE) { list[i].setAllowFlight(false); list[i].setFlying(false); } list[i].sendMessage(ChatColor.DARK_RED+""+ChatColor.ITALIC+"Flight disabled..."); } if (Math.random()<0.5) { if (!list[i].isDead() && PlayerinJob(list[i], "Breeder") && getJobLv("Breeder", list[i])>=5) { List entities = list[i].getNearbyEntities(10, 10, 10); for (int j=0;j7 && (unmatched/9610.0d*100)<8.35 && (last_boss_dungeon_time==0 || last_boss_dungeon_time nearby = list[i].getNearbyEntities(20, 5, 20); for (int j=0;j-6;j--) { for (int k=2;k>-1;k--) { for (int l=5;l>-6;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(20+j,k,spread+l)); if (b.getType()==Material.TORCH || b.getType()==Material.GLOWSTONE || b.getType()==Material.COMMAND || b.getType()==Material.MOSSY_COBBLESTONE) { torch1=true; } } } } if (!torch1) { int lb1=(int)(Math.random()*5)+1,lb2=(int)(Math.random()*5)+1,ub1=-(int)(Math.random()*6)+1,ub2=-(int)(Math.random()*6)+1; for (int j=lb1;j>ub1;j--) { for (int k=2;k>-1;k--) { for (int l=lb2;l>-ub2;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(20+j,k,spread+l)); if (Math.random()<=0.75 && b.getType()!=Material.BEDROCK && b.getType()!=Material.MOB_SPAWNER && b.getType()!=Material.ENDER_PORTAL && b.getType()!=Material.ENDER_PORTAL_FRAME) { b.setType(Material.AIR); } } } } e1 = Bukkit.getWorld("world").spawnEntity(list[i].getLocation().add(20,0,spread), EntityType.ZOMBIE); } torch2=false; spread = (int)(Math.random()*10)+10; for (int j=5;j>-6;j--) { for (int k=2;k>-1;k--) { for (int l=5;l>-6;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(-20+j,k,spread+l)); if (b.getType()==Material.TORCH || b.getType()==Material.GLOWSTONE || b.getType()==Material.COMMAND || b.getType()==Material.MOSSY_COBBLESTONE) { torch2=true; } } } } if (!torch2) { int lb1=(int)(Math.random()*5)+1,lb2=(int)(Math.random()*5)+1,ub1=-(int)(Math.random()*6)+1,ub2=-(int)(Math.random()*6)+1; for (int j=lb1;j>ub1;j--) { for (int k=2;k>-1;k--) { for (int l=lb2;l>-ub2;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(-20+j,k,spread+l)); if (Math.random()<=0.75 && b.getType()!=Material.BEDROCK && b.getType()!=Material.MOB_SPAWNER && b.getType()!=Material.ENDER_PORTAL && b.getType()!=Material.ENDER_PORTAL_FRAME) { b.setType(Material.AIR); } } } } e2 = Bukkit.getWorld("world").spawnEntity(list[i].getLocation().add(-20,0,spread), EntityType.ZOMBIE); } spread = (int)(Math.random()*10)+10; for (int j=5;j>-6;j--) { for (int k=2;k>-1;k--) { for (int l=5;l>-6;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(spread+j,k,20+l)); if (b.getType()==Material.TORCH || b.getType()==Material.GLOWSTONE || b.getType()==Material.COMMAND || b.getType()==Material.MOSSY_COBBLESTONE) { torch3=true; } } } } if (!torch3) { int lb1=(int)(Math.random()*5)+1,lb2=(int)(Math.random()*5)+1,ub1=-(int)(Math.random()*6)+1,ub2=-(int)(Math.random()*6)+1; for (int j=lb1;j>ub1;j--) { for (int k=2;k>-1;k--) { for (int l=lb2;l>-ub2;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(spread+j,k,20+l)); if (Math.random()<=0.75 && b.getType()!=Material.BEDROCK && b.getType()!=Material.MOB_SPAWNER && b.getType()!=Material.ENDER_PORTAL && b.getType()!=Material.ENDER_PORTAL_FRAME) { b.setType(Material.AIR); } } } } e3 = Bukkit.getWorld("world").spawnEntity(list[i].getLocation().add(spread,0,20), EntityType.ZOMBIE); } spread = (int)(Math.random()*10)+10; for (int j=5;j>-6;j--) { for (int k=2;k>-1;k--) { for (int l=5;l>-6;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(spread+j,k,-20+l)); if (b.getType()==Material.TORCH || b.getType()==Material.GLOWSTONE || b.getType()==Material.COMMAND || b.getType()==Material.MOSSY_COBBLESTONE) { torch4=true; } } } } if (!torch4) { int lb1=(int)(Math.random()*5)+1,lb2=(int)(Math.random()*5)+1,ub1=-(int)(Math.random()*6)+1,ub2=-(int)(Math.random()*6)+1; for (int j=lb1;j>ub1;j--) { for (int k=2;k>-1;k--) { for (int l=lb2;l>-ub2;l--) { Block b =Bukkit.getWorld("world").getBlockAt(list[i].getLocation().add(spread+j,k,-20+l)); if (Math.random()<=0.75 && b.getType()!=Material.BEDROCK && b.getType()!=Material.MOB_SPAWNER && b.getType()!=Material.ENDER_PORTAL && b.getType()!=Material.ENDER_PORTAL_FRAME) { b.setType(Material.AIR); } } } } e4 = Bukkit.getWorld("world").spawnEntity(list[i].getLocation().add(spread,0,-20), EntityType.ZOMBIE); } } } list[i].getScoreboard().getTeam(list[i].getName().toLowerCase()).setSuffix(healthbar(list[i].getHealth(),list[i].getMaxHealth(),list[i].getFoodLevel())); /* Team t = list[i].getScoreboard().getTeam(list[i].getName()); double hp = list[i].getHealth(); double maxhp = list[i].getMaxHealth(); int food = list[i].getFoodLevel(); t.setSuffix(healthbar(hp, maxhp, food)); */ } LOGGING_UPDATE_COUNTS++; //3 for (int i=0;i=10) { if (p.isSneaking()) { p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 12, 0, false)); } } } } } LOGGING_UPDATE_COUNTS++; //6 for (int i=0;i nearbyplayers = p.getNearbyEntities(20, 20, 20); //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 1."); for (int j=0;j=20) { int get_resistance_level=-1; Iterator effects = p2.getActivePotionEffects().iterator(); while (effects.hasNext()) { PotionEffect pot = effects.next(); if (pot.getType().getName().equalsIgnoreCase(PotionEffectType.DAMAGE_RESISTANCE.getName())) { get_resistance_level=pot.getAmplifier(); //Bukkit.broadcastMessage("Got REsistance of "+pot.getAmplifier()); break; } else { //Bukkit.broadcastMessage("Got buff of "+pot.getType()); } } if (get_resistance_level<1) { //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 4."); p2.sendMessage(ChatColor.YELLOW+"[Aura]"+ChatColor.ITALIC+"Damage reduction buff (40%) from Support "+ChatColor.DARK_RED+p.getName()); p2.sendMessage(ChatColor.YELLOW+"[Aura]"+ChatColor.ITALIC+"Food Exhaustion buff (50% less food consumption) from Support "+ChatColor.DARK_RED+p.getName()); p2.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 601, 1, false)); } else { p2.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); p2.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 601, 1, false)); } } else if (supportlv>=5) { //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 3."); //Give them a resistance buff. int get_resistance_level=-1; Iterator effects = p2.getActivePotionEffects().iterator(); while (effects.hasNext()) { PotionEffect pot = effects.next(); if (pot.getType().getName().equalsIgnoreCase(PotionEffectType.DAMAGE_RESISTANCE.getName())) { get_resistance_level=pot.getAmplifier(); //Bukkit.broadcastMessage("Got REsistance of "+pot.getAmplifier()); break; } else { //Bukkit.broadcastMessage("Got buff of "+pot.getType()); } } if (get_resistance_level<0) { //Bukkit.getPlayer("sigonasr2").sendMessage("Entered 4."); p2.sendMessage(ChatColor.YELLOW+"[Aura]"+ChatColor.ITALIC+"Damage reduction buff (20%) from Support "+ChatColor.DARK_RED+p.getName()); p2.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 601, 0, false)); } else { p2.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); p2.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 601, 0, false)); } } if (supportlv>=10) { //Set that they have a lv10 hp buff. for (int k=0;k=10) { //We store the exp and level too. if (explorerlist.get(i).wedied) { p.setExp(explorerlist.get(i).expamt); p.setLevel(explorerlist.get(i).explv); explorerlist.get(i).wedied=false; } else { explorerlist.get(i).expamt=p.getExp(); explorerlist.get(i).explv=p.getLevel(); } } //Give money for moving around. double distance = Math.abs(explorerlist.get(i).xprevious-p.getLocation().getX())+Math.abs(explorerlist.get(i).zprevious-p.getLocation().getZ()); gainMoneyExp(p,"Explorer",0.005*distance/500.0d,distance/500.0d); //Bukkit.getPlayer("sigonasr2").sendMessage("+"+distance/500.0d+"xp"); Block lookat = p.getTargetBlock(null, 50); if (distance>2) { //VILLAGE CRITERIA. if (lookat.getType()==Material.SAND) { explorerlist.get(i).villagecriteria--; } if (lookat.getType()==Material.SANDSTONE) { explorerlist.get(i).villagecriteria-=2; } if (lookat.getType()==Material.WOOL && lookat.getData()==15) { explorerlist.get(i).villagecriteria-=3; } if (lookat.getType()==Material.DIRT) { explorerlist.get(i).villagecriteria=100; } if (lookat.getType()==Material.LOG || lookat.getType()==Material.WOOD) { explorerlist.get(i).villagecriteria=100; } if (explorerlist.get(i).villagecriteria<40 && GLOBAL_villagetimer lister = p.getNearbyEntities(10, 10, 10); for (int j=0;j50) { explorerlist.get(i).cavecriteria=100; } if (lookat.getType()==Material.LOG || lookat.getType()==Material.SAND) { explorerlist.get(i).cavecriteria=100; } if (explorerlist.get(i).cavecriteria<=0 && GLOBAL_cavetimer10 && lookat.getLightLevel()<6) { explorerlist.get(i).undergroundcriteria-=20; } if (explorerlist.get(i).undergroundcriteria<=0 && GLOBAL_undergroundtimer50) { explorerlist.get(i).undergroundcriteria=100; } if (lookat.getType()==Material.LOG || lookat.getType()==Material.SAND) { explorerlist.get(i).undergroundcriteria=100; } //NETHER CRITERIA if (lookat.getType()==Material.NETHERRACK) { explorerlist.get(i).nethercriteria-=1; } if (lookat.getType()==Material.LAVA) { explorerlist.get(i).nethercriteria-=5; } if (explorerlist.get(i).nethercriteria<=0 && GLOBAL_nethertimercurrentsize) { //Award this explorer experience for growing the map. if (p.getLocation().getY()<=60) { gainMoneyExp(p,"Explorer",0.01,8); } else { gainMoneyExp(p,"Explorer",0.001,2); } } } } if (lookat.getType()!=Material.AIR && lookat.getType()!=explorerlist.get(i).lasttype) { distance = Math.abs(explorerlist.get(i).xlookprevious-lookat.getLocation().getX())+Math.abs(explorerlist.get(i).zlookprevious-lookat.getLocation().getZ()); int mult=1; for (int j=0;jjukeboxlist.get(i).getSongDuration()*20+60) { //Check to see if players are closer to one or the other. boolean closest=true; for (int j=0;jjukeboxlist.get(j).getClosestPlayer()) { closest=false; } } } if (closest) { //We have to loop it. if (!jukeboxlist.get(i).Restart()) { jukeboxlist.remove(i); i--; } else { //Bukkit.getPlayer("sigonasr2").sendMessage("Restarted Jukebox "+i+" Properties: "+((Jukebox)(jukeboxlist.get(i).getJukebox().getState())).getPlaying()+","+((Jukebox)(jukeboxlist.get(i).getJukebox().getState())).isPlaying()); } } } } } else { jukeboxlist.remove(i); i--; } //Bukkit.getPlayer("sigonasr2").sendMessage("Jukebox "+i+" Properties: "+((Jukebox)(jukeboxlist.get(i).getJukebox().getState())).getPlaying()+","+((Jukebox)(jukeboxlist.get(i).getJukebox().getState())).isPlaying()); } LOGGING_UPDATE_COUNTS++; //11 LOGGING_UPDATE_COUNTS++; //12 } }, 200, 200); } @SuppressWarnings("deprecation") public void updateTime() { getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { public void run() { for (int i=0;i0 && !brewingstandlist.get(i).is_newTimeSet()) { //Bukkit.getPlayer("sigonasr2").sendMessage("Brewing, time is not set: "+brewingstandlist.get(i).getBrewingTime()); if (hasJobBuff("Brewer", brewingstandlist.get(i).owner, Job.JOB40)) { brewingstandlist.get(i).set_newTime(true); brewingstandlist.get(i).setBrewingTime(brewingstandlist.get(i).getBrewingTime()/4); } if (PlayerinJob(brewingstandlist.get(i).owner, "Brewer") && getJobLv("Brewer", brewingstandlist.get(i).owner)>=5) { brewingstandlist.get(i).set_newTime(true); //Bukkit.getPlayer("sigonasr2").sendMessage("Old Brewing time: "+brewingstandlist.get(i).getBrewingTime()); //brewingstandlist.get(i).setBrewingTime(brewingstandlist.get(i).getBrewingTime()/2); //Bukkit.getPlayer("sigonasr2").sendMessage("New Brewing time: "+brewingstandlist.get(i).getBrewingTime()); } } if (brewingstandlist.get(i).getTime()=2) { last_world_time+=2; raisecount++; } Bukkit.getWorld("world").setFullTime(Bukkit.getWorld("world").getFullTime()-raisecount); } } } , 8, 8); } @SuppressWarnings("deprecation") public void payDay(int time) { getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { public void run() { for (Player allOnlineP : Bukkit.getOnlinePlayers()) { allOnlineP.sendMessage(ChatColor.DARK_GREEN+"<=========["+ChatColor.LIGHT_PURPLE+"Interest"+ChatColor.DARK_GREEN+"]=========>"); DecimalFormat df = new DecimalFormat("#0.00"); allOnlineP.sendMessage(ChatColor.GOLD+"The money interest has been delivered to all players. ("+df.format((double)(Main.this.getConfig().getDouble("payday.amount")*100))+"% interest rate)"); allOnlineP.sendMessage(ChatColor.GOLD+"Your Balance: $"+df.format((getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))+" -> $"+df.format(((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))))); allOnlineP.sendMessage(ChatColor.DARK_GREEN+"<==========================>"); getAccountsConfig().set(allOnlineP.getName().toLowerCase() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))); //Main.economy.depositPlayer(allOnlineP.getName().toLowerCase(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName().toLowerCase()).balance)); } for (OfflinePlayer allOnlineP : Bukkit.getOfflinePlayers()) { if (!allOnlineP.isOnline()) { getAccountsConfig().set(allOnlineP.getName().toLowerCase() + ".money", ((Main.this.getConfig().getDouble("payday.amount")*(getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money"))+getAccountsConfig().getDouble(allOnlineP.getName().toLowerCase() + ".money")))); } //Main.economy.depositPlayer(allOnlineP.getName().toLowerCase(), (Main.this.getConfig().getDouble("payday.amount")*Main.economy.bankBalance(allOnlineP.getName().toLowerCase()).balance)); } //saveAccountsConfig() //Commented out; List expired_uuids = new ArrayList(); String moblist = getConfig().getString("fed.mobs"); String finalstring = ""; int removed_count=0; if (getConfig().getString("fed.mobs").length()>4) { String[] mobslist = moblist.split(","); for (int i=0;iLong.valueOf(mobslist[i+1])) { expired_uuids.add(UUID.fromString(mobslist[i])); } else { //Send this back for holding on until next time. //Reconstruct the data if (finalstring.equalsIgnoreCase("")) { finalstring+=mobslist[i]+","+mobslist[i+1]; } else { finalstring+=","+mobslist[i]+","+mobslist[i+1]; } } } //Check all spawned entities in the world. List world_entities = Bukkit.getWorld("world").getEntities(); for (int i=0;i=40) { getAccountsConfig().set(p.getName().toLowerCase()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob])); //saveAccountsConfig() //Commented out; p.sendMessage(ChatColor.YELLOW+"Set Declared Ultimate job to "+job); p.sendMessage(""); p.sendMessage(ChatColor.GOLD+""+ChatColor.ITALIC+"Unlike other buffs, you do not just receive the buff immediately. You have to earn it."); p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+"Earn enough job exp to be proven worthy, and then search mob drops for a special trinket. The more exp you have built up, the better the chance you'll find one."); p.sendMessage(""); p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"(Note you can still change your declared ultimate at any time during this time.)"); } else { p.sendMessage(ChatColor.GOLD+"Sorry, you are not a high enough level in that job yet!"); return; } } else { p.sendMessage(ChatColor.GOLD+"Sorry, you are not in that job!"); return; } } public boolean joinJob(Player p, String job) { //Verify this is a valid job we can join. boolean valid=false; int matchedjob=0; for (int i=0;i=3) { p.sendMessage(ChatColor.GOLD+"Sorry, you are already in 3 jobs!"); return false; } Bukkit.getLogger().info("Max Job count checked."); if (PlayerinJob(p,job)) { p.sendMessage(ChatColor.GOLD+"Sorry, you are already in this job!"); return false; } Bukkit.getLogger().info("Player's not in job checked."); if (getConfig().getInt("jobs."+ValidJobs[matchedjob])>=getConfig().getInt("jobs.MAX_JOBS")) { p.sendMessage(ChatColor.GOLD+"Sorry, there are already "+getConfig().getInt("jobs.MAX_JOBS")+" people in this job!"); return false; } if (getConfig().getInt("jobs."+ValidJobs[matchedjob])==0) { //Simply set the string. getConfig().set("jobs."+ValidJobs[matchedjob]+"_members",String.valueOf(p.getName().toLowerCase())); } else { //Append to list. getConfig().set("jobs."+ValidJobs[matchedjob]+"_members",String.valueOf(getConfig().getString("jobs."+ValidJobs[matchedjob]+"_members")+", "+p.getName().toLowerCase())); } if (getConfig().getInt("jobs."+ValidJobs[matchedjob])==0) { //Simply set the string. getConfig().set("jobs."+ValidJobs[matchedjob]+"_members",String.valueOf(p.getName().toLowerCase())); } else { //Append to list. getConfig().set("jobs."+ValidJobs[matchedjob]+"_members",String.valueOf(getConfig().getString("jobs."+ValidJobs[matchedjob]+"_members")+", "+p.getName().toLowerCase())); } Bukkit.getLogger().info("Well, they are allowed to join this job."); //Add 1 to main config. getConfig().set("jobs."+ValidJobs[matchedjob], Integer.valueOf(getConfig().getInt("jobs."+ValidJobs[matchedjob])+1)); saveConfig(); Bukkit.getLogger().info("Saved the config."); //We can add them into this new job. //Check for the slot we have "None" job in first. int openslot=0; for (int i=0;i<3;i++) { if (getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job"+(i+1)).equalsIgnoreCase("None")) { openslot=i; Bukkit.getLogger().info("Found a None job slot."); break; } } if (ValidJobs[matchedjob].compareTo("Explorer")==0) { explorerlist.add(new ExplorerData(p.getName().toLowerCase(), p.getLocation().getX(), p.getLocation().getZ())); } if (ValidJobs[matchedjob].compareTo("Support")==0) { supportplayers.add(new SupportPlayer(p)); } if (ValidJobs[matchedjob].compareTo("Hunter")==0) { hunterplayers.add(p); } Bukkit.getLogger().info("Added extra job pieces when joining."); getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(openslot+1), String.valueOf(ValidJobs[matchedjob])); getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(openslot+1)+"lv", Integer.valueOf(1)); getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(openslot+1)+"exp", Double.valueOf(0)); //saveAccountsConfig() //Commented out; Bukkit.getLogger().info("Set job data."); Bukkit.broadcastMessage(p.getName().toLowerCase()+" has joined the "+JobColors[matchedjob]+ValidJobs[matchedjob]+ChatColor.WHITE+" job!"); p.sendMessage("You can check out your job progress anytime with "+ChatColor.GOLD+"/jobs stats"+ChatColor.WHITE+"."); return true; } public String[] getJobs(Player p) { return getJobs(p.getName()); } public String[] getJobs(String p) { p=p.toLowerCase(); String[] string= {getAccountsConfig().getString(p.toLowerCase()+".jobs.job1"),getAccountsConfig().getString(p.toLowerCase()+".jobs.job2"),getAccountsConfig().getString(p.toLowerCase()+".jobs.job3")}; return string; } public boolean PlayerinJob(String p,String job) { p=p.toLowerCase(); String[] jobs = getJobs(p); for (int i=0;i0) { p.sendMessage(ChatColor.GOLD+"You have earned 1 stat point! You now have "+(((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))+" stat point"+((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))==1?"":"s")+" to spend. "+ChatColor.ITALIC+ChatColor.BLUE+" Type /sp to spend them!"); } } } //saveAccountsConfig() //Commented out; } public void levelUpJob(Player p, String job) { //If they have a job token, then do this. Otherwise they are not allowed. boolean has_job_token=false; ItemStack j = new ItemStack(Material.getMaterial(34)); ItemMeta meta = j.getItemMeta(); meta.setDisplayName(ChatColor.LIGHT_PURPLE+"Job Boost Card"); List lore = new ArrayList(); lore.add("Use /jobs boost to instantly level up"); lore.add("that job with this card!"); meta.setLore(lore); j.setItemMeta(meta); if (p.getInventory().containsAtLeast(j, 1)) { String[] jobs = getJobs(p); int slot=-1; JobsDataInfo[] Jobsinfo = {Woodcutter_job,Miner_job,Builder_job,Digger_job,Farmer_job,Hunter_job,Fisherman_job,Weaponsmith_job,Blacksmith_job,Cook_job,Brewer_job,Enchanter_job,Breeder_job,Explorer_job,Support_job}; for (int i=0;i0) { p.sendMessage(ChatColor.GOLD+"You have earned 1 stat point! You now have "+(((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))+" stat point"+((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))==1?"":"s")+" to spend. "+ChatColor.ITALIC+ChatColor.BLUE+" Type /sp to spend them!"); } } //saveAccountsConfig() //Commented out; p.getInventory().removeItem(j); } else { p.sendMessage(ChatColor.GOLD+"You can't level this job. It is already at max level."); } } else { p.sendMessage(ChatColor.GOLD+"Sorry, that is not a valid job!"); } } else { p.sendMessage(ChatColor.GOLD+"Sorry, you cannot do this!"); } } public void gainMoney(Player p,String job,double amount) { String[] jobs = getJobs(p); int slot=-1; if (getConfig().getBoolean("halloween-enabled") || getConfig().getBoolean("thanksgiving-enabled")) { amount*=2; } //Add to how much we've earned so far. for (int i=0;i enchant_data = new ArrayList(); //OMGGGG. forgot to initialize the dang list! if (item.getType()==Material.STONE_HOE || item.getType()==Material.IRON_HOE || item.getType()==Material.WOOD_HOE || item.getType()==Material.GOLD_HOE || item.getType()==Material.DIAMOND_HOE) { enchant_data=ENCHANTMENT_DATA.stone_hoe; } else //DERP if (item.getType()==Material.BOW) {enchant_data=ENCHANTMENT_DATA.bow;} else if (item.getType()==Material.IRON_SWORD) {enchant_data=ENCHANTMENT_DATA.iron_sword;} else if (item.getType()==Material.GOLD_SWORD) {enchant_data=ENCHANTMENT_DATA.golden_sword;} else if (item.getType()==Material.DIAMOND_SWORD) {enchant_data=ENCHANTMENT_DATA.diamond_sword;} else if (item.getType()==Material.STONE_SPADE) {enchant_data=ENCHANTMENT_DATA.stone_shovel;} else if (item.getType()==Material.STONE_PICKAXE) {enchant_data=ENCHANTMENT_DATA.stone_pickaxe;} else if (item.getType()==Material.LEATHER_BOOTS) {enchant_data=ENCHANTMENT_DATA.leather_boots;} else if (item.getType()==Material.LEATHER_LEGGINGS) {enchant_data=ENCHANTMENT_DATA.leather_pants;} else if (item.getType()==Material.LEATHER_CHESTPLATE) {enchant_data=ENCHANTMENT_DATA.leather_tunic;} else if (item.getType()==Material.LEATHER_HELMET) {enchant_data=ENCHANTMENT_DATA.leather_cap;} else if (item.getType()==Material.IRON_SPADE) {enchant_data=ENCHANTMENT_DATA.iron_shovel;} else if (item.getType()==Material.IRON_BOOTS) {enchant_data=ENCHANTMENT_DATA.iron_boots;} else if (item.getType()==Material.IRON_PICKAXE) {enchant_data=ENCHANTMENT_DATA.iron_pickaxe;} else if (item.getType()==Material.IRON_HELMET) {enchant_data=ENCHANTMENT_DATA.iron_helmet;} else if (item.getType()==Material.IRON_AXE) {enchant_data=ENCHANTMENT_DATA.iron_axe;} else if (item.getType()==Material.GOLD_SPADE) {enchant_data=ENCHANTMENT_DATA.golden_shovel;} else if (item.getType()==Material.GOLD_AXE) {enchant_data=ENCHANTMENT_DATA.golden_axe;} else if (item.getType()==Material.IRON_LEGGINGS) {enchant_data=ENCHANTMENT_DATA.iron_leggings;} else if (item.getType()==Material.DIAMOND_SPADE) {enchant_data=ENCHANTMENT_DATA.diamond_shovel;} else if (item.getType()==Material.GOLD_BOOTS) {enchant_data=ENCHANTMENT_DATA.golden_boots;} else if (item.getType()==Material.GOLD_HELMET) {enchant_data=ENCHANTMENT_DATA.golden_helmet;} else if (item.getType()==Material.IRON_CHESTPLATE) {enchant_data=ENCHANTMENT_DATA.iron_chestplate;} else if (item.getType()==Material.DIAMOND_PICKAXE) {enchant_data=ENCHANTMENT_DATA.diamond_pickaxe;} else if (item.getType()==Material.DIAMOND_BOOTS) {enchant_data=ENCHANTMENT_DATA.diamond_boots;} else if (item.getType()==Material.DIAMOND_AXE) {enchant_data=ENCHANTMENT_DATA.diamond_axe;} else if (item.getType()==Material.GOLD_LEGGINGS) {enchant_data=ENCHANTMENT_DATA.golden_leggings;} else if (item.getType()==Material.GOLD_CHESTPLATE) {enchant_data=ENCHANTMENT_DATA.golden_chestplate;} else if (item.getType()==Material.DIAMOND_HELMET) {enchant_data=ENCHANTMENT_DATA.diamond_helmet;} else if (item.getType()==Material.DIAMOND_LEGGINGS) {enchant_data=ENCHANTMENT_DATA.diamond_leggings;} else if (item.getType()==Material.DIAMOND_CHESTPLATE) {enchant_data=ENCHANTMENT_DATA.diamond_chestplate;} if (item.getType()==Material.CHAINMAIL_HELMET) {enchant_data=ENCHANTMENT_DATA.chain_helmet;} else if (item.getType()==Material.CHAINMAIL_CHESTPLATE) {enchant_data=ENCHANTMENT_DATA.chain_chestplate;} else if (item.getType()==Material.CHAINMAIL_LEGGINGS) {enchant_data=ENCHANTMENT_DATA.chain_leggings;} else if (item.getType()==Material.CHAINMAIL_BOOTS) {enchant_data=ENCHANTMENT_DATA.chain_boots;} int enchantments=0; int iterations=0; while (enchantments==0 && iterations<100) { //Attempt to enchant it, up to 100 tries. iterations++; //Bukkit.getPlayer("sigonasr2").sendMessage("Enchant data size is "+enchant_data.size()); for (int i=0;i map = item.getEnchantments(); boolean silk_touch=false; boolean fortune=false; if (PlayerinJob(p, "Enchanter")) { for (Map.Entry entry : map.entrySet()) { if (getJobLv("Enchanter", p)>=20) { if (entry.getKey().getMaxLevel() thelore = item.getItemMeta().getLore(); for (int i=0;i=5) { return true; } else { return false; } } case JOB10: { if (level>=10) { return true; } else { return false; } } case JOB20: { if (level>=20) { return true; } else { return false; } } case JOB30A: { if (level>=30 && getAccountsConfig().getInt(p.toLowerCase()+".jobs.job"+(slot+1)+"_30")==1) { return true; } else { return false; } } case JOB30B: { if (level>=30 && getAccountsConfig().getInt(p.toLowerCase()+".jobs.job"+(slot+1)+"_30")==2) { return true; } else { return false; } } case JOB40: { if (getAccountsConfig().getString(p.toLowerCase()+".jobs.ultimate").equalsIgnoreCase(job) && getAccountsConfig().getBoolean(p.toLowerCase()+".jobs.ultimatesealed")) { //Bukkit.getLogger().info("Inside 3."); return true; } else { return false; } } default: { return false; } } } else { return false; } } return false; } public int getPlayerDataSlot(Player p) { //Find my data. for (int i=0;i chestlore = new ArrayList(); double rand = 1; // Randomly generated number determined by fair dice roll. if (tier == -1) { rand = Math.random(); // No argument, randomize } if (tier == 0) { // Invalid chest, don't return anything Bukkit.getLogger().warning("Invalid loot chest detected! This should never happen."); return null; } if (rand < 0.005 || tier == 2) { // Generate a mythic chest chest_name.setDisplayName(ChatColor.LIGHT_PURPLE+"Mythic Chest"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"You feel powerful magic"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"emanating from within;"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"it must contain epic"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"equipment!"); chest_name.setLore(chestlore); chest.setItemMeta(chest_name); } else if (rand < 0.02 || tier == 3) { // Generate a loaded goods chest chest_name.setDisplayName(ChatColor.AQUA+"Heavy Chest"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"It is very heavy; there"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"may be lots of loot within!"); chest_name.setLore(chestlore); chest.setItemMeta(chest_name); } else if (rand < 0.04 || tier == 5) { // Generate a chaos chest chest_name.setDisplayName(ChatColor.RED+"Chaos Chest"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A torrential flow of dark"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"energy causes the chest to"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"shake uncontrollably! You"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"have absolutely zero idea"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"what may be inside."); chest_name.setLore(chestlore); chest.setItemMeta(chest_name); } else if (rand < 0.12 || tier == 4) { // Generate a loaded chest chest_name.setDisplayName(ChatColor.YELLOW+"Loaded Chest"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"You can feel a variety of"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"items rattling around inside."); chest_name.setLore(chestlore); chest.setItemMeta(chest_name); } else { chest_name.setDisplayName(ChatColor.YELLOW+"Closed Chest"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"Something is rattling"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"around inside; it may"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"contain valuables!"); chest_name.setLore(chestlore); chest.setItemMeta(chest_name); } return chest; } public PlayerListener.Cube get_ItemCubeType(ItemStack item_cube) { if (item_cube.hasItemMeta() && item_cube.getItemMeta().hasLore()) { //Check to see if the Lore contains anything. for (int i=0;i permanent_properties = new ArrayList(); permanent_properties.add(ChatColor.RED+"-400% Durability"); permanent_properties.add(ChatColor.RED+"Duplicated"); if (permanent_properties.contains(property)) { return true; } else { return false; } } public double getEnchantmentNumb(String s) { //Parse the string for spaces. String[] enchant = s.split(" "); if (enchant[0].contains(ChatColor.YELLOW+"")) { String newstring = ((enchant[0].replace(ChatColor.YELLOW.getChar(), ' ')).replace('%', ' ')).replace(Character.toString((char)0x00A7), Character.toString((char)0x0020)); //Bukkit.getLogger().info("Enchant number is "+Double.valueOf(newstring)); return Double.valueOf(newstring); } else { return 0; } } public boolean hasDistortionOrb(Player p) { for (int m=0;m data = p.getInventory().getContents()[m].getItemMeta().getLore(); for (int i=0;i data = p.getInventory().getContents()[m].getItemMeta().getLore(); for (int i=0;i=30) { if (arg2.equals("1") || arg2.equals("2")) { if (getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(getPlayerJobSlot(arg1, p))+"_30")==0) { //We are making a valid choice. getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(getPlayerJobSlot(arg1, p))+"_30",Integer.valueOf(arg2)); //saveAccountsConfig() //Commented out; p.sendMessage(ChatColor.GREEN+"You have set your Lv30 Buff choice for your "+arg1+" job to the "+((Integer.valueOf(arg2)==1)?"first":"second")+" version."); } else { p.sendMessage(ChatColor.RED+"Sorry, you already picked your Lv30 Buff Choice for that job! You can't change it."); } } else { p.sendMessage("Usage: "+ChatColor.GREEN+"/jobs [JobName] 1"+ChatColor.WHITE+" or "+ChatColor.GREEN+"/jobs [JobName] 2"+ChatColor.WHITE+" - Set Lv30 Buff Choice."); } } else { p.sendMessage(ChatColor.RED+"Sorry, you are not a high enough level in that job to set your buff choice yet!"); } } public void notifyBuffMessages(Player p) { notifyBuffMessages(p, 20); } /** * * @param numb The number to convert to Roman Numerals. * @return A String version of the number converted in Roman Numeral Format. */ public String toRomanNumeral(int numb) { String[] ones = {"I","II","III","IV","V","VI","VII","VIII","IX"}; String[] tens = {"X","XX","XXX","XL","L","LX","LXX","LXXX","XC"}; String[] hundreds = {"C","CC","CCC","CD","D","DC","DCC","DCCC","CM"}; String RomanNumeral = ""; if (numb>999) { //The number is too big for our converter. return String.valueOf(numb); } else { String numb_reader = String.valueOf(numb); //Bukkit.getLogger().info("Number is "+numb_reader+". Length is "+numb_reader.length()); int offset = 3-numb_reader.length(); for (int i=0;i LoreData = item.getItemMeta().getLore(); ItemMeta meta = item.getItemMeta(); List newLoreData = new ArrayList(); //First find all 'extra' special enchantments. for (int i=0;i lore = new ArrayList(); if (type==2) { int bonus_enchant1 = (int)(Math.random()*6); //0-5. int bonus_enchant2 = (int)(Math.random()*6); //0-5. while (bonus_enchant2==bonus_enchant1) { bonus_enchant2 = (int)(Math.random()*6); } switch (bonus_enchant1) { case 0: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*32)+16+1)+" "+ChatColor.BLUE+"Health"); }break; case 1: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+20+1)+"% "+ChatColor.BLUE+"Damage Reduction"); }break; case 2: { lore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*200)+100+1)*10)+"% "+ChatColor.BLUE+"Durability"); }break; case 3: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+10+1)+"% "+ChatColor.BLUE+"Block Chance"); }break; case 4: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*35)+20+1)+"% "+ChatColor.BLUE+"Speed Boost Chance"); }break; case 5: { lore.add(ChatColor.GRAY+"Sturdy "+toRomanNumeral((int)(Math.random()*9)+2)); }break; } switch (bonus_enchant2) { case 0: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*16)+8+1)+" "+ChatColor.BLUE+"Health"); }break; case 1: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*15)+10+1)+"% "+ChatColor.BLUE+"Damage Reduction"); }break; case 2: { lore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*100)+50+1)*10)+"% "+ChatColor.BLUE+"Durability"); }break; case 3: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*15)+5+1)+"% "+ChatColor.BLUE+"Block Chance"); }break; case 4: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*16)+10+1)+"% "+ChatColor.BLUE+"Speed Boost Chance"); }break; case 5: { lore.add(ChatColor.GRAY+"Sturdy "+toRomanNumeral((int)(Math.random()*4)+1)); }break; } } else { int bonus_enchant1 = (int)(Math.random()*5); //0-4. int bonus_enchant2 = (int)(Math.random()*5); //0-4. while (bonus_enchant2==bonus_enchant1) { bonus_enchant2 = (int)(Math.random()*5); } switch (bonus_enchant1) { case 0: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+20+1)+"% "+ChatColor.BLUE+"Critical Chance"); }break; case 1: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+4+1)+" "+ChatColor.BLUE+"Armor Penetration"); }break; case 2: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+20+1)+"% "+ChatColor.BLUE+"Life Steal"); }break; case 3: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*90)+60+1)+"% "+ChatColor.BLUE+"Attack Speed"); }break; case 4: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*15)+10+1)+" "+ChatColor.BLUE+"Damage"); }break; } switch (bonus_enchant2) { case 0: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*15)+10+1)+"% "+ChatColor.BLUE+"Critical Chance"); }break; case 1: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*5)+2+1)+" "+ChatColor.BLUE+"Armor Penetration"); }break; case 2: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*15)+10+1)+"% "+ChatColor.BLUE+"Life Steal"); }break; case 3: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*45)+30+1)+"% "+ChatColor.BLUE+"Attack Speed"); }break; case 4: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*7)+5+1)+" "+ChatColor.BLUE+"Damage"); }break; } } ItemMeta meta = legendary.getItemMeta(); meta.setLore(lore); meta.setDisplayName(ChatColor.BOLD+"Spiritual"+" " + itemname); legendary.setItemMeta(meta); sortEnchantments(legendary); return legendary; } default: { return new ItemStack(Material.AIR); //Something bad happened. So we just return nothing / a null item. } } } else { //This is an actual Artifact piece. Has extremely strong stats with very high durability. String itemname = ""; if (!diamond) { itemname+="Iron"; } else { itemname+="Diamond"; } int type=1; double random_choose = Math.random()*9.0d; //Bukkit.getLogger().info("Random choose is "+random_choose); switch ((int)random_choose) { case 0: { itemname+=" Chestplate"; type=2; }break; case 1: { itemname+=" Helmet"; type=2; }break; case 2: { itemname+=" Leggings"; type=2; }break; case 3: { itemname+=" Boots"; type=2; }break; case 4: { itemname+=" Pickaxe"; type=1; }break; case 5: { itemname+=" Axe"; type=1; }break; case 6: { itemname+=" Spade"; type=1; }break; case 7: { itemname+=" Sword"; type=1; } case 8: { itemname="Bow"; type=1; }break; } //Choose a random enchanment. int randomenchant = (int)(Math.random()*enchantment_id_list.length); int enchantcount=0; List lore = new ArrayList(); if (type==2) { int bonus_enchant1 = (int)(Math.random()*6); //0-5. int enchant_count = 0; boolean[] done = {false, false, false, false, false, false}; while (enchant_count<3) { switch (bonus_enchant1) { case 0: { if (!done[bonus_enchant1]) { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*32)+16+1)+" "+ChatColor.BLUE+"Health"); enchant_count++; } }break; case 1: { if (!done[bonus_enchant1]) { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+20+1)+"% "+ChatColor.BLUE+"Damage Reduction"); enchant_count++; } }break; case 2: { if (!done[bonus_enchant1]) { lore.add(ChatColor.YELLOW+"+"+(((int)(Math.random()*200)+100+1)*10)+"% "+ChatColor.BLUE+"Durability"); enchant_count++; } }break; case 3: { if (!done[bonus_enchant1]) { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+10+1)+"% "+ChatColor.BLUE+"Block Chance"); enchant_count++; } }break; case 4: { if (!done[bonus_enchant1]) { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*35)+20+1)+"% "+ChatColor.BLUE+"Speed Boost Chance"); enchant_count++; } }break; case 5: { if (!done[bonus_enchant1]) { lore.add(ChatColor.GRAY+"Sturdy "+toRomanNumeral((int)(Math.random()*9)+2)); } }break; } done[bonus_enchant1]=true; bonus_enchant1 = (int)(Math.random()*6); } } else { int bonus_enchant1 = (int)(Math.random()*5); //0-4. int enchant_count = 0; boolean[] done = {false, false, false, false, false}; while (enchant_count<3) { if (!done[bonus_enchant1]) { switch (bonus_enchant1) { case 0: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+20+1)+"% "+ChatColor.BLUE+"Critical Chance"); }break; case 1: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*10)+4+1)+" "+ChatColor.BLUE+"Armor Penetration"); }break; case 2: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*30)+20+1)+"% "+ChatColor.BLUE+"Life Steal"); }break; case 3: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*90)+60+1)+"% "+ChatColor.BLUE+"Attack Speed"); }break; case 4: { lore.add(ChatColor.YELLOW+"+"+((int)(Math.random()*15)+10+1)+" "+ChatColor.BLUE+"Damage"); }break; } enchant_count++; done[bonus_enchant1]=true; } bonus_enchant1 = (int)(Math.random()*5); } } ItemStack legendary = new ItemStack(Material.getMaterial(itemname.toUpperCase().replace(" ", "_"))); while (enchantcount cl, String method) { for (Method m : cl.getMethods()) if (m.getName().equals(method)) return m; return null; } /** * Explodes random firework on location * * @param loc * Location to explode */ public static void playFirework(Location loc) { Random gen = new Random(); try { Firework fw = loc.getWorld().spawn(loc, Firework.class); Method d0 = getMethod(loc.getWorld().getClass(), "getHandle"); Method d2 = getMethod(fw.getClass(), "getHandle"); Object o3 = d0.invoke(loc.getWorld(), (Object[]) null); Object o4 = d2.invoke(fw, (Object[]) null); Method d1 = getMethod(o3.getClass(), "broadcastEntityEffect"); FireworkMeta data = fw.getFireworkMeta(); data.addEffect(FireworkEffect .builder() .with(FireworkEffect.Type.values()[gen .nextInt(FireworkEffect.Type.values().length)]) .flicker(gen.nextBoolean()) .trail(gen.nextBoolean()) .withColor( Color.fromRGB(gen.nextInt(255), gen.nextInt(255), gen.nextInt(255))) .withFade( Color.fromRGB(gen.nextInt(255), gen.nextInt(255), gen.nextInt(255))).build()); fw.setFireworkMeta(data); d1.invoke(o3, new Object[] { o4, (byte) 17 }); fw.remove(); } catch (Exception ex) { // not a Beta1.4.6R0.2 Server } } public void notifyBuffMessages(final Player p, int tick_delay) { //Same as notifyBuffMessages(), but waits a number of ticks before displaying it. //See which messages we have to display. int total_tick_delay=tick_delay; if (getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job1lv")>=30 && getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job1_30")==0) { //Have not selected first job's buff. Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { @Override public void run() { String job = getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job1"); int color_slot = 0; for (int i=0;i=30 && getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job2_30")==0) { //Have not selected first job's buff. Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { @Override public void run() { String job = getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job2"); int color_slot = 0; for (int i=0;i=30 && getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job3_30")==0) { //Have not selected first job's buff. Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { @Override public void run() { String job = getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"); int color_slot = 0; for (int i=0;i=30 && getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job3_30")==0) { //Have not selected first job's buff. Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { @Override public void run() { String job = getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"); int color_slot = 0; for (int i=0;i=40 || getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job2lv")>=40 || getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job3lv")>=40) && !getAccountsConfig().getBoolean(p.getName().toLowerCase()+".jobs.ultimatesealed")) { Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { @Override public void run() { String job = getAccountsConfig().getString(p.getName().toLowerCase()+".jobs.job3"); int color_slot = 0; for (int i=0;i"+ChatColor.RESET+ChatColor.ITALIC+" replacing it with the ultimate job you want!"); } },total_tick_delay+=tick_delay); } } }