mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
More closely mirror comparator calculations of fluid tank and gas tank
This commit is contained in:
1 parent
a4e453e7d5
commit
4b54adc5e5
2 files changed
+14
-8
No files matched your search
@@ -816,25 +816,25 @@ public abstract class BlockBasic extends Block {
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess world, BlockPos pos, BlockPos beacon) {
|
||||
return BasicBlockType.get(world.getBlockState(pos)).isBeaconBase;
|
||||
BasicBlockType basicBlockType = BasicBlockType.get(world.getBlockState(pos));
|
||||
return basicBlockType != null && basicBlockType.isBeaconBase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride(IBlockState blockState) {
|
||||
return BasicBlockType.get(blockState).hasRedstoneOutput;
|
||||
BasicBlockType basicBlockType = BasicBlockType.get(blockState);
|
||||
return basicBlockType != null && basicBlockType.hasRedstoneOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(IBlockState blockState, World worldIn, BlockPos pos) {
|
||||
if (BasicBlockType.get(blockState).hasRedstoneOutput) {
|
||||
BasicBlockType basicBlockType = BasicBlockType.get(blockState);
|
||||
if (basicBlockType != null && basicBlockType.hasRedstoneOutput) {
|
||||
TileEntity tile = worldIn.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityBin) {
|
||||
TileEntityBin binTile = (TileEntityBin)tile;
|
||||
float percentFull = binTile.getItemCount() / (binTile.getMaxStoredCount() * 1.0f);
|
||||
return (int)(percentFull * 15);
|
||||
return ((TileEntityBin) tile).getRedstoneLevel();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user