From a59c956c81fc83fe3801cd13f022ffc66855fd52 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 23 Nov 2013 02:09:20 -0700 Subject: [PATCH] Starting Builder job buff updates. --- BankEconomyMod/plugin.yml | 6 ++- BankEconomyMod/src/me/kaZep/Base/Main.java | 2 + .../src/me/kaZep/Base/PlayerListener.java | 9 ++-- .../me/kaZep/Commands/commandBankEconomy.java | 42 +++++++++++++++++++ 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/BankEconomyMod/plugin.yml b/BankEconomyMod/plugin.yml index 21ee3a0..e295dcb 100644 --- a/BankEconomyMod/plugin.yml +++ b/BankEconomyMod/plugin.yml @@ -24,4 +24,8 @@ commands: event: description: Toggles or untoggles events. ticktime: - description: Displays the server tick time. \ No newline at end of file + description: Displays the server tick time. + line: + description: Gives the player a line builder tool. + rectangle: + description: Gives the player a rectangle builder tool. \ No newline at end of file diff --git a/BankEconomyMod/src/me/kaZep/Base/Main.java b/BankEconomyMod/src/me/kaZep/Base/Main.java index 5b373d2..175eb2a 100644 --- a/BankEconomyMod/src/me/kaZep/Base/Main.java +++ b/BankEconomyMod/src/me/kaZep/Base/Main.java @@ -224,6 +224,8 @@ public class Main extends JavaPlugin 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(); diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java index 9a96598..4b285f7 100644 --- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java +++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java @@ -19,9 +19,6 @@ import net.milkbowl.vault.economy.EconomyResponse; //import net.minecraft.server.v1_4_R1.EntityWolf; - - - import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Chunk; @@ -3183,10 +3180,10 @@ implements Listener private void breakOreBlock(Player p, Block b, boolean silk_touch, double xp_mult) { if (this.plugin.PlayerinJob(p, "Miner")) { - Bukkit.getLogger().info("This player is a miner."); + //Bukkit.getLogger().info("This player is a miner."); int myData=this.plugin.getPlayerDataSlot(p); if (this.plugin.playerdata_list.get(myData).GoodInteract()) { - Bukkit.getLogger().info("Good interact."); + //Bukkit.getLogger().info("Good interact."); if (b.getType()==Material.STONE) { this.plugin.gainMoneyExp(p,"Miner",0.0025,1); } else @@ -3195,7 +3192,7 @@ implements Listener } else if (b.getType()==Material.COAL_ORE && !silk_touch) { this.plugin.gainMoneyExp(p,"Miner",0.0125,3); - Bukkit.getLogger().info("Coal Ore."); + //Bukkit.getLogger().info("Coal Ore."); } else if (b.getType()==Material.GLOWSTONE && !silk_touch) { this.plugin.gainMoneyExp(p,"Miner",0.015,3); diff --git a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java index b8d557a..4e5fdab 100644 --- a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java +++ b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import me.kaZep.Base.Main; +import me.kaZep.Commands.JobsDataInfo.Job; import net.milkbowl.vault.economy.Economy; import org.bukkit.Bukkit; @@ -441,6 +442,47 @@ public String convertToItemName(String val) { p.sendMessage("Enchantments and bonuses removed on this item."); } else + if (cmd.getName().equalsIgnoreCase("line")) { + if (this.plugin.hasJobBuff("Builder", p, Job.JOB5)) { + p.sendMessage("You have received a line builder tool."); + ItemStack i = new ItemStack(Material.getMaterial(141)); + ItemMeta meta = i.getItemMeta(); + meta.setDisplayName(ChatColor.GRAY+"Line Builder Tool"); + List newlore = new ArrayList(); + newlore.add(ChatColor.YELLOW+"Can only be used by Lv5+ Builders."); + newlore.add(ChatColor.YELLOW+""); + newlore.add("Left-click one block and another"); + newlore.add("of the same type to create a line"); + newlore.add("of blocks. "+ChatColor.BLUE+"(Max Range: 500 blocks)"); + meta.setLore(newlore); + i.setItemMeta(meta); + p.getInventory().addItem(i); + } else { + p.sendMessage(ChatColor.RED+"You do not have the Lv5 Builder Buff!"); + } + } + else + if (cmd.getName().equalsIgnoreCase("rectangle")) { + if (this.plugin.hasJobBuff("Builder", p, Job.JOB10)) { + p.sendMessage("You have received a rectangle builder tool."); + ItemStack i = new ItemStack(Material.getMaterial(142)); + ItemMeta meta = i.getItemMeta(); + meta.setDisplayName(ChatColor.GRAY+"Rectangle Builder Tool"); + List newlore = new ArrayList(); + newlore.add(ChatColor.YELLOW+"Can only be used by Lv10+ Builders."); + newlore.add(ChatColor.YELLOW+""); + newlore.add("Left-click one block and another"); + newlore.add("of the same type to fill a"); + newlore.add("rectangle of blocks."); + newlore.add(ChatColor.BLUE+" (Max Range: 500 blocks)"); + meta.setLore(newlore); + i.setItemMeta(meta); + p.getInventory().addItem(i); + } else { + p.sendMessage(ChatColor.RED+"You do not have the Lv10 Builder Buff!"); + } + } + else if (cmd.getName().equalsIgnoreCase("ticktime")) { p.sendMessage("Current Server Time: "+ChatColor.GRAY+""+ChatColor.ITALIC+Main.SERVER_TICK_TIME); }