Remove forge ISidedInventory, deprecated since 1.5.

This commit is contained in:
Christian 2013-07-09 11:38:54 -04:00
parent 561b0fbe55
commit a990c0bdc8
3 changed files with 3 additions and 94 deletions

View file

@ -41,7 +41,6 @@ import static net.minecraftforge.common.ForgeVersion.*;
public class ForgeDummyContainer extends DummyModContainer implements WorldAccessContainer
{
public static int clumpingThreshold = 64;
public static boolean legacyFurnaceSides = false;
public static boolean removeErroringEntities = false;
public static boolean removeErroringTileEntities = false;
public static boolean disableStitchedFileSaving = false;
@ -99,10 +98,6 @@ public class ForgeDummyContainer extends DummyModContainer implements WorldAcces
prop.set(64);
}
prop = config.get(Configuration.CATEGORY_GENERAL, "legacyFurnaceOutput", false);
prop.comment = "Controls the sides of vanilla furnaces for Forge's ISidedInventory, Vanilla defines the output as the bottom, but mods/Forge define it as the sides. Settings this to true will restore the old side relations.";
legacyFurnaceSides = prop.getBoolean(false);
prop = config.get(Configuration.CATEGORY_GENERAL, "removeErroringEntities", false);
prop.comment = "Set this to just remove any TileEntity that throws a error in there update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES.";
removeErroringEntities = prop.getBoolean(false);

View file

@ -1,31 +0,0 @@
/**
* This software is provided under the terms of the Minecraft Forge Public
* License v1.0.
*/
package net.minecraftforge.common;
import net.minecraft.inventory.IInventory;
/** Inventory ranges mapped by side. This class is implemented by TileEntities
* that provide different inventory slot ranges to different sides.
*/
@Deprecated //A equivalent Interface is now in Minecraft Vanilla will be removed next major MC version
public interface ISidedInventory extends IInventory
{
/**
* Get the start of the side inventory.
* @param side The global side to get the start of range.
*/
@Deprecated
int getStartInventorySide(ForgeDirection side);
/**
* Get the size of the side inventory.
* @param side The global side.
*/
@Deprecated
int getSizeInventorySide(ForgeDirection side);
}

View file

@ -8,19 +8,15 @@
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
@@ -16,8 +17,10 @@
@@ -16,6 +17,8 @@
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;
+import net.minecraftforge.common.ForgeDummyContainer;
+
+public class TileEntityFurnace extends TileEntity implements ISidedInventory, net.minecraftforge.common.ISidedInventory
public class TileEntityFurnace extends TileEntity implements ISidedInventory
{
private static final int[] slots_top = new int[] {0};
private static final int[] slots_bottom = new int[] {2, 1};
@@ -279,8 +282,7 @@
if (this.furnaceItemStacks[1].stackSize == 0)
@ -75,54 +71,3 @@
{
Block block = Block.blocksList[i];
@@ -459,4 +465,50 @@
{
return par3 != 0 || par1 != 1 || par2ItemStack.itemID == Item.bucketEmpty.itemID;
}
+
+ /***********************************************************************************
+ * 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 (ForgeDummyContainer.legacyFurnaceSides)
+ {
+ if (side == ForgeDirection.DOWN) return 1;
+ if (side == ForgeDirection.UP) return 0;
+ return 2;
+ }
+ else
+ {
+ if (side == ForgeDirection.DOWN) return 2;
+ if (side == ForgeDirection.UP) return 0;
+ return 1;
+ }
+ }
+
+ @Override
+ public int getSizeInventorySide(ForgeDirection side)
+ {
+ return 1;
+ }
}