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. 19
      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.PlayerInventory;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.map.MapRenderer;
@ -302,6 +303,60 @@ public class Main extends JavaPlugin
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<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.
ShapedRecipe oak_planks = new ShapedRecipe(new ItemStack(Material.WOOD, 1, (short) 0));
@ -4703,6 +4758,18 @@ public void payDay(int time)
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) {
if (item_cube.hasItemMeta() && item_cube.getItemMeta().hasLore()) {
//Check to see if the Lore contains anything.

@ -4423,7 +4423,7 @@ implements Listener
if (result.getResult().getType()==Material.MELON_BLOCK) {
result.setResult(new ItemStack(Material.AIR));
}
// Increase stairs recipe efficiency
if (result.getResult().getType()==Material.WOOD_STAIRS) {
result.setResult(new ItemStack(Material.WOOD_STAIRS, 8));
@ -9061,8 +9061,14 @@ implements Listener
e.setCancelled(true);
}
if (this.plugin.is_ItemCube(e.getItemInHand())) {
p.updateInventory();
e.setCancelled(true);
}
if (this.plugin.is_PocketWorkbench(e.getItemInHand())) {
p.updateInventory();
e.setCancelled(true);
return;
}
return;
}
@ -9887,6 +9893,11 @@ implements Listener
return;
}
}
if (this.plugin.is_PocketWorkbench(event.getCurrentItem()) && event.getClick()==ClickType.RIGHT) {
p.openWorkbench(null, true);
event.setCancelled(true);
return;
}
}
}else
if (event.getInventory().getType()==InventoryType.CHEST && event.getInventory().getName().contains("Item Cube")) {
@ -12936,6 +12947,12 @@ implements Listener
e.setCancelled(true);
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) {
/*//CREATE THE GIANT PUMPKIN

Loading…
Cancel
Save