Added recipe for crafting a nether star from wither skeleton skulls,

using an existing nether star, soul sand, and diamonds. Added recipe for
crafting water source blocks using buckets and a nether star. Added
pocket crafting table.
dev
Nonoriri 11 years ago
parent 53bfd54fb3
commit 64fb7e6e02
  1. 67
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 17
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -62,6 +62,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.ShapedRecipe; import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta; import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.map.MapRenderer; import org.bukkit.map.MapRenderer;
@ -303,6 +304,60 @@ public class Main extends JavaPlugin
melon_slice.setIngredient('a', Material.MELON_BLOCK); melon_slice.setIngredient('a', Material.MELON_BLOCK);
Bukkit.addRecipe(melon_slice); 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<String> waterlore = new ArrayList<String>();
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 Recipe for pocket crafting table
ItemStack table = new ItemStack(Material.WORKBENCH);
ItemMeta table_name = water.getItemMeta();
table_name.setDisplayName(ChatColor.YELLOW+"Pocket Crafting Table");
List<String> tablelore = new ArrayList<String>();
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. //Add wood slab recombining recipes.
ShapedRecipe oak_planks = new ShapedRecipe(new ItemStack(Material.WOOD, 1, (short) 0)); ShapedRecipe oak_planks = new ShapedRecipe(new ItemStack(Material.WOOD, 1, (short) 0));
oak_planks.shape("aa"); oak_planks.shape("aa");
@ -4703,6 +4758,18 @@ public void payDay(int time)
return false; return false;
} }
public boolean is_PocketWorkbench(ItemStack workbench) {
if (workbench.hasItemMeta() && workbench.getItemMeta().hasLore()) {
//Check to see if the Lore contains anything.
for (int i=0;i<workbench.getItemMeta().getLore().size();i++) {
if (workbench.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"This workbench can be")) {
return true;
}
}
}
return false;
}
public PlayerListener.Cube get_ItemCubeType(ItemStack item_cube) { public PlayerListener.Cube get_ItemCubeType(ItemStack item_cube) {
if (item_cube.hasItemMeta() && item_cube.getItemMeta().hasLore()) { if (item_cube.hasItemMeta() && item_cube.getItemMeta().hasLore()) {
//Check to see if the Lore contains anything. //Check to see if the Lore contains anything.

@ -9061,7 +9061,13 @@ implements Listener
e.setCancelled(true); e.setCancelled(true);
} }
if (this.plugin.is_ItemCube(e.getItemInHand())) { if (this.plugin.is_ItemCube(e.getItemInHand())) {
p.updateInventory();
e.setCancelled(true);
}
if (this.plugin.is_PocketWorkbench(e.getItemInHand())) {
p.updateInventory();
e.setCancelled(true); e.setCancelled(true);
return;
} }
return; return;
} }
@ -9887,6 +9893,11 @@ implements Listener
return; return;
} }
} }
if (this.plugin.is_PocketWorkbench(event.getCurrentItem()) && event.getClick()==ClickType.RIGHT) {
p.openWorkbench(null, true);
event.setCancelled(true);
return;
}
} }
}else }else
if (event.getInventory().getType()==InventoryType.CHEST && event.getInventory().getName().contains("Item Cube")) { if (event.getInventory().getType()==InventoryType.CHEST && event.getInventory().getName().contains("Item Cube")) {
@ -12936,6 +12947,12 @@ implements Listener
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
if (p.getItemInHand()!=null && this.plugin.is_PocketWorkbench(p.getItemInHand())) {
p.openWorkbench(null, true);
e.setCancelled(true);
return;
}
} }
if (blockAction == Action.RIGHT_CLICK_BLOCK) { if (blockAction == Action.RIGHT_CLICK_BLOCK) {
/*//CREATE THE GIANT PUMPKIN /*//CREATE THE GIANT PUMPKIN

Loading…
Cancel
Save