Files
MinecraftForge/patches/minecraft/net/minecraft/tileentity/TileEntityFurnace.java.patch
T
Christian 94eb5cc29b Fix a couple of forge patches
Update FML: d075daf
d075daf Merge branch 'master' into snapshot15 Fix up compilation and patching errors
1bd6847 Fix up packages.csv ordering for easier diffing
dd832f2 Update for MCP7.30c - fixes redstone rendering issues
aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti
8921cfe Remember to add the new patches!
cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. Also, added in a "pre-server
e1c6630 Javadoc cleanup
5ce4e31 Fix breaking change
a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates
94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates
7ad8529 Update MCP to MCP7.26a and refresh MCP names
15534ed Update address of the FML repository to the new location in all the files
aa822e3 Fix logical error in comment text
a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing.
0165742 Fix mcp conf md5 signatures for the snapshot
26a5b31 FMLLogFormatter: dynamic log level name
2013-01-22 17:03:33 -05:00

119 lines
4.8 KiB
Diff

--- ../src_base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java
+++ ../src_work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java
@@ -9,6 +9,7 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
@@ -16,8 +17,9 @@
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
-
-public class TileEntityFurnace extends TileEntity implements ISidedInventory
+import net.minecraftforge.common.ForgeDirection;
+
+public class TileEntityFurnace extends TileEntity implements ISidedInventory, net.minecraftforge.common.ISidedInventory
{
/**
* The ItemStacks that hold the items currently being used in the furnace
@@ -268,8 +270,7 @@
if (this.furnaceItemStacks[1].stackSize == 0)
{
- Item item = this.furnaceItemStacks[1].getItem().getContainerItem();
- this.furnaceItemStacks[1] = item != null ? new ItemStack(item) : null;
+ this.furnaceItemStacks[1] = this.furnaceItemStacks[1].getItem().getContainerItemStack(furnaceItemStacks[1]);
}
}
}
@@ -315,8 +316,12 @@
}
else
{
- ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID);
- return itemstack == null ? false : (this.furnaceItemStacks[2] == null ? true : (!this.furnaceItemStacks[2].isItemEqual(itemstack) ? false : (this.furnaceItemStacks[2].stackSize < this.getInventoryStackLimit() && this.furnaceItemStacks[2].stackSize < this.furnaceItemStacks[2].getMaxStackSize() ? true : this.furnaceItemStacks[2].stackSize < itemstack.getMaxStackSize())));
+ ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
+ if (itemstack == null) return false;
+ if (this.furnaceItemStacks[2] == null) return true;
+ if (!this.furnaceItemStacks[2].isItemEqual(itemstack)) return false;
+ int result = furnaceItemStacks[2].stackSize + itemstack.stackSize;
+ return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
}
}
@@ -327,15 +332,15 @@
{
if (this.canSmelt())
{
- ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID);
+ ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
if (this.furnaceItemStacks[2] == null)
{
this.furnaceItemStacks[2] = itemstack.copy();
}
- else if (this.furnaceItemStacks[2].itemID == itemstack.itemID)
- {
- ++this.furnaceItemStacks[2].stackSize;
+ else if (this.furnaceItemStacks[2].isItemEqual(itemstack))
+ {
+ furnaceItemStacks[2].stackSize += itemstack.stackSize;
}
--this.furnaceItemStacks[0].stackSize;
@@ -362,7 +367,7 @@
int i = par0ItemStack.getItem().itemID;
Item item = par0ItemStack.getItem();
- if (i < 256 && Block.blocksList[i] != null)
+ if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[i] != null)
{
Block block = Block.blocksList[i];
@@ -423,4 +428,41 @@
{
return 1;
}
+
+ /***********************************************************************************
+ * This function is here for compatibilities sake, Modders should Check for
+ * Sided before ContainerWorldly, Vanilla Minecraft does not follow the sided standard
+ * that Modding has for a while.
+ *
+ * In vanilla:
+ *
+ * Top: Ores
+ * Sides: Fuel
+ * Bottom: Output
+ *
+ * Standard Modding:
+ * Top: Ores
+ * Sides: Output
+ * Bottom: Fuel
+ *
+ * The Modding one is designed after the GUI, the vanilla one is designed because its
+ * intended use is for the hopper, which logically would take things in from the top.
+ *
+ * This will possibly be removed in future updates, and make vanilla the definitive
+ * standard.
+ */
+
+ @Override
+ public int getStartInventorySide(ForgeDirection side)
+ {
+ if (side == ForgeDirection.DOWN) return 1;
+ if (side == ForgeDirection.UP) return 0;
+ return 2;
+ }
+
+ @Override
+ public int getSizeInventorySide(ForgeDirection side)
+ {
+ return 1;
+ }
}