diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /src/main/java/net/minecraft/server/ShapedRecipes.java | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'src/main/java/net/minecraft/server/ShapedRecipes.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ShapedRecipes.java | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/src/main/java/net/minecraft/server/ShapedRecipes.java b/src/main/java/net/minecraft/server/ShapedRecipes.java deleted file mode 100644 index cc444db8..00000000 --- a/src/main/java/net/minecraft/server/ShapedRecipes.java +++ /dev/null @@ -1,159 +0,0 @@ -package net.minecraft.server; - -// CraftBukkit start -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; -// CraftBukkit end - -public class ShapedRecipes implements IRecipe { - - private int width; - private int height; - private ItemStack[] items; - private ItemStack result; - private boolean e; - - public ShapedRecipes(int i, int j, ItemStack[] aitemstack, ItemStack itemstack) { - this.width = i; - this.height = j; - this.items = aitemstack; - this.result = itemstack; - } - - // CraftBukkit start - public org.bukkit.inventory.ShapedRecipe toBukkitRecipe() { - CraftItemStack result = CraftItemStack.asCraftMirror(this.result); - CraftShapedRecipe recipe = new CraftShapedRecipe(result, this); - switch (this.height) { - case 1: - switch (this.width) { - case 1: - recipe.shape("a"); - break; - case 2: - recipe.shape("ab"); - break; - case 3: - recipe.shape("abc"); - break; - } - break; - case 2: - switch (this.width) { - case 1: - recipe.shape("a","b"); - break; - case 2: - recipe.shape("ab","cd"); - break; - case 3: - recipe.shape("abc","def"); - break; - } - break; - case 3: - switch (this.width) { - case 1: - recipe.shape("a","b","c"); - break; - case 2: - recipe.shape("ab","cd","ef"); - break; - case 3: - recipe.shape("abc","def","ghi"); - break; - } - break; - } - char c = 'a'; - for (ItemStack stack : this.items) { - if (stack != null) { - recipe.setIngredient(c, org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(stack.getItem()), stack.getData()); - } - c++; - } - return recipe; - } - // CraftBukkit end - - public ItemStack b() { - return this.result; - } - - public boolean a(InventoryCrafting inventorycrafting, World world) { - for (int i = 0; i <= 3 - this.width; ++i) { - for (int j = 0; j <= 3 - this.height; ++j) { - if (this.a(inventorycrafting, i, j, true)) { - return true; - } - - if (this.a(inventorycrafting, i, j, false)) { - return true; - } - } - } - - return false; - } - - private boolean a(InventoryCrafting inventorycrafting, int i, int j, boolean flag) { - for (int k = 0; k < 3; ++k) { - for (int l = 0; l < 3; ++l) { - int i1 = k - i; - int j1 = l - j; - ItemStack itemstack = null; - - if (i1 >= 0 && j1 >= 0 && i1 < this.width && j1 < this.height) { - if (flag) { - itemstack = this.items[this.width - i1 - 1 + j1 * this.width]; - } else { - itemstack = this.items[i1 + j1 * this.width]; - } - } - - ItemStack itemstack1 = inventorycrafting.b(k, l); - - if (itemstack1 != null || itemstack != null) { - if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) { - return false; - } - - if (itemstack.getItem() != itemstack1.getItem()) { - return false; - } - - if (itemstack.getData() != 32767 && itemstack.getData() != itemstack1.getData()) { - return false; - } - } - } - } - - return true; - } - - public ItemStack a(InventoryCrafting inventorycrafting) { - ItemStack itemstack = this.b().cloneItemStack(); - - if (this.e) { - for (int i = 0; i < inventorycrafting.getSize(); ++i) { - ItemStack itemstack1 = inventorycrafting.getItem(i); - - if (itemstack1 != null && itemstack1.hasTag()) { - itemstack.setTag((NBTTagCompound) itemstack1.tag.clone()); - } - } - } - - return itemstack; - } - - public int a() { - return this.width * this.height; - } - - public ShapedRecipes c() { - this.e = true; - return this; - } -} |