mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
tile package done, except for TEDigitalMiner
This commit is contained in:
1 parent
3126f144d2
commit
a27c9b6839
61 files changed
+714
-720
No files matched your search
@@ -1,6 +1,8 @@
|
||||
package mekanism.common.tile;
|
||||
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.fml.common.Optional.Interface;
|
||||
import net.minecraftforge.fml.common.Optional.InterfaceList;
|
||||
import net.minecraftforge.fml.common.Optional.Method;
|
||||
@@ -13,10 +15,13 @@ import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.inventory.InventoryBasic;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
@InterfaceList({
|
||||
@Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"),
|
||||
@@ -58,14 +63,14 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i)
|
||||
public ItemStack removeStackFromSlot(int i)
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return getInv().getStackInSlotOnClosing(i);
|
||||
return getInv().removeStackFromSlot(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,14 +96,20 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return getInv().hasCustomInventoryName();
|
||||
return getInv().hasCustomName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName()
|
||||
{
|
||||
return new ChatComponentText(getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,25 +135,25 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
public void openInventory(EntityPlayer player)
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
getInv().openInventory();
|
||||
getInv().openInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
public void closeInventory(EntityPlayer player)
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
getInv().closeInventory();
|
||||
getInv().closeInventory(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -157,31 +168,55 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int slotID)
|
||||
public int getField(int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(int id, int value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return InventoryUtils.EMPTY;
|
||||
}
|
||||
|
||||
return getInv().getBoundSlots(Coord4D.get(this), slotID);
|
||||
return getInv().getBoundSlots(Coord4D.get(this), side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j)
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return isItemValidForSlot(i, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j)
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(getInv() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return getInv().canBoundExtract(Coord4D.get(this), i, itemstack, j);
|
||||
return getInv().canBoundExtract(Coord4D.get(this), i, itemstack, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -354,15 +389,15 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
|
||||
return null;
|
||||
}
|
||||
|
||||
TileEntity tile = new Coord4D(mainX, mainY, mainZ, worldObj.provider.getDimensionId()).getTileEntity(worldObj);
|
||||
TileEntity tile = new Coord4D(mainPos, worldObj.provider.getDimensionId()).getTileEntity(worldObj);
|
||||
|
||||
if(!(tile instanceof IAdvancedBoundingBlock))
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlockToAir(mainPos);
|
||||
return null;
|
||||
}
|
||||
|
||||
return (IAdvancedBoundingBlock)new Coord4D(mainX, mainY, mainZ, worldObj.provider.getDimensionId()).getTileEntity(worldObj);
|
||||
return (IAdvancedBoundingBlock)new Coord4D(mainPos, worldObj.provider.getDimensionId()).getTileEntity(worldObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -84,10 +84,10 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
|
||||
|
||||
public void upgrade(RecipeType type)
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, MekanismBlocks.MachineBlock, 5, 3);
|
||||
worldObj.setBlockToAir(getPos());
|
||||
worldObj.setBlockState(getPos(), MekanismBlocks.MachineBlock.getStateFromMeta(5), 3);
|
||||
|
||||
TileEntityFactory factory = (TileEntityFactory)worldObj.getTileEntity(xCoord, yCoord, zCoord);
|
||||
TileEntityFactory factory = (TileEntityFactory)worldObj.getTileEntity(getPos());
|
||||
|
||||
//Basic
|
||||
factory.facing = facing;
|
||||
@@ -357,7 +357,7 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 3)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,9 @@ import mekanism.common.recipe.inputs.IntegerInput;
|
||||
import mekanism.common.recipe.machines.AmbientGasRecipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@@ -94,7 +96,7 @@ public class TileEntityAmbientAccumulator extends TileEntityContainerBlock imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
if(collectedGas.getGasType() != null)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,8 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraftforge.fml.common.Optional.Interface;
|
||||
import net.minecraftforge.fml.common.Optional.Method;
|
||||
|
||||
@@ -31,9 +33,9 @@ import net.minecraftforge.fml.common.Optional.Method;
|
||||
public abstract class TileEntityBasicBlock extends TileEntity implements IWrenchable, ITileNetwork, IChunkLoadHandler
|
||||
{
|
||||
/** The direction this block is facing. */
|
||||
public int facing;
|
||||
public EnumFacing facing;
|
||||
|
||||
public int clientFacing;
|
||||
public EnumFacing clientFacing;
|
||||
|
||||
public HashSet<EntityPlayer> openedThisTick = new HashSet<EntityPlayer>();
|
||||
|
||||
@@ -50,8 +52,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
|
||||
public List<ITileComponent> components = new ArrayList<ITileComponent>();
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
public void update()
|
||||
{
|
||||
if(!worldObj.isRemote && general.destroyDisabledBlocks)
|
||||
{
|
||||
@@ -60,7 +61,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
if(type != null && !type.isEnabled())
|
||||
{
|
||||
Mekanism.logger.info("[Mekanism] Destroying machine of type '" + type.name + "' at coords " + Coord4D.get(this) + " as according to config.");
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlockToAir(getPos());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -108,13 +109,13 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
@Override
|
||||
public void handlePacketData(ByteBuf dataStream)
|
||||
{
|
||||
facing = dataStream.readInt();
|
||||
facing = EnumFacing.getFront(dataStream.readInt());
|
||||
redstone = dataStream.readBoolean();
|
||||
|
||||
if(clientFacing != facing)
|
||||
{
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
worldObj.notifyNeighborsOfStateChange(getPos(), worldObj.getBlockState(getPos()).getBlock());
|
||||
clientFacing = facing;
|
||||
}
|
||||
|
||||
@@ -125,7 +126,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
data.add(facing);
|
||||
data.add(redstone);
|
||||
@@ -159,7 +160,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
{
|
||||
super.readFromNBT(nbtTags);
|
||||
|
||||
facing = nbtTags.getInteger("facing");
|
||||
facing = EnumFacing.getFront(nbtTags.getInteger("facing"));
|
||||
redstone = nbtTags.getBoolean("redstone");
|
||||
|
||||
for(ITileComponent component : components)
|
||||
@@ -173,7 +174,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
{
|
||||
super.writeToNBT(nbtTags);
|
||||
|
||||
nbtTags.setInteger("facing", facing);
|
||||
nbtTags.setInteger("facing", facing.ordinal());
|
||||
nbtTags.setBoolean("redstone", redstone);
|
||||
|
||||
for(ITileComponent component : components)
|
||||
@@ -193,7 +194,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
@Method(modid = "IC2")
|
||||
public short getFacing()
|
||||
{
|
||||
return (short)facing;
|
||||
return (short)facing.ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,12 +202,12 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
{
|
||||
if(canSetFacing(direction))
|
||||
{
|
||||
facing = direction;
|
||||
facing = EnumFacing.getFront(direction);
|
||||
}
|
||||
|
||||
if(!(facing == clientFacing || worldObj.isRemote))
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
markDirty();
|
||||
clientFacing = facing;
|
||||
}
|
||||
@@ -240,7 +241,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
@Method(modid = "IC2")
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
||||
{
|
||||
return getBlockType().getPickBlock(null, worldObj, xCoord, yCoord, zCoord, entityPlayer);
|
||||
return getBlockType().getPickBlock(null, worldObj, getPos(), entityPlayer);
|
||||
}
|
||||
|
||||
public boolean isPowered()
|
||||
@@ -265,12 +266,12 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
|
||||
private void updatePower()
|
||||
{
|
||||
boolean power = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
|
||||
boolean power = worldObj.isBlockIndirectlyGettingPowered(getPos()) > 0;
|
||||
|
||||
if(redstone != power)
|
||||
{
|
||||
redstone = power;
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
onPowerChange();
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
||||
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,26 +155,25 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
||||
{
|
||||
updateDelay = general.UPDATE_DELAY;
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(operatingTicks);
|
||||
data.add(isActive);
|
||||
data.add(ticksRequired);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the scaled progress level for the GUI.
|
||||
* @return
|
||||
*/
|
||||
public double getScaledProgress()
|
||||
{
|
||||
@@ -194,7 +193,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
@@ -228,7 +227,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.ITEM, side, facing).availableSlots;
|
||||
}
|
||||
@@ -240,7 +239,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrientation()
|
||||
public EnumFacing getOrientation()
|
||||
{
|
||||
return facing;
|
||||
}
|
||||
|
||||
@@ -24,13 +24,16 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraftforge.fml.common.Optional.Interface;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||
|
||||
@Interface(iface = "powercrystals.minefactoryreloaded.api.IDeepStorageUnit", modid = "MineFactoryReloaded")
|
||||
public class TileEntityBin extends TileEntityBasicBlock implements ISidedInventory, IActiveState, IDeepStorageUnit, IConfigurable
|
||||
public class TileEntityBin extends TileEntityBasicBlock implements ISidedInventory, IActiveState, IDeepStorageUnit, IConfigurable, ITickable
|
||||
{
|
||||
public boolean isActive;
|
||||
|
||||
@@ -206,7 +209,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
}
|
||||
else if(tile instanceof IInventory)
|
||||
{
|
||||
setInventorySlotContents(0, InventoryUtils.putStackInInventory((IInventory)tile, bottomStack, 0, false));
|
||||
setInventorySlotContents(0, InventoryUtils.putStackInInventory((IInventory)tile, bottomStack, EnumFacing.DOWN, false));
|
||||
}
|
||||
|
||||
delayTicks = 10;
|
||||
@@ -260,7 +263,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -291,7 +294,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
itemType = null;
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -332,7 +335,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slotID)
|
||||
public ItemStack removeStackFromSlot(int slotID)
|
||||
{
|
||||
return getStackInSlot(slotID);
|
||||
}
|
||||
@@ -384,7 +387,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
MekanismUtils.saveChunk(this);
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
prevCount = getItemCount();
|
||||
sortStacks();
|
||||
}
|
||||
@@ -427,11 +430,17 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName()
|
||||
{
|
||||
return new ChatComponentText(getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
@@ -445,25 +454,49 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
public void openInventory(EntityPlayer player) {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
public void closeInventory(EntityPlayer player) {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||
{
|
||||
return i == 1 ? isValid(itemstack) : false;
|
||||
return i == 1 && isValid(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int getField(int id)
|
||||
{
|
||||
if(side == 1)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(int id, int value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == EnumFacing.UP)
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
else if(side == 0)
|
||||
else if(side == EnumFacing.DOWN)
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
@@ -472,15 +505,15 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j)
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return isItemValidForSlot(i, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j)
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return i == 0 ? isValid(itemstack) : false;
|
||||
return i == 0 && isValid(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -496,7 +529,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
|
||||
if(clientActive != active)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
clientActive = active;
|
||||
}
|
||||
@@ -561,15 +594,15 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakRightClick(EntityPlayer player, int side)
|
||||
public boolean onSneakRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
setActive(!getActive());
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.click", 0.3F, 1);
|
||||
worldObj.playSoundEffect(getPos().getX(), getPos().getY(), getPos().getZ(), "random.click", 0.3F, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRightClick(EntityPlayer player, int side)
|
||||
public boolean onRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -30,10 +30,4 @@ public class TileEntityCardboardBox extends TileEntity
|
||||
nbtTags.setTag("storedData", storedData.write(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -126,7 +127,7 @@ public abstract class TileEntityChanceMachine<RECIPE extends ChanceMachineRecipe
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -54,7 +57,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
isActive = false;
|
||||
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 0.2, zCoord + 1));
|
||||
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX() + 1, getPos().getY() + 0.2, getPos().getZ() + 1));
|
||||
|
||||
for(EntityLivingBase entity : entities)
|
||||
{
|
||||
@@ -106,13 +109,13 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||
|
||||
if(prevActive != isActive)
|
||||
{
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.1, zCoord + 0.5, "random.click", 0.3F, isActive ? 0.6F : 0.5F);
|
||||
worldObj.playSoundEffect(getPos().getX() + 0.5, getPos().getY() + 0.1, getPos().getZ() + 0.5, "random.click", 0.3F, isActive ? 0.6F : 0.5F);
|
||||
setActive(isActive);
|
||||
}
|
||||
}
|
||||
else if(isActive)
|
||||
{
|
||||
worldObj.spawnParticle("reddust", xCoord+random.nextDouble(), yCoord+0.15, zCoord+random.nextDouble(), 0, 0, 0);
|
||||
worldObj.spawnParticle(EnumParticleTypes.REDSTONE, getPos().getX()+random.nextDouble(), getPos().getY()+0.15, getPos().getZ()+random.nextDouble(), 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +147,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
return EnumSet.of(EnumFacing.DOWN, EnumFacing.getFront(facing).getOpposite());
|
||||
return EnumSet.of(EnumFacing.DOWN, facing.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,7 +163,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||
|
||||
if(prevActive != active)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
|
||||
prevActive = active;
|
||||
@@ -187,11 +190,11 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||
{
|
||||
super.handlePacketData(dataStream);
|
||||
isActive = dataStream.readBoolean();
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
data.add(isActive);
|
||||
|
||||
@@ -24,10 +24,13 @@ import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISideConfiguration, IUpgradeTile, ISustainedData, ITankManager
|
||||
{
|
||||
public static final int MAX_GAS = 10000;
|
||||
@@ -103,7 +106,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +118,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,17 +210,17 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
}
|
||||
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(operatingTicks);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
if(inputTank.getGas() != null)
|
||||
{
|
||||
@@ -276,7 +279,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
@@ -304,13 +307,13 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(0);
|
||||
return configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(0) && inputTank.canReceive(type) &&
|
||||
return configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(0) && inputTank.canReceive(type) &&
|
||||
RecipeHandler.Recipe.CHEMICAL_CRYSTALLIZER.containsRecipe(type);
|
||||
}
|
||||
|
||||
@@ -385,7 +388,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 0)
|
||||
{
|
||||
@@ -404,7 +407,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.ITEM, side, facing).availableSlots;
|
||||
}
|
||||
@@ -416,7 +419,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrientation()
|
||||
public EnumFacing getOrientation()
|
||||
{
|
||||
return facing;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,9 @@ import mekanism.common.util.StatUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IGasHandler, IUpgradeTile, ISustainedData, ITankManager
|
||||
{
|
||||
@@ -92,7 +94,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +106,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +191,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 2)
|
||||
{
|
||||
@@ -200,17 +202,17 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == MekanismUtils.getLeft(facing).ordinal() || side == 1)
|
||||
if(side == MekanismUtils.getLeft(facing) || side == EnumFacing.UP)
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
else if(side == 0)
|
||||
else if(side == EnumFacing.DOWN)
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
else if(side == MekanismUtils.getRight(facing).ordinal())
|
||||
else if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return new int[] {2};
|
||||
}
|
||||
@@ -282,16 +284,16 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||
outputTank.setGas(null);
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(operatingTicks);
|
||||
|
||||
if(injectTank.getGas() != null)
|
||||
|
||||
@@ -37,6 +37,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile, IUpgradeInfoHandler, ITankManager
|
||||
{
|
||||
@@ -87,7 +89,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,13 +145,13 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
{
|
||||
GasStack toSend = new GasStack(centerTank.getGas().getGas(), Math.min(centerTank.getStored(), gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(EnumFacing.getFront(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(facing).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
if(((IGasHandler)tileEntity).canReceiveGas(EnumFacing.getFront(facing).getOpposite(), centerTank.getGas().getGas()))
|
||||
if(((IGasHandler)tileEntity).canReceiveGas(facing.getOpposite(), centerTank.getGas().getGas()))
|
||||
{
|
||||
centerTank.draw(((IGasHandler)tileEntity).receiveGas(EnumFacing.getFront(facing).getOpposite(), toSend, true), true);
|
||||
centerTank.draw(((IGasHandler)tileEntity).receiveGas(facing.getOpposite(), toSend, true), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,16 +247,16 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
}
|
||||
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(clientEnergyUsed);
|
||||
|
||||
if(leftTank.getGas() != null)
|
||||
@@ -332,7 +334,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
{
|
||||
return rightTank;
|
||||
}
|
||||
else if(side == EnumFacing.getFront(facing))
|
||||
else if(side == facing)
|
||||
{
|
||||
return centerTank;
|
||||
}
|
||||
@@ -347,7 +349,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
@@ -375,13 +377,13 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side)
|
||||
{
|
||||
return side == MekanismUtils.getLeft(facing) || side == MekanismUtils.getRight(facing) || side == EnumFacing.getFront(facing);
|
||||
return side == MekanismUtils.getLeft(facing) || side == MekanismUtils.getRight(facing) || side == facing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return getTank(side) != null && getTank(side) != centerTank ? getTank(side).canReceive(type) : false;
|
||||
return (getTank(side) != null && getTank(side) != centerTank) && getTank(side).canReceive(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -440,22 +442,18 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
@Override
|
||||
public boolean canDrawGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return getTank(side) != null && getTank(side) == centerTank ? getTank(side).canDraw(type) : false;
|
||||
return (getTank(side) != null && getTank(side) == centerTank) && getTank(side).canDraw(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemstack)
|
||||
{
|
||||
if(slotID == 3)
|
||||
{
|
||||
return ChargeUtils.canBeDischarged(itemstack);
|
||||
}
|
||||
return slotID == 3 && ChargeUtils.canBeDischarged(itemstack);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 0 || slotID == 2)
|
||||
{
|
||||
@@ -474,9 +472,9 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == MekanismUtils.getLeft(facing).ordinal())
|
||||
if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
@@ -484,11 +482,11 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
else if(side == MekanismUtils.getRight(facing).ordinal())
|
||||
else if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return new int[] {2};
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
else if(side.getAxis() == Axis.Y)
|
||||
{
|
||||
return new int[3];
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@ import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectricMachine<InjectionRecipe>
|
||||
{
|
||||
@@ -67,7 +69,7 @@ public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectr
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
if(configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(0))
|
||||
if(configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(0))
|
||||
{
|
||||
return isValidGas(type);
|
||||
}
|
||||
@@ -97,7 +99,7 @@ public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectr
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(0);
|
||||
return configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,10 @@ import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IUpgradeTile, ISustainedData, ITankManager
|
||||
{
|
||||
@@ -84,7 +87,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +170,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 2)
|
||||
{
|
||||
@@ -178,17 +181,17 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == MekanismUtils.getLeft(facing).ordinal())
|
||||
if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
else if(side.getAxis() == Axis.Y)
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
else if(side == MekanismUtils.getRight(facing).ordinal())
|
||||
else if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return new int[] {2};
|
||||
}
|
||||
@@ -247,7 +250,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||
gasTank.setGas(null);
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,7 +259,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(operatingTicks);
|
||||
|
||||
if(gasTank.getGas() != null)
|
||||
|
||||
@@ -22,7 +22,10 @@ import mekanism.common.util.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -80,7 +83,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +290,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
outputTank.setGas(null);
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -296,7 +299,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(clientEnergyUsed);
|
||||
|
||||
if(fluidTank.getFluid() != null)
|
||||
@@ -483,7 +486,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
@Override
|
||||
public boolean canDrawGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return getTank(side) == outputTank ? getTank(side).canDraw(type) : false;
|
||||
return getTank(side) == outputTank && getTank(side).canDraw(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -502,7 +505,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -517,17 +520,17 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == MekanismUtils.getLeft(facing).ordinal())
|
||||
if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
else if(side == MekanismUtils.getRight(facing).ordinal())
|
||||
else if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
else if(side == 0 || side == 1)
|
||||
else if(side.getAxis() == Axis.Y)
|
||||
{
|
||||
return new int[2];
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityCombiner extends TileEntityAdvancedElectricMachine<CombinerRecipe>
|
||||
{
|
||||
|
||||
@@ -9,9 +9,13 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
|
||||
public abstract class TileEntityContainerBlock extends TileEntityBasicBlock implements ISidedInventory, ISustainedInventory
|
||||
public abstract class TileEntityContainerBlock extends TileEntityBasicBlock implements ISidedInventory, ISustainedInventory, ITickable
|
||||
{
|
||||
/** The inventory slot itemstacks used by this block. */
|
||||
public ItemStack[] inventory;
|
||||
@@ -117,7 +121,7 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slotID)
|
||||
public ItemStack removeStackFromSlot(int slotID)
|
||||
{
|
||||
if(getStackInSlot(slotID) != null)
|
||||
{
|
||||
@@ -160,13 +164,13 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
public void openInventory(EntityPlayer player) {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
public void closeInventory(EntityPlayer player) {}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName()
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -178,19 +182,19 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canInsertItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return isItemValidForSlot(slotID, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return InventoryUtils.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -245,4 +249,31 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
||||
}
|
||||
|
||||
public void recalculateUpgradables(Upgrade upgradeType) {}
|
||||
|
||||
@Override
|
||||
public int getField(int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setField(int id, int value) {}
|
||||
|
||||
@Override
|
||||
public int getFieldCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatComponent getDisplayName()
|
||||
{
|
||||
return new ChatComponentText(getName());
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.*;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -185,9 +186,10 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
next = index + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
Block block = coord.getBlock(worldObj);
|
||||
int meta = coord.getBlockState(worldObj);
|
||||
|
||||
IBlockState state = coord.getBlockState(worldObj);
|
||||
Block block = state.getBlock();
|
||||
int meta = block.getMetaFromState(state);
|
||||
|
||||
if(block == null || coord.isAirBlock(worldObj))
|
||||
{
|
||||
@@ -213,7 +215,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
}
|
||||
}
|
||||
|
||||
if(inverse ? hasFilter : !hasFilter)
|
||||
if(inverse == hasFilter)
|
||||
{
|
||||
set.clear(index);
|
||||
|
||||
@@ -240,7 +242,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
toRemove.add(chunk);
|
||||
}
|
||||
|
||||
worldObj.playAuxSFXAtEntity(null, 2001, coord.xCoord, coord.yCoord, coord.zCoord, Block.getIdFromBlock(block) + (meta << 12));
|
||||
worldObj.playAuxSFXAtEntity(null, 2001, coord, Block.getIdFromBlock(block) + (meta << 12));
|
||||
|
||||
missingStack = null;
|
||||
}
|
||||
@@ -273,7 +275,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
{
|
||||
if(getEjectInv() instanceof IInventory)
|
||||
{
|
||||
ItemStack remains = InventoryUtils.putStackInInventory((IInventory)getEjectInv(), getTopEject(false, null), EnumFacing.getFront(facing).getOpposite().ordinal(), false);
|
||||
ItemStack remains = InventoryUtils.putStackInInventory((IInventory)getEjectInv(), getTopEject(false, null), facing.getOpposite(), false);
|
||||
|
||||
getTopEject(true, remains);
|
||||
}
|
||||
@@ -509,7 +511,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
|
||||
public TileEntity getEjectInv()
|
||||
{
|
||||
EnumFacing side = EnumFacing.getFront(facing).getOpposite();
|
||||
EnumFacing side = facing.getOpposite();
|
||||
|
||||
return new Coord4D(xCoord+(side.offsetX*2), yCoord+1, zCoord+(side.offsetZ*2), worldObj.provider.getDimensionId()).getTileEntity(worldObj);
|
||||
}
|
||||
@@ -671,8 +673,8 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
nbtTags.setInteger("delay", delay);
|
||||
nbtTags.setBoolean("silkTouch", silkTouch);
|
||||
nbtTags.setInteger("numPowering", numPowering);
|
||||
nbtTags.setInteger("state", searcher.state.ordinal());
|
||||
nbtTags.setInteger("controlType", controlType.ordinal());
|
||||
nbtTags.setInteger("state", searcher.state);
|
||||
nbtTags.setInteger("controlType", controlType);
|
||||
nbtTags.setBoolean("inverse", inverse);
|
||||
|
||||
NBTTagList filterTags = new NBTTagList();
|
||||
@@ -868,7 +870,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
data.add(running);
|
||||
data.add(silkTouch);
|
||||
data.add(numPowering);
|
||||
data.add(searcher.state.ordinal());
|
||||
data.add(searcher.state);
|
||||
|
||||
if(searcher.state == State.SEARCHING)
|
||||
{
|
||||
@@ -878,7 +880,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
data.add(getSize());
|
||||
}
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(inverse);
|
||||
|
||||
if(missingStack != null)
|
||||
@@ -946,7 +948,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
data.add(running);
|
||||
data.add(silkTouch);
|
||||
data.add(numPowering);
|
||||
data.add(searcher.state.ordinal());
|
||||
data.add(searcher.state);
|
||||
|
||||
if(searcher.state == State.SEARCHING)
|
||||
{
|
||||
@@ -956,7 +958,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
data.add(getSize());
|
||||
}
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(inverse);
|
||||
|
||||
if(missingStack != null)
|
||||
@@ -1127,26 +1129,26 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return InventoryUtils.EMPTY;
|
||||
}
|
||||
|
||||
public TileEntity getEjectTile()
|
||||
{
|
||||
EnumFacing side = EnumFacing.getFront(facing).getOpposite();
|
||||
EnumFacing side = facing.getOpposite();
|
||||
return new Coord4D(xCoord+side.offsetX, yCoord+1, zCoord+side.offsetZ, worldObj.provider.getDimensionId()).getTileEntity(worldObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getBoundSlots(Coord4D location, int side)
|
||||
public int[] getBoundSlots(Coord4D location, EnumFacing side)
|
||||
{
|
||||
EnumFacing dir = EnumFacing.getFront(facing).getOpposite();
|
||||
EnumFacing dir = facing.getOpposite();
|
||||
|
||||
Coord4D eject = Coord4D.get(this).translate(dir.offsetX, 1, dir.offsetZ);
|
||||
Coord4D pull = Coord4D.get(this).translate(0, 1, 0);
|
||||
|
||||
if((location.equals(eject) && side == dir.ordinal()) || (location.equals(pull) && side == 1))
|
||||
if((location.equals(eject) && side == dir) || (location.equals(pull) && side == 1))
|
||||
{
|
||||
if(EJECT_INV == null)
|
||||
{
|
||||
@@ -1167,7 +1169,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
@Override
|
||||
public boolean canBoundInsert(Coord4D location, int i, ItemStack itemstack)
|
||||
{
|
||||
EnumFacing side = EnumFacing.getFront(facing).getOpposite();
|
||||
EnumFacing side = facing.getOpposite();
|
||||
|
||||
Coord4D eject = Coord4D.get(this).translate(side.offsetX, 1, side.offsetZ);
|
||||
Coord4D pull = Coord4D.get(this).translate(0, 1, 0);
|
||||
@@ -1190,7 +1192,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
@Override
|
||||
public boolean canBoundExtract(Coord4D location, int i, ItemStack itemstack, int j)
|
||||
{
|
||||
EnumFacing side = EnumFacing.getFront(facing).getOpposite();
|
||||
EnumFacing side = facing.getOpposite();
|
||||
|
||||
Coord4D eject = new Coord4D(xCoord+side.offsetX, yCoord+1, zCoord+side.offsetZ, worldObj.provider.getDimensionId());
|
||||
Coord4D pull = new Coord4D(xCoord, yCoord+1, zCoord, worldObj.provider.getDimensionId());
|
||||
@@ -1355,7 +1357,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
nbtTags.setBoolean("doEject", doEject);
|
||||
nbtTags.setBoolean("doPull", doPull);
|
||||
nbtTags.setBoolean("silkTouch", silkTouch);
|
||||
nbtTags.setInteger("controlType", controlType.ordinal());
|
||||
nbtTags.setInteger("controlType", controlType);
|
||||
nbtTags.setBoolean("inverse", inverse);
|
||||
|
||||
NBTTagList filterTags = new NBTTagList();
|
||||
|
||||
@@ -291,7 +291,7 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
|
||||
if(!BlockBasic.manageInventory(player, this))
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
player.openGui(Mekanism.instance, 18, worldObj, xCoord, yCoord, zCoord);
|
||||
player.openGui(Mekanism.instance, 18, worldObj, getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
}
|
||||
else {
|
||||
player.inventory.markDirty();
|
||||
@@ -329,19 +329,19 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
if(structure != null)
|
||||
{
|
||||
data.add(structure.volume*TankUpdateProtocol.FLUID_PER_TANK);
|
||||
data.add(structure.editMode.ordinal());
|
||||
data.add(structure.editMode);
|
||||
|
||||
if(structure.fluidStored != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(structure.fluidStored.getFluidID());
|
||||
data.add(structure.fluidStored.getFluid().getName());
|
||||
data.add(structure.fluidStored.amount);
|
||||
}
|
||||
else {
|
||||
@@ -365,7 +365,7 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
|
||||
for(ValveData valveData : toSend)
|
||||
{
|
||||
valveData.location.write(data);
|
||||
data.add(valveData.side.ordinal());
|
||||
data.add(valveData.side);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos());
|
||||
|
||||
if(registered != this)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos());
|
||||
|
||||
if(registered instanceof IEnergyTile)
|
||||
{
|
||||
@@ -139,7 +139,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -392,7 +392,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
@Override
|
||||
public double transferEnergyToAcceptor(EnumFacing side, double amount)
|
||||
{
|
||||
if(!(getConsumingSides().contains(side) || side == EnumFacing.null))
|
||||
if(!(getConsumingSides().contains(side) || side == null))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import mekanism.common.util.InventoryUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@@ -42,7 +43,7 @@ public class TileEntityElectricChest extends TileEntityElectricBlock
|
||||
|
||||
if((playersUsing.size() > 0) && (lidAngle == 0.0F))
|
||||
{
|
||||
worldObj.playSoundEffect(xCoord + 0.5F, yCoord + 0.5D, zCoord + 0.5F, "random.chestopen", 0.5F, (worldObj.rand.nextFloat()*0.1F) + 0.9F);
|
||||
worldObj.playSoundEffect(getPos().getX() + 0.5F, getPos().getY() + 0.5D, getPos().getZ() + 0.5F, "random.chestopen", 0.5F, (worldObj.rand.nextFloat()*0.1F) + 0.9F);
|
||||
}
|
||||
|
||||
if((playersUsing.size() == 0 && lidAngle > 0.0F) || (playersUsing.size() > 0 && lidAngle < 1.0F))
|
||||
@@ -66,7 +67,7 @@ public class TileEntityElectricChest extends TileEntityElectricBlock
|
||||
|
||||
if(lidAngle < split && angle >= split)
|
||||
{
|
||||
worldObj.playSoundEffect(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D, "random.chestclosed", 0.5F, (worldObj.rand.nextFloat()*0.1F) + 0.9F);
|
||||
worldObj.playSoundEffect(getPos().getX() + 0.5D, getPos().getY() + 0.5D, getPos().getZ() + 0.5D, "random.chestclosed", 0.5F, (worldObj.rand.nextFloat()*0.1F) + 0.9F);
|
||||
}
|
||||
|
||||
if(lidAngle < 0.0F)
|
||||
@@ -109,7 +110,7 @@ public class TileEntityElectricChest extends TileEntityElectricBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -138,9 +139,9 @@ public class TileEntityElectricChest extends TileEntityElectricBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == 0 || !canAccess())
|
||||
if(side == EnumFacing.DOWN || !canAccess())
|
||||
{
|
||||
return InventoryUtils.EMPTY;
|
||||
}
|
||||
@@ -160,7 +161,7 @@ public class TileEntityElectricChest extends TileEntityElectricBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 54)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -57,10 +58,10 @@ public abstract class TileEntityElectricMachine<RECIPE extends BasicMachineRecip
|
||||
|
||||
public void upgrade(RecipeType type)
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, MekanismBlocks.MachineBlock, 5, 3);
|
||||
worldObj.setBlockToAir(getPos());
|
||||
worldObj.setBlockState(getPos(), MekanismBlocks.MachineBlock.getStateFromMeta(5), 3);
|
||||
|
||||
TileEntityFactory factory = (TileEntityFactory)worldObj.getTileEntity(xCoord, yCoord, zCoord);
|
||||
TileEntityFactory factory = (TileEntityFactory)worldObj.getTileEntity(getPos());
|
||||
|
||||
//Basic
|
||||
factory.facing = facing;
|
||||
@@ -208,7 +209,7 @@ public abstract class TileEntityElectricMachine<RECIPE extends BasicMachineRecip
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
|
||||
@@ -42,6 +42,7 @@ import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
public class TileEntityElectricPump extends TileEntityElectricBlock implements IFluidHandler, ISustainedTank, IConfigurable, IRedstoneControl, IUpgradeTile, ITankManager, IComputerIntegration
|
||||
{
|
||||
@@ -202,7 +203,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
activeType = fluid.getFluid();
|
||||
recurringNodes.add(wrapper.clone());
|
||||
fluidTank.fill(MekanismUtils.getFluid(worldObj, wrapper, hasFilter()), true);
|
||||
worldObj.setBlockToAir(wrapper.xCoord, wrapper.yCoord, wrapper.zCoord);
|
||||
worldObj.setBlockToAir(wrapper);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -225,7 +226,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
setEnergy(getEnergy() - usage.electricPumpUsage);
|
||||
activeType = fluid.getFluid();
|
||||
fluidTank.fill(MekanismUtils.getFluid(worldObj, wrapper, hasFilter()), true);
|
||||
worldObj.setBlockToAir(wrapper.xCoord, wrapper.yCoord, wrapper.zCoord);
|
||||
worldObj.setBlockToAir(wrapper);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -251,7 +252,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
activeType = fluid.getFluid();
|
||||
recurringNodes.add(side);
|
||||
fluidTank.fill(MekanismUtils.getFluid(worldObj, side, hasFilter()), true);
|
||||
worldObj.setBlockToAir(side.xCoord, side.yCoord, side.zCoord);
|
||||
worldObj.setBlockToAir(side);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -279,7 +280,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt()));
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
fluidTank.setFluid(null);
|
||||
@@ -287,34 +288,29 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
|
||||
controlType = RedstoneControl.values()[dataStream.readInt()];
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
if(fluidTank.getFluid() != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(fluidTank.getFluid().getFluidID());
|
||||
data.add(fluidTank.getFluid().getFluid().getName());
|
||||
data.add(fluidTank.getFluid().amount);
|
||||
}
|
||||
else {
|
||||
data.add(0);
|
||||
}
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public int getScaledFluidLevel(int i)
|
||||
{
|
||||
return fluidTank.getFluid() != null ? fluidTank.getFluid().amount*i / 10000 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
@@ -373,7 +369,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
recurringNodes.add(Coord4D.read((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
recurringNodes.add(Coord4D.read(tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,7 +394,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 2)
|
||||
{
|
||||
@@ -415,7 +411,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
return EnumSet.of(EnumFacing.getFront(facing).getOpposite());
|
||||
return EnumSet.of(facing.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -425,13 +421,13 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == 1)
|
||||
if(side == EnumFacing.UP)
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
else if(side == 0)
|
||||
else if(side == EnumFacing.DOWN)
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
@@ -443,7 +439,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing direction)
|
||||
{
|
||||
if(direction == EnumFacing.getFront(1))
|
||||
if(direction == EnumFacing.UP)
|
||||
{
|
||||
return new FluidTankInfo[] {fluidTank.getInfo()};
|
||||
}
|
||||
@@ -510,7 +506,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakRightClick(EntityPlayer player, int side)
|
||||
public boolean onSneakRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
reset();
|
||||
|
||||
@@ -520,7 +516,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRightClick(EntityPlayer player, int side)
|
||||
public boolean onRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -97,7 +100,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +112,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +211,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(dumpLeft == GasMode.DUMPING)
|
||||
else
|
||||
{
|
||||
leftTank.draw(dumpAmount, true);
|
||||
|
||||
@@ -239,7 +242,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(dumpRight == GasMode.DUMPING)
|
||||
else
|
||||
{
|
||||
rightTank.draw(dumpAmount, true);
|
||||
|
||||
@@ -259,7 +262,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
clientDumpLeft = dumpedLeft;
|
||||
clientDumpRight = dumpedRight;
|
||||
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
|
||||
prevEnergy = getEnergy();
|
||||
@@ -338,35 +341,35 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
{
|
||||
if(type == 0)
|
||||
{
|
||||
EnumFacing side = EnumFacing.getFront(facing);
|
||||
EnumFacing side = facing;
|
||||
|
||||
double x = xCoord + (side.offsetX == 0 ? 0.5 : Math.max(side.offsetX, 0));
|
||||
double z = zCoord + (side.offsetZ == 0 ? 0.5 : Math.max(side.offsetZ, 0));
|
||||
double x = getPos().getX() + (side.getAxis() != Axis.X ? 0.5 : Math.max(side.getFrontOffsetX(), 0));
|
||||
double z = getPos().getZ() + (side.getAxis() != Axis.Z ? 0.5 : Math.max(side.getFrontOffsetZ(), 0));
|
||||
|
||||
worldObj.spawnParticle("smoke", x, yCoord + 0.5, z, 0.0D, 0.0D, 0.0D);
|
||||
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x, getPos().getY() + 0.5, z, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if(type == 1)
|
||||
{
|
||||
switch(facing)
|
||||
{
|
||||
case 3:
|
||||
worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D);
|
||||
case SOUTH:
|
||||
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, getPos().getX()+0.9, getPos().getY()+1, getPos().getZ()+0.75, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case 4:
|
||||
worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D);
|
||||
case WEST:
|
||||
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, getPos().getX()+0.25, getPos().getY()+1, getPos().getZ()+0.9, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case 2:
|
||||
worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D);
|
||||
case NORTH:
|
||||
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, getPos().getX()+0.1, getPos().getY()+1, getPos().getZ()+0.25, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case 5:
|
||||
worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D);
|
||||
case EAST:
|
||||
worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, getPos().getX()+0.75, getPos().getY()+1, getPos().getZ()+0.1, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 3)
|
||||
{
|
||||
@@ -409,13 +412,13 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(EnumFacing.getFront(side) == MekanismUtils.getRight(facing))
|
||||
if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return new int[] {3};
|
||||
}
|
||||
else if(side == facing || EnumFacing.getFront(side) == EnumFacing.getFront(facing).getOpposite())
|
||||
else if(side == facing || side == facing.getOpposite())
|
||||
{
|
||||
return new int[] {1, 2};
|
||||
}
|
||||
@@ -446,7 +449,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
|
||||
if(dataStream.readBoolean())
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt()));
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
fluidTank.setFluid(null);
|
||||
@@ -480,19 +483,19 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
{
|
||||
updateDelay = MekanismConfig.general.UPDATE_DELAY;
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
if(fluidTank.getFluid() != null)
|
||||
{
|
||||
data.add(true);
|
||||
data.add(fluidTank.getFluid().getFluid().getID());
|
||||
data.add(fluidTank.getFluid().getFluid().getName());
|
||||
data.add(fluidTank.getFluidAmount());
|
||||
}
|
||||
else {
|
||||
@@ -519,9 +522,9 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
data.add(false);
|
||||
}
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(dumpLeft.ordinal());
|
||||
data.add(dumpRight.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(dumpLeft);
|
||||
data.add(dumpRight);
|
||||
data.add(clientDumpLeft);
|
||||
data.add(clientDumpRight);
|
||||
data.add(isActive);
|
||||
@@ -768,7 +771,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
|
||||
@@ -14,6 +14,7 @@ import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
@@ -109,7 +110,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements ICo
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getOutputtingSides()
|
||||
{
|
||||
return EnumSet.of(EnumFacing.getFront(facing));
|
||||
return EnumSet.of(facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -125,13 +126,13 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements ICo
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return side <= 1 ? new int[] {0} : new int[] {1};
|
||||
return side.getAxis() == Axis.Y ? new int[] {0} : new int[] {1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -180,17 +181,17 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements ICo
|
||||
|
||||
controlType = RedstoneControl.values()[dataStream.readInt()];
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
data.add(tier.ordinal());
|
||||
data.add(tier);
|
||||
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import mekanism.common.util.CableUtils;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
@@ -65,7 +66,7 @@ public class TileEntityEntangledBlock extends TileEntityElectricBlock implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
data.add(getEnergy());
|
||||
@@ -81,7 +82,7 @@ public class TileEntityEntangledBlock extends TileEntityElectricBlock implements
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
return sharedInventory == null ? nothing : EnumSet.complementOf(EnumSet.of(EnumFacing.null, EnumFacing.UP));
|
||||
return sharedInventory == null ? nothing : EnumSet.complementOf(EnumSet.of(EnumFacing.UP));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -140,13 +141,13 @@ public class TileEntityEntangledBlock extends TileEntityElectricBlock implements
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
return sharedInventory == null ? false : sharedInventory.canFill(from, fluid);
|
||||
return sharedInventory != null && sharedInventory.canFill(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
return sharedInventory == null ? false : sharedInventory.canDrain(from, fluid);
|
||||
return sharedInventory != null && sharedInventory.canDrain(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -182,18 +183,18 @@ public class TileEntityEntangledBlock extends TileEntityElectricBlock implements
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return sharedInventory == null ? false : sharedInventory.canReceiveGas(side, type);
|
||||
return sharedInventory != null && sharedInventory.canReceiveGas(side, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return sharedInventory == null ? false : sharedInventory.canDrawGas(side, type);
|
||||
return sharedInventory != null && sharedInventory.canDrawGas(side, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side)
|
||||
{
|
||||
return sharedInventory == null ? false : true;
|
||||
return sharedInventory != null;
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -153,10 +154,10 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
public void upgrade()
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, MekanismBlocks.MachineBlock, 5+tier.ordinal()+1, 3);
|
||||
worldObj.setBlockToAir(getPos());
|
||||
worldObj.setBlockState(getPos(), MekanismBlocks.MachineBlock.getStateFromMeta(5+ tier.ordinal()+1), 3);
|
||||
|
||||
TileEntityFactory factory = (TileEntityFactory)worldObj.getTileEntity(xCoord, yCoord, zCoord);
|
||||
TileEntityFactory factory = (TileEntityFactory)worldObj.getTileEntity(getPos());
|
||||
|
||||
//Basic
|
||||
factory.facing = facing;
|
||||
@@ -235,7 +236,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +244,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
{
|
||||
if(ticker == 1)
|
||||
{
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
||||
worldObj.notifyNeighborsOfStateChange(getPos(), getBlockType());
|
||||
}
|
||||
|
||||
if(updateDelay > 0)
|
||||
@@ -302,7 +303,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
secondaryEnergyPerTick = getSecondaryEnergyPerTick(recipeType);
|
||||
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
||||
worldObj.notifyNeighborsOfStateChange(getPos(), getBlockType());
|
||||
|
||||
MekanismUtils.saveChunk(this);
|
||||
}
|
||||
@@ -501,7 +502,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -602,22 +603,14 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
{
|
||||
AdvancedMachineRecipe<?> recipe = recipeType.getRecipe(inventory[inputSlot], gasTank.getGasType());
|
||||
|
||||
if(recipe == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return recipe != null && recipe.canOperate(inventory, inputSlot, outputSlot, gasTank, secondaryEnergyThisTick);
|
||||
|
||||
return recipe.canOperate(inventory, inputSlot, outputSlot, gasTank, secondaryEnergyThisTick);
|
||||
}
|
||||
|
||||
BasicMachineRecipe<?> recipe = recipeType.getRecipe(inventory[inputSlot]);
|
||||
|
||||
if(recipe == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return recipe != null && recipe.canOperate(inventory, inputSlot, outputSlot);
|
||||
|
||||
return recipe.canOperate(inventory, inputSlot, outputSlot);
|
||||
}
|
||||
|
||||
public void operate(int inputSlot, int outputSlot)
|
||||
@@ -692,13 +685,13 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
{
|
||||
updateDelay = general.UPDATE_DELAY;
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
if(upgraded)
|
||||
{
|
||||
markDirty();
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
upgraded = false;
|
||||
}
|
||||
}
|
||||
@@ -750,14 +743,14 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(recipeType.ordinal());
|
||||
data.add(recipeType);
|
||||
data.add(recipeTicks);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(sorting);
|
||||
data.add(upgraded);
|
||||
data.add(progress);
|
||||
@@ -860,7 +853,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
@@ -874,7 +867,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.ITEM, side, facing).availableSlots;
|
||||
}
|
||||
@@ -892,7 +885,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrientation()
|
||||
public EnumFacing getOrientation()
|
||||
{
|
||||
return facing;
|
||||
}
|
||||
@@ -979,7 +972,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
if(configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(0))
|
||||
if(configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(0))
|
||||
{
|
||||
return recipeType.canReceiveGas(side, type);
|
||||
}
|
||||
@@ -992,7 +985,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
{
|
||||
if(recipeType.canTubeConnect(side))
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(0);
|
||||
return configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(0);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
@@ -135,7 +136,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
{
|
||||
if(fluidTank.getFluid().getFluid().canBePlacedInWorld())
|
||||
{
|
||||
worldObj.setBlock(below.xCoord, below.yCoord, below.zCoord, MekanismUtils.getFlowingBlock(fluidTank.getFluid().getFluid()), 0, 3);
|
||||
worldObj.setBlockState(below, MekanismUtils.getFlowingBlock(fluidTank.getFluid().getFluid()).getDefaultState(), 3);
|
||||
|
||||
setEnergy(getEnergy() - usage.fluidicPlenisherUsage);
|
||||
fluidTank.drain(FluidContainerRegistry.BUCKET_VOLUME, true);
|
||||
@@ -183,7 +184,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
{
|
||||
if(canReplace(coord, true, false))
|
||||
{
|
||||
worldObj.setBlock(coord.xCoord, coord.yCoord, coord.zCoord, MekanismUtils.getFlowingBlock(fluidTank.getFluid().getFluid()), 0, 3);
|
||||
worldObj.setBlockState(coord, MekanismUtils.getFlowingBlock(fluidTank.getFluid().getFluid()).getDefaultState(), 3);
|
||||
|
||||
setEnergy(getEnergy() - usage.fluidicPlenisherUsage);
|
||||
fluidTank.drain(FluidContainerRegistry.BUCKET_VOLUME, true);
|
||||
@@ -217,7 +218,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
|
||||
public int getActiveY()
|
||||
{
|
||||
return yCoord-1;
|
||||
return getPos().down().getY();
|
||||
}
|
||||
|
||||
public boolean canReplace(Coord4D coord, boolean checkNodes, boolean isPathfinding)
|
||||
@@ -237,7 +238,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
return isPathfinding;
|
||||
}
|
||||
|
||||
return coord.getBlock(worldObj).isReplaceable(worldObj, coord.xCoord, coord.yCoord, coord.zCoord);
|
||||
return coord.getBlock(worldObj).isReplaceable(worldObj, coord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -249,17 +250,17 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(dataStream.readInt(), dataStream.readInt()));
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
fluidTank.setFluid(null);
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -268,7 +269,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
if(fluidTank.getFluid() != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(fluidTank.getFluid().getFluidID());
|
||||
data.add(fluidTank.getFluid().getFluid().getName());
|
||||
data.add(fluidTank.getFluid().amount);
|
||||
}
|
||||
else {
|
||||
@@ -370,7 +371,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 2)
|
||||
{
|
||||
@@ -387,7 +388,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
return EnumSet.of(EnumFacing.getFront(facing).getOpposite());
|
||||
return EnumSet.of(facing.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -397,13 +398,13 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == 1)
|
||||
if(side == EnumFacing.UP)
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
else if(side == 0)
|
||||
else if(side == EnumFacing.DOWN)
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
@@ -482,7 +483,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakRightClick(EntityPlayer player, int side)
|
||||
public boolean onSneakRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
activeNodes.clear();
|
||||
usedNodes.clear();
|
||||
@@ -494,7 +495,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRightClick(EntityPlayer player, int side)
|
||||
public boolean onRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -67,13 +67,13 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
{
|
||||
GasStack toSend = new GasStack(gasTank.getGas().getGas(), Math.min(gasTank.getStored(), output));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(EnumFacing.getFront(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(facing).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
if(((IGasHandler)tileEntity).canReceiveGas(EnumFacing.getFront(facing).getOpposite(), gasTank.getGas().getGas()))
|
||||
if(((IGasHandler)tileEntity).canReceiveGas(facing.getOpposite(), gasTank.getGas().getGas()))
|
||||
{
|
||||
gasTank.draw(((IGasHandler)tileEntity).receiveGas(EnumFacing.getFront(facing).getOpposite(), toSend, true), true);
|
||||
gasTank.draw(((IGasHandler)tileEntity).receiveGas(facing.getOpposite(), toSend, true), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -132,9 +132,9 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return side == 1 ? new int[]{0} : new int[]{1};
|
||||
return side == EnumFacing.UP ? new int[]{0} : new int[]{1};
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -170,12 +170,8 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
if(side != EnumFacing.getFront(facing))
|
||||
{
|
||||
return gasTank.canReceive(type);
|
||||
}
|
||||
return side != facing && gasTank.canReceive(type);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -187,7 +183,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
|
||||
if(type == 0)
|
||||
{
|
||||
int index = (dumping.ordinal() + 1)%dumping.values().length;
|
||||
int index = (dumping.ordinal() + 1)%GasMode.values().length;
|
||||
dumping = GasMode.values()[index];
|
||||
}
|
||||
|
||||
@@ -212,7 +208,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
dumping = GasMode.values()[dataStream.readInt()];
|
||||
controlType = RedstoneControl.values()[dataStream.readInt()];
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -237,7 +233,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -251,8 +247,8 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||
data.add(false);
|
||||
}
|
||||
|
||||
data.add(dumping.ordinal());
|
||||
data.add(controlType.ordinal());
|
||||
data.add(dumping);
|
||||
data.add(controlType);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
|
||||
{
|
||||
if(!player.isSneaking() && structure != null)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
player.openGui(Mekanism.instance, 49, worldObj, xCoord, yCoord, zCoord);
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
player.openGui(Mekanism.instance, 49, worldObj, getPos().getX(), getPos().getY(), getPos().getZ());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
|
||||
@@ -19,12 +19,6 @@ public class TileEntityInductionCell extends TileEntityBasicBlock implements ISt
|
||||
@Override
|
||||
public void onUpdate() {}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return LangUtils.localize(getBlockType().getUnlocalizedName() + ".InductionCell" + tier.getBaseTier().getName() + ".name");
|
||||
@@ -39,13 +33,13 @@ public class TileEntityInductionCell extends TileEntityBasicBlock implements ISt
|
||||
|
||||
electricityStored = dataStream.readDouble();
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
{
|
||||
data.add(tier.ordinal());
|
||||
data.add(tier);
|
||||
|
||||
super.getNetworkedData(data);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.common.Optional.Interface;
|
||||
@@ -63,7 +64,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
if(structure != null && mode == true)
|
||||
if(structure != null && mode)
|
||||
{
|
||||
double prev = getEnergy();
|
||||
CableUtils.emit(this);
|
||||
@@ -75,10 +76,9 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getOutputtingSides()
|
||||
{
|
||||
if(structure != null && mode == true)
|
||||
if(structure != null && mode)
|
||||
{
|
||||
EnumSet set = EnumSet.allOf(EnumFacing.class);
|
||||
set.remove(EnumFacing.null);
|
||||
EnumSet<EnumFacing> set = EnumSet.allOf(EnumFacing.class);
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
@@ -97,11 +97,9 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
if(structure != null && mode == false)
|
||||
if(structure != null && !mode)
|
||||
{
|
||||
EnumSet set = EnumSet.allOf(EnumFacing.class);
|
||||
set.remove(EnumFacing.null);
|
||||
return set;
|
||||
return EnumSet.allOf(EnumFacing.class);
|
||||
}
|
||||
|
||||
return EnumSet.noneOf(EnumFacing.class);
|
||||
@@ -112,7 +110,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos());
|
||||
|
||||
if(registered != this)
|
||||
{
|
||||
@@ -134,7 +132,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, xCoord, yCoord, zCoord);
|
||||
TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos());
|
||||
|
||||
if(registered instanceof IEnergyTile)
|
||||
{
|
||||
@@ -161,11 +159,11 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
|
||||
mode = dataStream.readBoolean();
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -430,7 +428,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakRightClick(EntityPlayer player, int side)
|
||||
public boolean onSneakRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
@@ -446,7 +444,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRightClick(EntityPlayer player, int side)
|
||||
public boolean onRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -16,12 +16,6 @@ public class TileEntityInductionProvider extends TileEntityBasicBlock
|
||||
@Override
|
||||
public void onUpdate() {}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return LangUtils.localize(getBlockType().getUnlocalizedName() + ".InductionProvider" + tier.getBaseTier().getName() + ".name");
|
||||
@@ -34,13 +28,13 @@ public class TileEntityInductionProvider extends TileEntityBasicBlock
|
||||
|
||||
super.handlePacketData(dataStream);
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
data.add(tier.ordinal());
|
||||
data.add(tier);
|
||||
|
||||
super.getNetworkedData(data);
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
{
|
||||
if(isActive)
|
||||
{
|
||||
MovingObjectPosition mop = LaserManager.fireLaserClient(this, EnumFacing.getFront(facing), usage.laserUsage, worldObj);
|
||||
Coord4D hitCoord = mop == null ? null : new Coord4D(mop.blockX, mop.blockY, mop.blockZ);
|
||||
MovingObjectPosition mop = LaserManager.fireLaserClient(this, facing, usage.laserUsage, worldObj);
|
||||
Coord4D hitCoord = mop == null ? null : new Coord4D(mop);
|
||||
|
||||
if(hitCoord == null || !hitCoord.equals(digging))
|
||||
{
|
||||
@@ -60,7 +60,7 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
{
|
||||
Block blockHit = hitCoord.getBlock(worldObj);
|
||||
TileEntity tileHit = hitCoord.getTileEntity(worldObj);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord.xCoord, hitCoord.yCoord, hitCoord.zCoord);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord);
|
||||
|
||||
if(!(hardness < 0 || (tileHit instanceof ILaserReceptor && !((ILaserReceptor)tileHit).canLasersDig())))
|
||||
{
|
||||
@@ -79,8 +79,8 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
{
|
||||
setActive(true);
|
||||
|
||||
LaserInfo info = LaserManager.fireLaser(this, EnumFacing.getFront(facing), usage.laserUsage, worldObj);
|
||||
Coord4D hitCoord = info.movingPos == null ? null : new Coord4D(info.movingPos.blockX, info.movingPos.blockY, info.movingPos.blockZ);
|
||||
LaserInfo info = LaserManager.fireLaser(this, facing, usage.laserUsage, worldObj);
|
||||
Coord4D hitCoord = info.movingPos == null ? null : new Coord4D(info.movingPos);
|
||||
|
||||
if(hitCoord == null || !hitCoord.equals(digging))
|
||||
{
|
||||
@@ -92,7 +92,7 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
{
|
||||
Block blockHit = hitCoord.getBlock(worldObj);
|
||||
TileEntity tileHit = hitCoord.getTileEntity(worldObj);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord.xCoord, hitCoord.yCoord, hitCoord.zCoord);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord);
|
||||
|
||||
if(!(hardness < 0 || (tileHit instanceof ILaserReceptor && !((ILaserReceptor)tileHit).canLasersDig())))
|
||||
{
|
||||
@@ -118,7 +118,7 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
return EnumSet.of(EnumFacing.getFront(facing).getOpposite());
|
||||
return EnumSet.of(facing.getOpposite());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -128,7 +128,7 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
|
||||
if(clientActive != active)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
clientActive = active;
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -168,7 +168,7 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
|
||||
|
||||
isActive = dataStream.readBoolean();
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,8 +68,8 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
{
|
||||
if(on)
|
||||
{
|
||||
MovingObjectPosition mop = LaserManager.fireLaserClient(this, EnumFacing.getFront(facing), lastFired, worldObj);
|
||||
Coord4D hitCoord = mop == null ? null : new Coord4D(mop.blockX, mop.blockY, mop.blockZ);
|
||||
MovingObjectPosition mop = LaserManager.fireLaserClient(this, facing, lastFired, worldObj);
|
||||
Coord4D hitCoord = mop == null ? null : new Coord4D(mop);
|
||||
|
||||
if(hitCoord == null || !hitCoord.equals(digging))
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
{
|
||||
Block blockHit = hitCoord.getBlock(worldObj);
|
||||
TileEntity tileHit = hitCoord.getTileEntity(worldObj);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord.xCoord, hitCoord.yCoord, hitCoord.zCoord);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord);
|
||||
|
||||
if(!(hardness < 0 || (tileHit instanceof ILaserReceptor && !((ILaserReceptor)tileHit).canLasersDig())))
|
||||
{
|
||||
@@ -117,11 +117,11 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
{
|
||||
on = true;
|
||||
lastFired = firing;
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(50D));
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), Coord4D.get(this).getTargetPoint(50D));
|
||||
}
|
||||
|
||||
LaserInfo info = LaserManager.fireLaser(this, EnumFacing.getFront(facing), firing, worldObj);
|
||||
Coord4D hitCoord = info.movingPos == null ? null : new Coord4D(info.movingPos.blockX, info.movingPos.blockY, info.movingPos.blockZ);
|
||||
LaserInfo info = LaserManager.fireLaser(this, facing, firing, worldObj);
|
||||
Coord4D hitCoord = info.movingPos == null ? null : new Coord4D(info.movingPos);
|
||||
|
||||
if(hitCoord == null || !hitCoord.equals(digging))
|
||||
{
|
||||
@@ -133,7 +133,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
{
|
||||
Block blockHit = hitCoord.getBlock(worldObj);
|
||||
TileEntity tileHit = hitCoord.getTileEntity(worldObj);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord.xCoord, hitCoord.yCoord, hitCoord.zCoord);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord);
|
||||
|
||||
if(!(hardness < 0 || (tileHit instanceof ILaserReceptor && !((ILaserReceptor)tileHit).canLasersDig())))
|
||||
{
|
||||
@@ -155,7 +155,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
{
|
||||
on = false;
|
||||
diggingProgress = 0;
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(50D));
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), Coord4D.get(this).getTargetPoint(50D));
|
||||
}
|
||||
|
||||
if(!entityDetection)
|
||||
@@ -165,7 +165,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
|
||||
if(emittingRedstone != prevRedstone)
|
||||
{
|
||||
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
||||
worldObj.notifyNeighborsOfStateChange(getPos(), getBlockType());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -203,7 +203,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
|
||||
data.add(time);
|
||||
data.add(collectedEnergy);
|
||||
data.add(lastFired);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(emittingRedstone);
|
||||
data.add(entityDetection);
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
||||
{
|
||||
if(on)
|
||||
{
|
||||
MovingObjectPosition mop = LaserManager.fireLaserClient(this, EnumFacing.getFront(facing), lastFired, worldObj);
|
||||
Coord4D hitCoord = mop == null ? null : new Coord4D(mop.blockX, mop.blockY, mop.blockZ);
|
||||
MovingObjectPosition mop = LaserManager.fireLaserClient(this, facing, lastFired, worldObj);
|
||||
Coord4D hitCoord = mop == null ? null : new Coord4D(mop);
|
||||
|
||||
if(hitCoord == null || !hitCoord.equals(digging))
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
||||
{
|
||||
Block blockHit = hitCoord.getBlock(worldObj);
|
||||
TileEntity tileHit = hitCoord.getTileEntity(worldObj);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord.xCoord, hitCoord.yCoord, hitCoord.zCoord);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord);
|
||||
if(!(hardness < 0 || (tileHit instanceof ILaserReceptor && !((ILaserReceptor)tileHit).canLasersDig())))
|
||||
{
|
||||
diggingProgress += lastFired;
|
||||
@@ -96,11 +96,11 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
||||
{
|
||||
on = true;
|
||||
lastFired = firing;
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(50D));
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), Coord4D.get(this).getTargetPoint(50D));
|
||||
}
|
||||
|
||||
LaserInfo info = LaserManager.fireLaser(this, EnumFacing.getFront(facing), firing, worldObj);
|
||||
Coord4D hitCoord = info.movingPos == null ? null : new Coord4D(info.movingPos.blockX, info.movingPos.blockY, info.movingPos.blockZ);
|
||||
LaserInfo info = LaserManager.fireLaser(this, facing, firing, worldObj);
|
||||
Coord4D hitCoord = info.movingPos == null ? null : new Coord4D(info.movingPos);
|
||||
|
||||
if(hitCoord == null || !hitCoord.equals(digging))
|
||||
{
|
||||
@@ -112,7 +112,7 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
||||
{
|
||||
Block blockHit = hitCoord.getBlock(worldObj);
|
||||
TileEntity tileHit = hitCoord.getTileEntity(worldObj);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord.xCoord, hitCoord.yCoord, hitCoord.zCoord);
|
||||
float hardness = blockHit.getBlockHardness(worldObj, hitCoord);
|
||||
if(!(hardness < 0 || (tileHit instanceof ILaserReceptor && !((ILaserReceptor)tileHit).canLasersDig())))
|
||||
{
|
||||
diggingProgress += firing;
|
||||
@@ -132,7 +132,7 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
||||
{
|
||||
on = false;
|
||||
diggingProgress = 0;
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this).getTargetPoint(50D));
|
||||
Mekanism.packetHandler.sendToAllAround(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), Coord4D.get(this).getTargetPoint(50D));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,26 +174,28 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
||||
|
||||
public void dropItem(ItemStack stack)
|
||||
{
|
||||
EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1, zCoord + 0.5, stack);
|
||||
EntityItem item = new EntityItem(worldObj, getPos().getX() + 0.5, getPos().getY() + 1, getPos().getZ() + 0.5, stack);
|
||||
item.motionX = worldObj.rand.nextGaussian() * 0.05;
|
||||
item.motionY = worldObj.rand.nextGaussian() * 0.05 + 0.2;
|
||||
item.motionZ = worldObj.rand.nextGaussian() * 0.05;
|
||||
item.delayBeforeCanPickup = 10;
|
||||
item.setPickupDelay(10);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_)
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public int[] getSlotsForFace(int p_94128_1_)
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return availableSlotIDs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -214,8 +216,6 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
|
||||
on = dataStream.readBoolean();
|
||||
collectedEnergy = dataStream.readDouble();
|
||||
lastFired = dataStream.readDouble();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
@@ -75,8 +76,8 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
if(MekanismUtils.canFunction(this) && delayTicks == 0)
|
||||
{
|
||||
TileEntity back = Coord4D.get(this).offset(EnumFacing.getFront(facing).getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity front = Coord4D.get(this).offset(EnumFacing.getFront(facing)).getTileEntity(worldObj);
|
||||
TileEntity back = Coord4D.get(this).offset(facing.getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity front = Coord4D.get(this).offset(facing).getTileEntity(worldObj);
|
||||
|
||||
if(back instanceof IInventory && (front instanceof ITransporterTile || front instanceof IInventory))
|
||||
{
|
||||
@@ -89,7 +90,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
for(TransporterFilter filter : filters)
|
||||
{
|
||||
inner:
|
||||
for(StackSearcher search = new StackSearcher(inventory, EnumFacing.getFront(facing).getOpposite()); search.i >= 0;)
|
||||
for(StackSearcher search = new StackSearcher(inventory, facing.getOpposite()); search.i >= 0;)
|
||||
{
|
||||
InvStack invStack = filter.getStackFromInventory(search);
|
||||
|
||||
@@ -128,7 +129,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
if(!sentItems && autoEject)
|
||||
{
|
||||
InvStack invStack = InventoryUtils.takeTopStack(inventory, EnumFacing.getFront(facing).getOpposite().ordinal(), new FirstFinder());
|
||||
InvStack invStack = InventoryUtils.takeTopStack(inventory, facing.getOpposite(), new FirstFinder());
|
||||
|
||||
if(invStack != null && invStack.getStack() != null)
|
||||
{
|
||||
@@ -254,7 +255,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
filters.add(TransporterFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
filters.add(TransporterFilter.readFromNBT(tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,14 +298,14 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
// Move filter up
|
||||
int filterIndex = dataStream.readInt();
|
||||
filters.swap( filterIndex, filterIndex - 1 );
|
||||
openInventory();
|
||||
for(EntityPlayer player : playersUsing) openInventory(player); //TODO ?
|
||||
}
|
||||
else if(type == 4)
|
||||
{
|
||||
// Move filter down
|
||||
int filterIndex = dataStream.readInt();
|
||||
filters.swap( filterIndex, filterIndex + 1 );
|
||||
openInventory();
|
||||
for(EntityPlayer player : playersUsing) openInventory(player);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -340,7 +341,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
filters.add(TransporterFilter.readFromPacket(dataStream));
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
else if(type == 1)
|
||||
{
|
||||
@@ -360,7 +361,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
autoEject = dataStream.readBoolean();
|
||||
roundRobin = dataStream.readBoolean();
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
else if(type == 2)
|
||||
{
|
||||
@@ -376,14 +377,14 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(0);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
if(color != null)
|
||||
{
|
||||
@@ -406,14 +407,14 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
return data;
|
||||
}
|
||||
|
||||
public ArrayList getGenericPacket(ArrayList data)
|
||||
public ArrayList getGenericPacket(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(1);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
if(color != null)
|
||||
{
|
||||
@@ -430,7 +431,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
}
|
||||
|
||||
public ArrayList getFilterPacket(ArrayList data)
|
||||
public ArrayList getFilterPacket(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -448,11 +449,11 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
public boolean canSendHome(ItemStack stack)
|
||||
{
|
||||
TileEntity back = Coord4D.get(this).offset(EnumFacing.getFront(facing).getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity back = Coord4D.get(this).offset(facing.getOpposite()).getTileEntity(worldObj);
|
||||
|
||||
if(back instanceof IInventory)
|
||||
{
|
||||
return InventoryUtils.canInsert(back, null, stack, EnumFacing.getFront(facing).getOpposite().ordinal(), true);
|
||||
return InventoryUtils.canInsert(back, null, stack, facing.getOpposite(), true);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -460,23 +461,23 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
public boolean hasInventory()
|
||||
{
|
||||
return Coord4D.get(this).offset(EnumFacing.getFront(facing).getOpposite()).getTileEntity(worldObj) instanceof IInventory;
|
||||
return Coord4D.get(this).offset(facing.getOpposite()).getTileEntity(worldObj) instanceof IInventory;
|
||||
}
|
||||
|
||||
public ItemStack sendHome(ItemStack stack)
|
||||
{
|
||||
TileEntity back = Coord4D.get(this).offset(EnumFacing.getFront(facing).getOpposite()).getTileEntity(worldObj);
|
||||
TileEntity back = Coord4D.get(this).offset(facing.getOpposite()).getTileEntity(worldObj);
|
||||
|
||||
if(back instanceof IInventory)
|
||||
{
|
||||
return InventoryUtils.putStackInInventory((IInventory)back, stack, EnumFacing.getFront(facing).getOpposite().ordinal(), true);
|
||||
return InventoryUtils.putStackInInventory((IInventory)back, stack, facing.getOpposite(), true);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -494,9 +495,9 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == EnumFacing.getFront(facing).ordinal() || side == EnumFacing.getFront(facing).getOpposite().ordinal())
|
||||
if(side == facing || side == facing.getOpposite())
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
@@ -505,11 +506,11 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
public void openInventory(EntityPlayer player)
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getFilterPacket(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getFilterPacket(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,11 +539,11 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
if(clientActive != active)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
if(active)
|
||||
{
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "mekanism:etc.Click", 0.3F, 1);
|
||||
worldObj.playSoundEffect(getPos().getX(), getPos().getY(), getPos().getZ(), "mekanism:etc.Click", 0.3F, 1);
|
||||
}
|
||||
|
||||
clientActive = active;
|
||||
@@ -632,7 +633,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
filters.add(TransporterFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
filters.add(TransporterFilter.readFromNBT(tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -690,7 +691,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
filters.add(TransporterFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
filters.add(TransporterFilter.readFromNBT(tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 4)
|
||||
{
|
||||
@@ -334,19 +334,19 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
{
|
||||
updateDelay = general.UPDATE_DELAY;
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(operatingTicks);
|
||||
data.add(infuseStored.amount);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
if(infuseStored.type != null)
|
||||
{
|
||||
@@ -394,7 +394,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.ITEM, side, facing).availableSlots;
|
||||
}
|
||||
@@ -412,7 +412,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
@@ -432,7 +432,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrientation()
|
||||
public EnumFacing getOrientation()
|
||||
{
|
||||
return facing;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public abstract class TileEntityMultiblock<T extends SynchronizedData<T>> extend
|
||||
update();
|
||||
}
|
||||
|
||||
if(prevStructure != (structure != null))
|
||||
if(prevStructure == (structure == null))
|
||||
{
|
||||
if(structure != null && !getSynchronizedData().hasRenderer)
|
||||
{
|
||||
@@ -111,11 +111,11 @@ public abstract class TileEntityMultiblock<T extends SynchronizedData<T>> extend
|
||||
|
||||
if(!obj.isAirBlock(worldObj) && (obj.getTileEntity(worldObj) == null || obj.getTileEntity(worldObj).getClass() != getClass()))
|
||||
{
|
||||
obj.getBlock(worldObj).onNeighborChange(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, xCoord, yCoord, zCoord);
|
||||
obj.getBlock(worldObj).onNeighborChange(worldObj, obj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
|
||||
prevStructure = structure != null;
|
||||
@@ -158,7 +158,7 @@ public abstract class TileEntityMultiblock<T extends SynchronizedData<T>> extend
|
||||
|
||||
if(tileEntity != null && tileEntity.isRendering)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(tileEntity)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(tileEntity), tileEntity.getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(tileEntity)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public abstract class TileEntityMultiblock<T extends SynchronizedData<T>> extend
|
||||
public abstract MultiblockManager<T> getManager();
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import mekanism.common.base.IHasSound;
|
||||
import mekanism.common.base.SoundWrapper;
|
||||
import net.minecraft.client.audio.ISound.AttenuationType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -75,9 +76,9 @@ public abstract class TileEntityNoisyElectricBlock extends TileEntityElectricBlo
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Pos3D getSoundPosition()
|
||||
public Vec3 getSoundPosition()
|
||||
{
|
||||
return new Pos3D(xCoord+0.5, yCoord+0.5, zCoord+0.5);
|
||||
return new Vec3(getPos()).addVector(0.5, 0.5, 0.5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,12 +2,5 @@ package mekanism.common.tile;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
//For a TESR
|
||||
public class TileEntityObsidianTNT extends TileEntity
|
||||
{
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Deprecated //Don't need this any more?
|
||||
public class TileEntityObsidianTNT extends TileEntity {}
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -152,13 +153,13 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == MekanismUtils.getLeft(facing).ordinal())
|
||||
if(side == MekanismUtils.getLeft(facing))
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
else if(side == MekanismUtils.getRight(facing).ordinal())
|
||||
else if(side == MekanismUtils.getRight(facing))
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
@@ -168,7 +169,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return slotID == 1;
|
||||
}
|
||||
@@ -176,12 +177,8 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemstack)
|
||||
{
|
||||
if(slotID == 0)
|
||||
{
|
||||
return getResult(itemstack) != null;
|
||||
}
|
||||
return slotID == 0 && getResult(itemstack) != null;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -219,7 +216,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
filters.add(OredictionificatorFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
filters.add(OredictionificatorFilter.readFromNBT(tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,13 +261,13 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(0);
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(didProcess);
|
||||
|
||||
data.add(filters.size());
|
||||
@@ -283,20 +280,20 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
return data;
|
||||
}
|
||||
|
||||
public ArrayList getGenericPacket(ArrayList data)
|
||||
public ArrayList getGenericPacket(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(1);
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(didProcess);
|
||||
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
public ArrayList getFilterPacket(ArrayList data)
|
||||
public ArrayList getFilterPacket(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -313,11 +310,11 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
public void openInventory(EntityPlayer player)
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getFilterPacket(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getFilterPacket(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,7 +351,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
filters.add(OredictionificatorFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
filters.add(OredictionificatorFilter.readFromNBT(tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -396,7 +393,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
|
||||
for(int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
filters.add(OredictionificatorFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
|
||||
filters.add(OredictionificatorFilter.readFromNBT(tagList.getCompoundTagAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -437,7 +434,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
index = nbtTags.getInteger("index");
|
||||
}
|
||||
|
||||
public void write(ArrayList data)
|
||||
public void write(ArrayList<Object> data)
|
||||
{
|
||||
data.add(filter);
|
||||
data.add(index);
|
||||
|
||||
@@ -179,7 +179,7 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -355,7 +355,7 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
|
||||
@Override
|
||||
public boolean canFill(EnumFacing from, Fluid fluid)
|
||||
{
|
||||
SideData data = configComponent.getOutput(TransmissionType.FLUID, from.ordinal(), facing);
|
||||
SideData data = configComponent.getOutput(TransmissionType.FLUID, from, facing);
|
||||
|
||||
if(data.hasSlot(0))
|
||||
{
|
||||
@@ -374,7 +374,7 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(EnumFacing from)
|
||||
{
|
||||
SideData data = configComponent.getOutput(TransmissionType.FLUID, from.ordinal(), facing);
|
||||
SideData data = configComponent.getOutput(TransmissionType.FLUID, from, facing);
|
||||
|
||||
return data.getFluidTankInfo(this);
|
||||
}
|
||||
@@ -416,19 +416,19 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(1) && inputGasTank.canReceive(type);
|
||||
return configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(1) && inputGasTank.canReceive(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(2) && outputGasTank.canDraw(type);
|
||||
return configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(2) && outputGasTank.canDraw(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side)
|
||||
{
|
||||
return configComponent.getOutput(TransmissionType.GAS, side.ordinal(), facing).hasSlot(1, 2);
|
||||
return configComponent.getOutput(TransmissionType.GAS, side, facing).hasSlot(1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -73,7 +75,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +295,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
if(slotID == 1)
|
||||
{
|
||||
@@ -311,22 +313,18 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemstack)
|
||||
{
|
||||
if(slotID == 0)
|
||||
{
|
||||
return FluidContainerRegistry.isContainer(itemstack);
|
||||
}
|
||||
return slotID == 0 && FluidContainerRegistry.isContainer(itemstack);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
if(side == 0)
|
||||
if(side == EnumFacing.DOWN)
|
||||
{
|
||||
return new int[] {1};
|
||||
}
|
||||
else if(side == 1)
|
||||
else if(side == EnumFacing.UP)
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
@@ -373,7 +371,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
|
||||
if(valve > 0)
|
||||
{
|
||||
valveFluid = FluidRegistry.getFluid(dataStream.readInt());
|
||||
valveFluid = FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream));
|
||||
}
|
||||
else {
|
||||
valveFluid = null;
|
||||
@@ -381,7 +379,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(dataStream.readInt()), dataStream.readInt()));
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
fluidTank.setFluid(null);
|
||||
@@ -391,7 +389,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
{
|
||||
updateDelay = general.UPDATE_DELAY;
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,23 +408,23 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(valve);
|
||||
data.add(editMode.ordinal());
|
||||
data.add(editMode);
|
||||
|
||||
if(valve > 0)
|
||||
{
|
||||
data.add(valveFluid.getID());
|
||||
data.add(valveFluid.getName());
|
||||
}
|
||||
|
||||
if(fluidTank.getFluid() != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(fluidTank.getFluid().getFluidID());
|
||||
data.add(fluidTank.getFluid().getFluid().getName());
|
||||
data.add(fluidTank.getFluid().amount);
|
||||
}
|
||||
else {
|
||||
@@ -443,7 +441,7 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
@@ -469,19 +467,19 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakRightClick(EntityPlayer player, int side)
|
||||
public boolean onSneakRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
setActive(!getActive());
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.click", 0.3F, 1);
|
||||
worldObj.playSoundEffect(getPos().getX(), getPos().getY(), getPos().getZ(), "random.click", 0.3F, 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onRightClick(EntityPlayer player, int side)
|
||||
public boolean onRightClick(EntityPlayer player, EnumFacing side)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -560,12 +558,8 @@ public class TileEntityPortableTank extends TileEntityContainerBlock implements
|
||||
{
|
||||
if(fluid == null || fluidTank.getFluid() != null && fluidTank.getFluid().getFluid() == fluid)
|
||||
{
|
||||
if(isActive)
|
||||
{
|
||||
return from != EnumFacing.DOWN;
|
||||
}
|
||||
|
||||
return true;
|
||||
return !(isActive && from == EnumFacing.DOWN);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,11 +38,13 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock implements IActiveState, ISustainedData, IFluidHandler, IGasHandler, ITubeConnection, IRedstoneControl, IUpgradeTile, IUpgradeInfoHandler, ITankManager
|
||||
{
|
||||
@@ -96,7 +98,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,32 +328,20 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
|
||||
public boolean isValidGas(GasStack g)
|
||||
{
|
||||
if(g == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return g != null && g.getGas().hasFluid();
|
||||
|
||||
return g.getGas().hasFluid();
|
||||
}
|
||||
|
||||
public boolean gasEquals(GasStack gas, FluidStack fluid)
|
||||
{
|
||||
if(fluid == null || gas == null || !gas.getGas().hasFluid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return fluid != null && gas != null && gas.getGas().hasFluid() && gas.getGas().getFluid() == fluid.getFluid();
|
||||
|
||||
return gas.getGas().getFluid() == fluid.getFluid();
|
||||
}
|
||||
|
||||
public boolean isValidFluid(FluidStack f)
|
||||
{
|
||||
if(f == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return f != null && GasRegistry.getGas(f.getFluid()) != null;
|
||||
|
||||
return GasRegistry.getGas(f.getFluid()) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -368,7 +358,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
|
||||
for(EntityPlayer player : playersUsing)
|
||||
{
|
||||
Mekanism.packetHandler.sendTo(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), (EntityPlayerMP)player);
|
||||
Mekanism.packetHandler.sendTo(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), (EntityPlayerMP)player);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -383,7 +373,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
|
||||
if(dataStream.readBoolean())
|
||||
{
|
||||
fluidTank.setFluid(new FluidStack(dataStream.readInt(), dataStream.readInt()));
|
||||
fluidTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
fluidTank.setFluid(null);
|
||||
@@ -398,23 +388,23 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
}
|
||||
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(mode);
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
data.add(clientEnergyUsed);
|
||||
|
||||
if(fluidTank.getFluid() != null)
|
||||
{
|
||||
data.add(true);
|
||||
data.add(fluidTank.getFluid().getFluidID());
|
||||
data.add(fluidTank.getFluid().getFluid().getName());
|
||||
data.add(fluidTank.getFluid().amount);
|
||||
}
|
||||
else {
|
||||
@@ -473,16 +463,6 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
return i != 0 && i != 1;
|
||||
}
|
||||
|
||||
public int getScaledFluidLevel(int i)
|
||||
{
|
||||
return fluidTank.getFluid() != null ? fluidTank.getFluid().amount*i / MAX_FLUID : 0;
|
||||
}
|
||||
|
||||
public int getScaledGasLevel(int i)
|
||||
{
|
||||
return gasTank.getGas() != null ? gasTank.getStored()*i / MAX_FLUID : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActive(boolean active)
|
||||
{
|
||||
@@ -490,7 +470,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
@@ -548,13 +528,13 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
@Override
|
||||
public boolean canDrawGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return mode == 1 && side == MekanismUtils.getLeft(facing) ? gasTank.canDraw(type) : false;
|
||||
return (mode == 1 && side == MekanismUtils.getLeft(facing)) && gasTank.canDraw(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return mode == 0 && side == MekanismUtils.getLeft(facing) ? gasTank.canReceive(type) : false;
|
||||
return (mode == 0 && side == MekanismUtils.getLeft(facing)) && gasTank.canReceive(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
||||
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,17 +128,17 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
||||
{
|
||||
updateDelay = general.UPDATE_DELAY;
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
|
||||
@@ -29,8 +29,10 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -121,7 +123,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
{
|
||||
if(Math.abs((float)inputTank.getFluidAmount()/inputTank.getCapacity()-prevScale) > 0.01)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
prevScale = (float)inputTank.getFluidAmount()/inputTank.getCapacity();
|
||||
}
|
||||
}
|
||||
@@ -151,12 +153,8 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
|
||||
public boolean hasRecipe(Fluid fluid)
|
||||
{
|
||||
if(fluid == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Recipe.SOLAR_EVAPORATION_PLANT.containsRecipe(fluid);
|
||||
return fluid != null && Recipe.SOLAR_EVAPORATION_PLANT.containsRecipe(fluid);
|
||||
|
||||
}
|
||||
|
||||
protected void refresh()
|
||||
@@ -199,13 +197,9 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(recipe != null && recipe.canOperate(inputTank, outputTank))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return recipe != null && recipe.canOperate(inputTank, outputTank);
|
||||
|
||||
}
|
||||
|
||||
private void manageBuckets()
|
||||
@@ -340,7 +334,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
{
|
||||
if(!temperatureSet)
|
||||
{
|
||||
biomeTemp = worldObj.getBiomeGenForCoordsBody(xCoord, zCoord).getFloatTemperature(xCoord, yCoord, zCoord);
|
||||
biomeTemp = worldObj.getBiomeGenForCoordsBody(getPos()).getFloatTemperature(getPos());
|
||||
temperatureSet = true;
|
||||
}
|
||||
|
||||
@@ -380,7 +374,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
|
||||
while(startPoint.offset(EnumFacing.UP).getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock)
|
||||
{
|
||||
startPoint.step(EnumFacing.UP);
|
||||
startPoint = startPoint.offset(EnumFacing.UP);
|
||||
}
|
||||
|
||||
Coord4D test = startPoint.offset(EnumFacing.DOWN).offset(right, 2);
|
||||
@@ -575,16 +569,6 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
}
|
||||
}
|
||||
|
||||
public int getScaledInputLevel(int i)
|
||||
{
|
||||
return getMaxFluid() > 0 ? (inputTank.getFluid() != null ? inputTank.getFluid().amount*i / getMaxFluid() : 0) : 0;
|
||||
}
|
||||
|
||||
public int getScaledOutputLevel(int i)
|
||||
{
|
||||
return outputTank.getFluid() != null ? outputTank.getFluid().amount*i / MAX_OUTPUT : 0;
|
||||
}
|
||||
|
||||
public int getScaledTempLevel(int i)
|
||||
{
|
||||
return (int)(getMaxTemperature() == 0 ? 0 : getTemperature()*i/getMaxTemperature());
|
||||
@@ -601,8 +585,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
Coord4D startPoint = Coord4D.get(this).offset(right);
|
||||
startPoint = isLeftOnFace ? startPoint.offset(right) : startPoint;
|
||||
|
||||
startPoint = startPoint.offset(right.getOpposite()).offset(MekanismUtils.getBack(facing));
|
||||
startPoint.translate(0, -(height-2), 0);
|
||||
startPoint = startPoint.offset(right.getOpposite()).offset(MekanismUtils.getBack(facing)).add(0, -(height-2), 0);
|
||||
|
||||
return startPoint;
|
||||
}
|
||||
@@ -614,7 +597,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
|
||||
if(dataStream.readBoolean())
|
||||
{
|
||||
inputTank.setFluid(new FluidStack(dataStream.readInt(), dataStream.readInt()));
|
||||
inputTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
inputTank.setFluid(null);
|
||||
@@ -622,7 +605,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
|
||||
if(dataStream.readBoolean())
|
||||
{
|
||||
outputTank.setFluid(new FluidStack(dataStream.readInt(), dataStream.readInt()));
|
||||
outputTank.setFluid(new FluidStack(FluidRegistry.getFluid(ByteBufUtils.readUTF8String(dataStream)), dataStream.readInt()));
|
||||
}
|
||||
else {
|
||||
outputTank.setFluid(null);
|
||||
@@ -641,7 +624,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
if(structured != prev)
|
||||
{
|
||||
inputTank.setCapacity(getMaxFluid());
|
||||
worldObj.func_147479_m(xCoord, yCoord, zCoord);
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos().add(1,1,1));
|
||||
|
||||
if(structured)
|
||||
{
|
||||
@@ -655,18 +638,18 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
}
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
if(inputTank.getFluid() != null)
|
||||
{
|
||||
data.add(true);
|
||||
data.add(inputTank.getFluid().getFluidID());
|
||||
data.add(inputTank.getFluid().getFluid().getName());
|
||||
data.add(inputTank.getFluid().amount);
|
||||
}
|
||||
else {
|
||||
@@ -676,7 +659,7 @@ public class TileEntitySolarEvaporationController extends TileEntitySolarEvapora
|
||||
if(outputTank.getFluid() != null)
|
||||
{
|
||||
data.add(true);
|
||||
data.add(outputTank.getFluid().getFluidID());
|
||||
data.add(outputTank.getFluid().getFluid().getName());
|
||||
data.add(outputTank.getFluid().amount);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class TileEntitySolarEvaporationValve extends TileEntitySolarEvaporationB
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
if((master != null) != prevMaster)
|
||||
if((master == null) == prevMaster)
|
||||
{
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
@@ -27,7 +27,7 @@ public class TileEntitySolarEvaporationValve extends TileEntitySolarEvaporationB
|
||||
|
||||
if(!obj.isAirBlock(worldObj) && !(obj.getTileEntity(worldObj) instanceof TileEntitySolarEvaporationBlock))
|
||||
{
|
||||
obj.getBlock(worldObj).onNeighborChange(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, xCoord, yCoord, zCoord);
|
||||
obj.getBlock(worldObj).onNeighborChange(worldObj, obj, getPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
if(updateDelay == 0 && clientActive != isActive)
|
||||
{
|
||||
isActive = clientActive;
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
|
||||
SolarNeutronRecipe recipe = getRecipe();
|
||||
|
||||
boolean sky = ((!worldObj.isRaining() && !worldObj.isThundering()) || isDesert()) && !worldObj.provider.hasNoSky && worldObj.canBlockSeeTheSky(xCoord, yCoord+1, zCoord);
|
||||
boolean sky = ((!worldObj.isRaining() && !worldObj.isThundering()) || isDesert()) && !worldObj.provider.getHasNoSky() && worldObj.canSeeSky(getPos().up());
|
||||
|
||||
if(worldObj.isDaytime() && sky && canOperate(recipe) && MekanismUtils.canFunction(this))
|
||||
{
|
||||
@@ -121,13 +121,13 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
{
|
||||
GasStack toSend = new GasStack(outputTank.getGas().getGas(), Math.min(outputTank.getStored(), gasOutput));
|
||||
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(EnumFacing.getFront(facing)).getTileEntity(worldObj);
|
||||
TileEntity tileEntity = Coord4D.get(this).offset(facing).getTileEntity(worldObj);
|
||||
|
||||
if(tileEntity instanceof IGasHandler)
|
||||
{
|
||||
if(((IGasHandler)tileEntity).canReceiveGas(EnumFacing.getFront(facing).getOpposite(), outputTank.getGas().getGas()))
|
||||
if(((IGasHandler)tileEntity).canReceiveGas(facing.getOpposite(), outputTank.getGas().getGas()))
|
||||
{
|
||||
outputTank.draw(((IGasHandler)tileEntity).receiveGas(EnumFacing.getFront(facing).getOpposite(), toSend, true), true);
|
||||
outputTank.draw(((IGasHandler)tileEntity).receiveGas(facing.getOpposite(), toSend, true), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
|
||||
public boolean isDesert()
|
||||
{
|
||||
return worldObj.provider.getBiomeGenForCoords(xCoord >> 4, zCoord >> 4) instanceof BiomeGenDesert;
|
||||
return worldObj.provider.getBiomeGenForCoords(getPos()) instanceof BiomeGenDesert;
|
||||
}
|
||||
|
||||
public SolarNeutronRecipe getRecipe()
|
||||
@@ -191,17 +191,17 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
outputTank.setGas(null);
|
||||
}
|
||||
|
||||
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
|
||||
MekanismUtils.updateBlock(worldObj, getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(recipeTicks);
|
||||
data.add(controlType.ordinal());
|
||||
data.add(controlType);
|
||||
|
||||
if(inputTank.getGas() != null)
|
||||
{
|
||||
@@ -267,8 +267,8 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
@Override
|
||||
public void onBreak()
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord+1, zCoord);
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlockToAir(getPos().up());
|
||||
worldObj.setBlockToAir(getPos());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -314,13 +314,13 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
@Override
|
||||
public boolean canDrawGas(EnumFacing side, Gas type)
|
||||
{
|
||||
return side == EnumFacing.getFront(facing) && outputTank.canDraw(type);
|
||||
return side == facing && outputTank.canDraw(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTubeConnect(EnumFacing side)
|
||||
{
|
||||
return side == EnumFacing.getFront(facing) || side == EnumFacing.DOWN;
|
||||
return side == facing || side == EnumFacing.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -376,7 +376,7 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
|
||||
if(clientActive != active && updateDelay == 0)
|
||||
{
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList<Object>())), new Range4D(Coord4D.get(this)));
|
||||
|
||||
updateDelay = 10;
|
||||
clientActive = active;
|
||||
|
||||
@@ -8,7 +8,7 @@ import mekanism.common.multiblock.IMultiblock;
|
||||
import mekanism.common.multiblock.IStructuralMultiblock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
public class TileEntityStructuralGlass extends TileEntity implements IStructuralMultiblock
|
||||
{
|
||||
@@ -81,9 +81,9 @@ public class TileEntityStructuralGlass extends TileEntity implements IStructural
|
||||
|
||||
iterated.add(pos);
|
||||
|
||||
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
{
|
||||
Coord4D coord = pos.getFromSide(side);
|
||||
Coord4D coord = pos.offset(side);
|
||||
TileEntity tile = coord.getTileEntity(worldObj);
|
||||
|
||||
if(!iterated.contains(coord))
|
||||
|
||||
@@ -18,6 +18,8 @@ import mekanism.common.network.PacketPortalFX.PortalFXMessage;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -29,6 +31,7 @@ import net.minecraft.network.play.server.S1FPacketSetExperience;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
@@ -88,9 +91,9 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
if(ticket != null)
|
||||
{
|
||||
ticket.getModData().setInteger("xCoord", xCoord);
|
||||
ticket.getModData().setInteger("yCoord", yCoord);
|
||||
ticket.getModData().setInteger("zCoord", zCoord);
|
||||
ticket.getModData().setInteger("xCoord", getPos().getX());
|
||||
ticket.getModData().setInteger("yCoord", getPos().getY());
|
||||
ticket.getModData().setInteger("zCoord", getPos().getZ());
|
||||
|
||||
forceChunks(ticket);
|
||||
}
|
||||
@@ -153,7 +156,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
public void setFrequency(String name, boolean publicFreq)
|
||||
{
|
||||
if(name.equals(frequency))
|
||||
if(name.equals(frequency.name))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -264,7 +267,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(int side)
|
||||
public int[] getSlotsForFace(EnumFacing side)
|
||||
{
|
||||
return new int[] {0};
|
||||
}
|
||||
@@ -282,7 +285,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
public void resetBounds()
|
||||
{
|
||||
teleportBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord+1, yCoord+3, zCoord+1);
|
||||
teleportBounds = new AxisAlignedBB(getPos(), getPos().add(1, 3, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -374,29 +377,26 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
WorldServer oldWorld = player.mcServer.worldServerForDimension(player.dimension);
|
||||
player.dimension = coord.dimensionId;
|
||||
WorldServer newWorld = player.mcServer.worldServerForDimension(player.dimension);
|
||||
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, newWorld.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
|
||||
player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.getDifficulty(), newWorld.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
|
||||
oldWorld.removePlayerEntityDangerously(player);
|
||||
player.isDead = false;
|
||||
|
||||
if(player.isEntityAlive())
|
||||
{
|
||||
newWorld.spawnEntityInWorld(player);
|
||||
player.setLocationAndAngles(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
|
||||
player.setLocationAndAngles(coord.getX()+0.5, coord.getY()+1, coord.getZ()+0.5, player.rotationYaw, player.rotationPitch);
|
||||
newWorld.updateEntityWithOptionalForce(player, false);
|
||||
player.setWorld(newWorld);
|
||||
}
|
||||
|
||||
player.mcServer.getConfigurationManager().func_72375_a(player, oldWorld);
|
||||
player.playerNetServerHandler.setPlayerLocation(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
|
||||
player.mcServer.getConfigurationManager().preparePlayer(player, oldWorld);
|
||||
player.playerNetServerHandler.setPlayerLocation(coord.getX()+0.5, coord.getY()+1, coord.getZ()+0.5, player.rotationYaw, player.rotationPitch);
|
||||
player.theItemInWorldManager.setWorld(newWorld);
|
||||
player.mcServer.getConfigurationManager().updateTimeAndWeatherForPlayer(player, newWorld);
|
||||
player.mcServer.getConfigurationManager().syncPlayerInventory(player);
|
||||
|
||||
Iterator iterator = player.getActivePotionEffects().iterator();
|
||||
|
||||
while(iterator.hasNext())
|
||||
for(PotionEffect potioneffect : player.getActivePotionEffects())
|
||||
{
|
||||
PotionEffect potioneffect = (PotionEffect)iterator.next();
|
||||
player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, id, coord.dimensionId);
|
||||
}
|
||||
else {
|
||||
player.playerNetServerHandler.setPlayerLocation(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, player.rotationYaw, player.rotationPitch);
|
||||
player.playerNetServerHandler.setPlayerLocation(coord.getX()+0.5, coord.getY()+1, coord.getZ()+0.5, player.rotationYaw, player.rotationPitch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
entity.isDead = false;
|
||||
|
||||
world.spawnEntityInWorld(entity);
|
||||
entity.setLocationAndAngles(coord.xCoord+0.5, coord.yCoord+1, coord.zCoord+0.5, entity.rotationYaw, entity.rotationPitch);
|
||||
entity.setLocationAndAngles(coord.getX()+0.5, coord.getY()+1, coord.getZ()+0.5, entity.rotationYaw, entity.rotationPitch);
|
||||
world.updateEntityWithOptionalForce(entity, false);
|
||||
entity.setWorld(world);
|
||||
world.resetUpdateEntityTick();
|
||||
@@ -428,7 +428,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
if(e != null)
|
||||
{
|
||||
e.copyDataFrom(entity, true);
|
||||
e.copyDataFromOld(entity/*, true*/);
|
||||
world.spawnEntityInWorld(e);
|
||||
teleporter.didTeleport.add(e);
|
||||
}
|
||||
@@ -499,7 +499,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
energyCost+=10000;
|
||||
}
|
||||
|
||||
int distance = (int)entity.getDistance(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
int distance = (int)entity.getDistance(coords.getX(), coords.getY(), coords.getZ());
|
||||
energyCost+=(distance*10);
|
||||
|
||||
return energyCost;
|
||||
@@ -507,22 +507,23 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
public boolean hasFrame()
|
||||
{
|
||||
if(isFrame(xCoord-1, yCoord, zCoord) && isFrame(xCoord+1, yCoord, zCoord)
|
||||
&& isFrame(xCoord-1, yCoord+1, zCoord) && isFrame(xCoord+1, yCoord+1, zCoord)
|
||||
&& isFrame(xCoord-1, yCoord+2, zCoord) && isFrame(xCoord+1, yCoord+2, zCoord)
|
||||
&& isFrame(xCoord-1, yCoord+3, zCoord) && isFrame(xCoord+1, yCoord+3, zCoord)
|
||||
&& isFrame(xCoord, yCoord+3, zCoord)) {return true;}
|
||||
if(isFrame(xCoord, yCoord, zCoord-1) && isFrame(xCoord, yCoord, zCoord+1)
|
||||
&& isFrame(xCoord, yCoord+1, zCoord-1) && isFrame(xCoord, yCoord+1, zCoord+1)
|
||||
&& isFrame(xCoord, yCoord+2, zCoord-1) && isFrame(xCoord, yCoord+2, zCoord+1)
|
||||
&& isFrame(xCoord, yCoord+3, zCoord-1) && isFrame(xCoord, yCoord+3, zCoord+1)
|
||||
&& isFrame(xCoord, yCoord+3, zCoord)) {return true;}
|
||||
if(isFrame(getPos().getX()-1, getPos().getY(), getPos().getZ()) && isFrame(getPos().getX()+1, getPos().getY(), getPos().getZ())
|
||||
&& isFrame(getPos().getX()-1, getPos().getY()+1, getPos().getZ()) && isFrame(getPos().getX()+1, getPos().getY()+1, getPos().getZ())
|
||||
&& isFrame(getPos().getX()-1, getPos().getY()+2, getPos().getZ()) && isFrame(getPos().getX()+1, getPos().getY()+2, getPos().getZ())
|
||||
&& isFrame(getPos().getX()-1, getPos().getY()+3, getPos().getZ()) && isFrame(getPos().getX()+1, getPos().getY()+3, getPos().getZ())
|
||||
&& isFrame(getPos().getX(), getPos().getY()+3, getPos().getZ())) {return true;}
|
||||
if(isFrame(getPos().getX(), getPos().getY(), getPos().getZ()-1) && isFrame(getPos().getX(), getPos().getY(), getPos().getZ()+1)
|
||||
&& isFrame(getPos().getX(), getPos().getY()+1, getPos().getZ()-1) && isFrame(getPos().getX(), getPos().getY()+1, getPos().getZ()+1)
|
||||
&& isFrame(getPos().getX(), getPos().getY()+2, getPos().getZ()-1) && isFrame(getPos().getX(), getPos().getY()+2, getPos().getZ()+1)
|
||||
&& isFrame(getPos().getX(), getPos().getY()+3, getPos().getZ()-1) && isFrame(getPos().getX(), getPos().getY()+3, getPos().getZ()+1)
|
||||
&& isFrame(getPos().getX(), getPos().getY()+3, getPos().getZ())) {return true;}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isFrame(int x, int y, int z)
|
||||
{
|
||||
return worldObj.getBlock(x, y, z) == MekanismBlocks.BasicBlock && worldObj.getBlockMetadata(x, y, z) == 7;
|
||||
IBlockState state = worldObj.getBlockState(new BlockPos(x, y, z));
|
||||
return state.getBlock() == MekanismBlocks.BasicBlock && state.getBlock().getMetaFromState(state) == 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -630,7 +631,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -681,7 +682,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side)
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, EnumFacing side)
|
||||
{
|
||||
return ChargeUtils.canBeOutputted(itemstack, false);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mekanism.common.tile;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -23,9 +24,12 @@ import mekanism.common.util.HeatUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fml.common.network.ByteBufUtils;
|
||||
|
||||
public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<SynchronizedBoilerData> implements IFluidContainerManager, IHeatTransfer
|
||||
{
|
||||
@@ -298,7 +302,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
@@ -306,13 +310,13 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
{
|
||||
data.add(structure.volume*BoilerUpdateProtocol.WATER_PER_TANK);
|
||||
data.add(structure.volume*BoilerUpdateProtocol.STEAM_PER_TANK);
|
||||
data.add(structure.editMode.ordinal());
|
||||
data.add(structure.editMode);
|
||||
}
|
||||
|
||||
if(structure != null && structure.waterStored != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(structure.waterStored.getFluidID());
|
||||
data.add(structure.waterStored.getFluid().getName());
|
||||
data.add(structure.waterStored.amount);
|
||||
}
|
||||
else {
|
||||
@@ -322,7 +326,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
if(structure != null && structure.steamStored != null)
|
||||
{
|
||||
data.add(1);
|
||||
data.add(structure.steamStored.getFluidID());
|
||||
data.add(structure.steamStored.getFluid().getName());
|
||||
data.add(structure.steamStored.amount);
|
||||
}
|
||||
else {
|
||||
@@ -337,7 +341,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
{
|
||||
valveData.location.write(data);
|
||||
|
||||
data.add(valveData.side.ordinal());
|
||||
data.add(valveData.side);
|
||||
data.add(valveData.serverFluid);
|
||||
}
|
||||
}
|
||||
@@ -359,7 +363,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
structure.waterStored = new FluidStack(dataStream.readInt(), dataStream.readInt());
|
||||
structure.waterStored = FluidRegistry.getFluidStack(ByteBufUtils.readUTF8String(dataStream), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.waterStored = null;
|
||||
@@ -367,7 +371,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
|
||||
if(dataStream.readInt() == 1)
|
||||
{
|
||||
structure.steamStored = new FluidStack(dataStream.readInt(), dataStream.readInt());
|
||||
structure.steamStored = FluidRegistry.getFluidStack(ByteBufUtils.readUTF8String(dataStream), dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
structure.steamStored = null;
|
||||
@@ -409,26 +413,6 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
}
|
||||
}
|
||||
|
||||
public int getScaledWaterLevel(int i)
|
||||
{
|
||||
if(clientWaterCapacity == 0 || structure.waterStored == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return structure.waterStored.amount*i / clientWaterCapacity;
|
||||
}
|
||||
|
||||
public int getScaledSteamLevel(int i)
|
||||
{
|
||||
if(clientSteamCapacity == 0 || structure.steamStored == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return structure.steamStored.amount*i / clientSteamCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContainerEditMode getContainerEditMode()
|
||||
{
|
||||
@@ -522,7 +506,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
return side == innerSide;
|
||||
}
|
||||
|
||||
if(!Coord4D.get(this).offset(side).getBlock(worldObj).isAir(worldObj, xCoord, yCoord, zCoord))
|
||||
if(!Coord4D.get(this).offset(side).getBlock(worldObj).isAir(worldObj, getPos().offset(side)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -532,20 +516,14 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(side)
|
||||
switch(side.getAxis())
|
||||
{
|
||||
case DOWN:
|
||||
return yCoord == structure.maxLocation.yCoord;
|
||||
case UP:
|
||||
return yCoord == structure.minLocation.yCoord;
|
||||
case NORTH:
|
||||
return zCoord == structure.maxLocation.zCoord;
|
||||
case SOUTH:
|
||||
return zCoord == structure.minLocation.zCoord;
|
||||
case WEST:
|
||||
return xCoord == structure.maxLocation.xCoord;
|
||||
case EAST:
|
||||
return xCoord == structure.minLocation.xCoord;
|
||||
case Y:
|
||||
return getPos().getY() == structure.maxLocation.getY();
|
||||
case Z:
|
||||
return getPos().getZ() == structure.maxLocation.getZ();
|
||||
case X:
|
||||
return getPos().getX() == structure.maxLocation.getX();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -136,9 +136,9 @@ public class TileComponentConfig implements ITileComponent
|
||||
return getOutputs(type).get(getConfig(type)[MekanismUtils.getBaseOrientation(side, facing).ordinal()]);
|
||||
}
|
||||
|
||||
public SideData getOutput(TransmissionType type, int side)
|
||||
public SideData getOutput(TransmissionType type, EnumFacing side)
|
||||
{
|
||||
return getOutputs(type).get(getConfig(type)[side]);
|
||||
return getOutputs(type).get(getConfig(type)[side.ordinal()]);
|
||||
}
|
||||
|
||||
public boolean supports(TransmissionType type)
|
||||
@@ -157,10 +157,10 @@ public class TileComponentConfig implements ITileComponent
|
||||
for(TransmissionType type : transmissions)
|
||||
{
|
||||
try {//TODO remove soon
|
||||
if(nbtTags.getByteArray("config" + type.ordinal()).length > 0)
|
||||
if(nbtTags.getByteArray("config" + type).length > 0)
|
||||
{
|
||||
sideConfigs.put(type.ordinal(), nbtTags.getByteArray("config" + type.ordinal()));
|
||||
ejecting.put(type.ordinal(), nbtTags.getBoolean("ejecting" + type.ordinal()));
|
||||
sideConfigs.put(type.ordinal(), nbtTags.getByteArray("config" + type));
|
||||
ejecting.put(type.ordinal(), nbtTags.getBoolean("ejecting" + type));
|
||||
}
|
||||
} catch(Exception e) {
|
||||
try {
|
||||
@@ -211,21 +211,21 @@ public class TileComponentConfig implements ITileComponent
|
||||
{
|
||||
for(TransmissionType type : transmissions)
|
||||
{
|
||||
nbtTags.setByteArray("config" + type.ordinal(), sideConfigs.get(type.ordinal()));
|
||||
nbtTags.setBoolean("ejecting" + type.ordinal(), ejecting.get(type.ordinal()));
|
||||
nbtTags.setByteArray("config" + type, sideConfigs.get(type.ordinal()));
|
||||
nbtTags.setBoolean("ejecting" + type, ejecting.get(type.ordinal()));
|
||||
}
|
||||
|
||||
nbtTags.setBoolean("sideDataStored", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ArrayList data)
|
||||
public void write(ArrayList<Object> data)
|
||||
{
|
||||
data.add(transmissions.size());
|
||||
|
||||
for(TransmissionType type : transmissions)
|
||||
{
|
||||
data.add(type.ordinal());
|
||||
data.add(type);
|
||||
}
|
||||
|
||||
for(TransmissionType type : transmissions)
|
||||
|
||||
@@ -152,7 +152,7 @@ public class TileComponentEjector implements ITileComponent, IEjector
|
||||
{
|
||||
if(configurable.getConfig().getConfig(type)[i] == configurable.getConfig().getOutputs(type).indexOf(data))
|
||||
{
|
||||
outputSides.add(EnumFacing.getFront(MekanismUtils.getBaseOrientation(i, tileEntity.facing)));
|
||||
outputSides.add(MekanismUtils.getBaseOrientation(EnumFacing.getFront(i), EnumFacing.getFront(tileEntity.facing.ordinal())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class TileComponentEjector implements ITileComponent, IEjector
|
||||
|
||||
if(tile instanceof IInventory && !(tile instanceof ITransporterTile))
|
||||
{
|
||||
stack = InventoryUtils.putStackInInventory((IInventory)tile, stack, side.ordinal(), false);
|
||||
stack = InventoryUtils.putStackInInventory((IInventory)tile, stack, side, false);
|
||||
}
|
||||
else if(tile instanceof ITransporterTile)
|
||||
{
|
||||
@@ -353,7 +353,7 @@ public class TileComponentEjector implements ITileComponent, IEjector
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ArrayList data)
|
||||
public void write(ArrayList<Object> data)
|
||||
{
|
||||
data.add(strictInput);
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ public class TileComponentUpgrade implements ITileComponent
|
||||
|
||||
for(Map.Entry<Upgrade, Integer> entry : upgrades.entrySet())
|
||||
{
|
||||
data.add(entry.getKey().ordinal());
|
||||
data.add(entry.getKey());
|
||||
data.add(entry.getValue());
|
||||
}
|
||||
|
||||
|
||||
@@ -392,7 +392,6 @@ public final class MekanismUtils
|
||||
* @param orientation
|
||||
* @return left side
|
||||
*/
|
||||
@Deprecated
|
||||
public static EnumFacing getLeft(EnumFacing orientation)
|
||||
{
|
||||
return orientation.rotateY();
|
||||
@@ -403,7 +402,6 @@ public final class MekanismUtils
|
||||
* @param orientation
|
||||
* @return right side
|
||||
*/
|
||||
@Deprecated
|
||||
public static EnumFacing getRight(EnumFacing orientation)
|
||||
{
|
||||
return orientation.rotateYCCW();
|
||||
@@ -414,7 +412,6 @@ public final class MekanismUtils
|
||||
* @param orientation
|
||||
* @return opposite side
|
||||
*/
|
||||
@Deprecated
|
||||
public static EnumFacing getBack(EnumFacing orientation)
|
||||
{
|
||||
return orientation.getOpposite();
|
||||
|
||||
@@ -285,11 +285,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
case HEAT_GENERATOR:
|
||||
world.spawnParticle("smoke", (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, (double)(xRandom + iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case BIO_GENERATOR:
|
||||
world.spawnParticle("smoke", x+.25, y+.2, z+.5, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x+.25, y+.2, z+.5, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -300,11 +300,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
case HEAT_GENERATOR:
|
||||
world.spawnParticle("smoke", (double)(xRandom - iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", (double)(xRandom - iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)(xRandom - iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, (double)(xRandom - iRandom), (double)yRandom, (double)(zRandom - jRandom), 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case BIO_GENERATOR:
|
||||
world.spawnParticle("smoke", x+.75, y+.2, z+.5, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x+.75, y+.2, z+.5, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -315,11 +315,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
case HEAT_GENERATOR:
|
||||
world.spawnParticle("smoke", (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom + iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom + iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom + iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom + iRandom), 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case BIO_GENERATOR:
|
||||
world.spawnParticle("smoke", x+.5, y+.2, z+.25, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x+.5, y+.2, z+.25, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -330,11 +330,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
switch(GeneratorType.getFromMetadata(metadata))
|
||||
{
|
||||
case HEAT_GENERATOR:
|
||||
world.spawnParticle("smoke", (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom - iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom - iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom - iRandom), 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, (double)(xRandom - jRandom), (double)yRandom, (double)(zRandom - iRandom), 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
case BIO_GENERATOR:
|
||||
world.spawnParticle("smoke", x+.5, y+.2, z+.75, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, x+.5, y+.2, z+.75, 0.0D, 0.0D, 0.0D);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
-6
@@ -4,12 +4,6 @@ import mekanism.common.tile.TileEntityBasicBlock;
|
||||
|
||||
public class TileEntityElectromagneticCoil extends TileEntityBasicBlock
|
||||
{
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {}
|
||||
}
|
||||
@@ -4,12 +4,6 @@ import mekanism.common.tile.TileEntityBasicBlock;
|
||||
|
||||
public class TileEntityPressureDisperser extends TileEntityBasicBlock
|
||||
{
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {}
|
||||
}
|
||||
@@ -27,12 +27,6 @@ public class TileEntityRotationalComplex extends TileEntityBasicBlock
|
||||
@Override
|
||||
public void onUpdate() {}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAdded()
|
||||
{
|
||||
|
||||
@@ -15,8 +15,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileEntityTurbineRotor extends TileEntityBasicBlock
|
||||
{
|
||||
@@ -34,13 +34,7 @@ public class TileEntityTurbineRotor extends TileEntityBasicBlock
|
||||
|
||||
public float rotationLower;
|
||||
public float rotationUpper;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(Block block)
|
||||
{
|
||||
@@ -73,9 +67,9 @@ public class TileEntityTurbineRotor extends TileEntityBasicBlock
|
||||
//Go to bottom rotor
|
||||
while(true)
|
||||
{
|
||||
if(isRotor(pointer.getFromSide(EnumFacing.DOWN)))
|
||||
if(isRotor(pointer.offset(EnumFacing.DOWN)))
|
||||
{
|
||||
pointer.step(EnumFacing.DOWN);
|
||||
pointer = pointer.offset(EnumFacing.DOWN);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -88,18 +82,18 @@ public class TileEntityTurbineRotor extends TileEntityBasicBlock
|
||||
newRotors.add(pointer.clone());
|
||||
newBlades += ((TileEntityTurbineRotor)pointer.getTileEntity(worldObj)).getHousedBlades();
|
||||
|
||||
if(isRotor(pointer.getFromSide(EnumFacing.UP)))
|
||||
if(isRotor(pointer.offset(EnumFacing.UP)))
|
||||
{
|
||||
pointer.step(EnumFacing.UP);
|
||||
pointer = pointer.offset(EnumFacing.UP);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(isComplex(pointer.getFromSide(EnumFacing.UP)))
|
||||
if(isComplex(pointer.offset(EnumFacing.UP)))
|
||||
{
|
||||
id = ((TileEntityRotationalComplex)pointer.getFromSide(EnumFacing.UP).getTileEntity(worldObj)).multiblockUUID;
|
||||
id = ((TileEntityRotationalComplex)pointer.offset(EnumFacing.UP).getTileEntity(worldObj)).multiblockUUID;
|
||||
complex = true;
|
||||
}
|
||||
|
||||
@@ -225,7 +219,7 @@ public class TileEntityTurbineRotor extends TileEntityBasicBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getNetworkedData(ArrayList data)
|
||||
public ArrayList getNetworkedData(ArrayList<Object> data)
|
||||
{
|
||||
super.getNetworkedData(data);
|
||||
|
||||
|
||||
Reference in new issue
Block a user