v5.0.1 Beta #3
*Fixed ISidedInventory for nearly all machines. *Added handy sided inventory methods to MekanismUtils.
This commit is contained in:
parent
769593000d
commit
ebf8bf5367
10 changed files with 98 additions and 13 deletions
|
@ -16,6 +16,7 @@ import net.minecraft.network.packet.Packet3Chat;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.server.FMLServerHandler;
|
||||
|
||||
|
@ -230,4 +231,24 @@ public final class MekanismUtils
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ForgeDirection getLeft(int orientation)
|
||||
{
|
||||
switch(orientation)
|
||||
{
|
||||
case 2:
|
||||
return ForgeDirection.EAST;
|
||||
case 3:
|
||||
return ForgeDirection.WEST;
|
||||
case 4:
|
||||
return ForgeDirection.SOUTH;
|
||||
default:
|
||||
return ForgeDirection.NORTH;
|
||||
}
|
||||
}
|
||||
|
||||
public static ForgeDirection getRight(int orientation)
|
||||
{
|
||||
return getLeft(orientation).getOpposite();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -295,16 +295,12 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
{
|
||||
return 2;
|
||||
}
|
||||
else if(side == ForgeDirection.getOrientation(facing).getRotation(ForgeDirection.WEST))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if(side == ForgeDirection.getOrientation(facing).getRotation(ForgeDirection.EAST))
|
||||
else if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -247,12 +247,12 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
else if(side == ForgeDirection.getOrientation(facing).getRotation(ForgeDirection.EAST))
|
||||
else if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 3;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -335,6 +335,23 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IEn
|
|||
{
|
||||
return getPowerProvider().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if(side == ForgeDirection.getOrientation(1))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventorySide(ForgeDirection side)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getVoltage()
|
||||
|
|
|
@ -130,6 +130,23 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if(side == ForgeDirection.getOrientation(1))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventorySide(ForgeDirection side)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGas(EnumGas type)
|
||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import universalelectricity.core.implement.IItemElectric;
|
||||
import universalelectricity.core.implement.IJouleStorage;
|
||||
|
@ -322,6 +323,35 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
infuseStored = nbtTags.getInteger("infuseStored");
|
||||
type = InfusionType.getFromName(nbtTags.getString("type"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if(side == ForgeDirection.getOrientation(1))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if(side == ForgeDirection.getOrientation(facing).getOpposite())
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventorySide(ForgeDirection side)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
|
|
|
@ -4,6 +4,7 @@ import ic2.api.ElectricItem;
|
|||
import ic2.api.IElectricItem;
|
||||
import mekanism.common.LiquidSlot;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismUtils;
|
||||
import mekanism.common.PacketHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -177,7 +178,7 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank
|
|||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if(side == ForgeDirection.getOrientation(facing).getRotation(ForgeDirection.EAST))
|
||||
if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import mekanism.api.IGasStorage;
|
|||
import mekanism.api.IStorageTank;
|
||||
import mekanism.common.LiquidSlot;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismUtils;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.TileEntityElectricBlock;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -255,7 +256,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if(side == ForgeDirection.getOrientation(facing).getRotation(ForgeDirection.WEST))
|
||||
if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import ic2.api.ElectricItem;
|
|||
import ic2.api.IElectricItem;
|
||||
import mekanism.common.LiquidSlot;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismUtils;
|
||||
import mekanism.common.PacketHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -185,7 +186,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan
|
|||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if(side == ForgeDirection.getOrientation(facing).getRotation(ForgeDirection.EAST))
|
||||
if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import mekanism.api.EnumGas;
|
|||
import mekanism.api.IGasAcceptor;
|
||||
import mekanism.api.IGasStorage;
|
||||
import mekanism.api.IStorageTank;
|
||||
import mekanism.common.MekanismUtils;
|
||||
import mekanism.common.PacketHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -127,7 +128,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
|||
@Override
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if(side == ForgeDirection.getOrientation(facing).getRotation(ForgeDirection.EAST))
|
||||
if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue