Fixed Gas Tank comparator support
This commit is contained in:
parent
21fa9fdb26
commit
f88a97697f
|
@ -1,18 +1,8 @@
|
||||||
package mekanism.common.tile;
|
package mekanism.common.tile;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import mekanism.api.Coord4D;
|
import mekanism.api.Coord4D;
|
||||||
import mekanism.api.gas.Gas;
|
import mekanism.api.gas.*;
|
||||||
import mekanism.api.gas.GasRegistry;
|
|
||||||
import mekanism.api.gas.GasStack;
|
|
||||||
import mekanism.api.gas.GasTank;
|
|
||||||
import mekanism.api.gas.GasTransmission;
|
|
||||||
import mekanism.api.gas.IGasHandler;
|
|
||||||
import mekanism.api.gas.IGasItem;
|
|
||||||
import mekanism.api.gas.ITubeConnection;
|
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
import mekanism.common.base.IRedstoneControl;
|
import mekanism.common.base.IRedstoneControl;
|
||||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||||
|
@ -25,6 +15,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class TileEntityGasTank extends TileEntityContainerBlock implements IGasHandler, ITubeConnection, IRedstoneControl
|
public class TileEntityGasTank extends TileEntityContainerBlock implements IGasHandler, ITubeConnection, IRedstoneControl
|
||||||
{
|
{
|
||||||
public enum GasMode
|
public enum GasMode
|
||||||
|
@ -279,14 +271,8 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
||||||
|
|
||||||
public int getRedstoneLevel()
|
public int getRedstoneLevel()
|
||||||
{
|
{
|
||||||
int stored = gasTank.getStored();
|
double fractionFull = (float)gasTank.getStored()/(float)gasTank.getMaxGas();
|
||||||
|
return MathHelper.floor_float((float)(fractionFull * 14.0F)) + (fractionFull > 0 ? 1 : 0);
|
||||||
if(stored == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return MathHelper.floor_float((float)stored / (float)MAX_GAS * 14.0f + 1.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue