Update CraftBukkit to Minecraft 1.3.1

This commit is contained in:
feildmaster
2012-07-29 02:33:13 -05:00
committed by Travis Watkins
parent 08e2923bd4
commit a43d621c01
240 changed files with 10763 additions and 9150 deletions

View File

@@ -79,8 +79,8 @@ public class CraftContainer extends Container {
int type = getNotchInventoryType(cachedType);
IInventory top = ((CraftInventory)view.getTopInventory()).getInventory();
IInventory bottom = ((CraftInventory)view.getBottomInventory()).getInventory();
this.d.clear();
this.e.clear();
this.a.clear();
this.b.clear();
if (typeChanged) {
setupSlots(top, bottom);
}
@@ -275,4 +275,7 @@ public class CraftContainer extends Container {
// End copy from ContainerBrewingStand
}
public boolean c(EntityHuman entity) {
return true;
}
}

View File

@@ -1,6 +1,6 @@
package org.bukkit.craftbukkit.inventory;
import net.minecraft.server.FurnaceRecipes;
import net.minecraft.server.RecipesFurnace;
import org.bukkit.inventory.FurnaceRecipe;
import org.bukkit.inventory.ItemStack;
@@ -20,6 +20,6 @@ public class CraftFurnaceRecipe extends FurnaceRecipe implements CraftRecipe {
public void addToCraftingManager() {
ItemStack result = this.getResult();
ItemStack input = this.getInput();
FurnaceRecipes.getInstance().registerRecipe(input.getTypeId(), CraftItemStack.createNMSItemStack(result));
RecipesFurnace.getInstance().registerRecipe(input.getTypeId(), CraftItemStack.createNMSItemStack(result), 0.1f);
}
}

View File

@@ -1,6 +1,5 @@
package org.bukkit.craftbukkit.inventory;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
@@ -8,6 +7,8 @@ import java.util.ListIterator;
import net.minecraft.server.ContainerEnchantTableInventory;
import net.minecraft.server.IInventory;
import net.minecraft.server.InventoryCrafting;
import net.minecraft.server.InventoryEnderChest;
import net.minecraft.server.InventoryMerchant;
import net.minecraft.server.PlayerInventory;
import net.minecraft.server.TileEntityBrewingStand;
import net.minecraft.server.TileEntityDispenser;
@@ -411,6 +412,10 @@ public class CraftInventory implements Inventory {
return InventoryType.BREWING;
} else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
} else if (inventory instanceof InventoryEnderChest) {
return InventoryType.ENDER_CHEST;
} else if (inventory instanceof InventoryMerchant) {
return InventoryType.MERCHANT;
} else {
return InventoryType.CHEST;
}

View File

@@ -1,6 +1,6 @@
package org.bukkit.craftbukkit.inventory;
import net.minecraft.server.CraftingRecipe;
import net.minecraft.server.IRecipe;
import net.minecraft.server.IInventory;
import net.minecraft.server.InventoryCrafting;
@@ -132,7 +132,7 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn
}
public Recipe getRecipe() {
CraftingRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
return recipe == null ? null : recipe.toBukkitRecipe();
}
}

View File

@@ -139,5 +139,7 @@ public class CraftInventoryCustom extends CraftInventory {
public InventoryHolder getOwner() {
return owner;
}
public void startOpen() {}
}
}

View File

@@ -0,0 +1,10 @@
package org.bukkit.craftbukkit.inventory;
import net.minecraft.server.InventoryMerchant;
import org.bukkit.inventory.MerchantInventory;
public class CraftInventoryMerchant extends CraftInventory implements MerchantInventory {
public CraftInventoryMerchant(InventoryMerchant merchant) {
super(merchant);
}
}

View File

@@ -228,6 +228,8 @@ public class CraftItemStack extends ItemStack {
public static net.minecraft.server.ItemStack createNMSItemStack(ItemStack original) {
if (original == null || original.getTypeId() <= 0) {
return null;
} else if (original instanceof CraftItemStack) {
return ((CraftItemStack) original).getHandle();
}
return new CraftItemStack(original).getHandle();
}

View File

@@ -6,17 +6,17 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import net.minecraft.server.CraftingManager;
import net.minecraft.server.CraftingRecipe;
import net.minecraft.server.FurnaceRecipes;
import net.minecraft.server.IRecipe;
import net.minecraft.server.RecipesFurnace;
public class RecipeIterator implements Iterator<Recipe> {
private Iterator<CraftingRecipe> recipes;
private Iterator<IRecipe> recipes;
private Iterator<Integer> smelting;
private Iterator<?> removeFrom = null;
public RecipeIterator() {
this.recipes = CraftingManager.getInstance().getRecipies().iterator();
this.smelting = FurnaceRecipes.getInstance().getRecipies().keySet().iterator();
this.recipes = CraftingManager.getInstance().getRecipes().iterator();
this.smelting = RecipesFurnace.getInstance().getRecipes().keySet().iterator();
}
public boolean hasNext() {
@@ -34,7 +34,7 @@ public class RecipeIterator implements Iterator<Recipe> {
} else {
removeFrom = smelting;
int id = smelting.next();
CraftItemStack stack = new CraftItemStack(FurnaceRecipes.getInstance().getResult(id));
CraftItemStack stack = new CraftItemStack(RecipesFurnace.getInstance().getResult(id));
CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(stack, new ItemStack(id, 1, (short) -1));
return recipe;
}