Chainmail crafting added. Ender Cubes fixed.

anvil_rework
Nonoriri 11 years ago
parent 08531a1930
commit a050020ced
  1. 36
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 43
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -343,6 +343,31 @@ public class Main extends JavaPlugin
nether_quartz.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 7).getData()); nether_quartz.setIngredient('a', new ItemStack(Material.STEP, 1, (short) 7).getData());
Bukkit.addRecipe(nether_quartz); 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 a","b a");
chain_boots.setIngredient('a', Material.IRON_BLOCK);
chain_boots.setIngredient('a', Material.IRON_INGOT);
Bukkit.addRecipe(chain_boots);
//Add Recipes for new Block armor crafting. //Add Recipes for new Block armor crafting.
ShapedRecipe iron_helmet = new ShapedRecipe(new ItemStack(Material.IRON_HELMET)); ShapedRecipe iron_helmet = new ShapedRecipe(new ItemStack(Material.IRON_HELMET));
iron_helmet.shape("aaa","a a"); iron_helmet.shape("aaa","a a");
@ -598,7 +623,7 @@ public class Main extends JavaPlugin
Farmer_job.addData("POTATO", 0.015, 3, 0); Farmer_job.addData("POTATO", 0.015, 3, 0);
Farmer_job.addData("NETHER WART", 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 SEEDS", 0.02, 4, 0);
//Farmer_job.addData("PUMPKIN", 0.04, 8, 0); Farmer_job.addData("PUMPKIN", 0.04, 8, 0);
Farmer_job.addData("MELON", 0.05, 10, 0); Farmer_job.addData("MELON", 0.05, 10, 0);
Farmer_job.addData("SEEDS", 0.0025, 1, 1); Farmer_job.addData("SEEDS", 0.0025, 1, 1);
Farmer_job.addData("PUMPKIN SEEDS", 0.005, 2, 1); Farmer_job.addData("PUMPKIN SEEDS", 0.005, 2, 1);
@ -712,6 +737,10 @@ public class Main extends JavaPlugin
Blacksmith_job.addData("WEAK DIAMOND HELMET", 1.15, 480, 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 LEGGINGS", 1.325, 660, 0);
Blacksmith_job.addData("WEAK DIAMOND CHESTPLATE", 1.50, 750, 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 BOOTS", 0.375*10, 80*10, 0);
Blacksmith_job.addData("IRON HELMET", 0.50*10, 100*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("IRON LEGGINGS", 0.725*10, 140*10, 0);
@ -3970,10 +3999,13 @@ public void payDay(int time)
if (item.getType()==Material.IRON_AXE) {enchant_data=ENCHANTMENT_DATA.iron_axe;} 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_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.GOLD_AXE) {enchant_data=ENCHANTMENT_DATA.golden_axe;} else
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;} else
if (item.getType()==Material.IRON_LEGGINGS) {enchant_data=ENCHANTMENT_DATA.iron_leggings;} 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.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_BOOTS) {enchant_data=ENCHANTMENT_DATA.golden_boots;} else
if (item.getType()==Material.IRON_CHESTPLATE) {enchant_data=ENCHANTMENT_DATA.iron_chestplate;} else
if (item.getType()==Material.GOLD_HELMET) {enchant_data=ENCHANTMENT_DATA.golden_helmet;} 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.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_PICKAXE) {enchant_data=ENCHANTMENT_DATA.diamond_pickaxe;} else

@ -3647,10 +3647,10 @@ public class PlayerListener
} }
/*if (e.getBlock().getType()==Material.PUMPKIN) { /*if (e.getBlock().getType()==Material.PUMPKIN) {
this.plugin.gainMoneyExp(p,"Farmer",0.00,1); this.plugin.gainMoneyExp(p,"Farmer",0.00,1);
}*/ }
if (e.getBlock().getType()==Material.MELON_BLOCK) { if (e.getBlock().getType()==Material.MELON_BLOCK) {
this.plugin.gainMoneyExp(p,"Farmer",0.10,10); this.plugin.gainMoneyExp(p,"Farmer",0.10,10);
} }*/
} }
boolean hasfortune; boolean hasfortune;
hasfortune = (p.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS)>0)?true:false; hasfortune = (p.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS)>0)?true:false;
@ -8325,7 +8325,7 @@ public ItemStack getGoodie() {
if (e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().getLore()!=null) { if (e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().getLore()!=null) {
//Check the Lore. //Check the Lore.
for (int i=0;i<e.getItemInHand().getItemMeta().getLore().size();i++) { for (int i=0;i<e.getItemInHand().getItemMeta().getLore().size();i++) {
if (e.getItemInHand().getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.AQUA+"Contains 9 item slots.") || e.getItemInHand().getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.AQUA+"Contains 54 item slots.")) { if (e.getItemInHand().getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.AQUA+"Contains 9 item slots.") || e.getItemInHand().getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.AQUA+"Contains 54 item slots.") || e.getItemInHand().getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.AQUA+"Contains 27 item slots.")) {
e.setCancelled(true); e.setCancelled(true);
p.updateInventory(); p.updateInventory();
//The intent is to open the inventory. //The intent is to open the inventory.
@ -10146,6 +10146,26 @@ public ItemStack getGoodie() {
this.plugin.gainMoneyExp(p,"Blacksmith",0.35*amount,40*amount); this.plugin.gainMoneyExp(p,"Blacksmith",0.35*amount,40*amount);
crafteditem=true; crafteditem=true;
} }
if (item.getType()==Material.CHAINMAIL_BOOTS) {
int mult=0.5;
this.plugin.gainMoneyExp(p,"Blacksmith",0.375*mult*amount,80*mult*amount);
crafteditem=true;
}
if (item.getType()==Material.CHAINMAIL_HELMET) {
int mult=0.5;
this.plugin.gainMoneyExp(p,"Blacksmith",0.50*mult*amount,100*mult*amount);
crafteditem=true;
}
if (item.getType()==Material.CHAINMAIL_LEGGINGS) {
int mult=0.5;
this.plugin.gainMoneyExp(p,"Blacksmith",0.725*mult*amount,140*mult*amount);
crafteditem=true;
}
if (item.getType()==Material.CHAINMAIL_CHESTPLATE) {
int mult=0.5;
this.plugin.gainMoneyExp(p,"Blacksmith",0.875*mult*amount,175*mult*amount);
crafteditem=true;
}
if (item.getType()==Material.IRON_BOOTS) { if (item.getType()==Material.IRON_BOOTS) {
int mult=1; int mult=1;
if ((item.getItemMeta().getDisplayName()!=null && !item.getItemMeta().getDisplayName().contains(ChatColor.DARK_AQUA+"Weak ")) || item.getItemMeta().getDisplayName()==null) { if ((item.getItemMeta().getDisplayName()!=null && !item.getItemMeta().getDisplayName().contains(ChatColor.DARK_AQUA+"Weak ")) || item.getItemMeta().getDisplayName()==null) {
@ -10275,6 +10295,23 @@ public ItemStack getGoodie() {
crafteditem=true; crafteditem=true;
} }
} }
/*if (e.getBlock().getType()==Material.PUMPKIN) {
this.plugin.gainMoneyExp(p,"Farmer",0.00,1);
}
if (e.getBlock().getType()==Material.MELON_BLOCK) {
this.plugin.gainMoneyExp(p,"Farmer",0.10,10);
}*/
if (this.plugin.PlayerinJob(p,"Farmer")) {
boolean crafteditem=false;
if (item.getType()==Material.MELON) {
this.plugin.gainMoneyExp(p,"Farmer",0.10,10);
crafteditem=true;
}
if (item.getType()==Material.PUMPKIN_SEEDS) {
this.plugin.gainMoneyExp(p,"Farmer",0.04,8);
crafteditem=true;
}
}
if (this.plugin.PlayerinJob(p,"Cook")) { if (this.plugin.PlayerinJob(p,"Cook")) {
boolean crafteditem=false; boolean crafteditem=false;
if (item.getType()==Material.BREAD) { if (item.getType()==Material.BREAD) {

Loading…
Cancel
Save