Updated gas rendering to 1.12
This commit is contained in:
parent
a6513e8a60
commit
5449a8e86d
1 changed files with 18 additions and 3 deletions
|
@ -20,6 +20,7 @@ import net.minecraft.item.EnumRarity;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
@ -142,16 +143,30 @@ public class BlockGas extends BlockAbstractBase {
|
|||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean isTranslucent(final IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(final IBlockState blockState, @Nonnull final IBlockAccess blockAccess, @Nonnull final BlockPos blockPos, final EnumFacing facing) {
|
||||
final BlockPos blockPosSide = blockPos.offset(facing);
|
||||
final EnumFacing opposite = facing.getOpposite();
|
||||
final IBlockState blockStateSide = blockAccess.getBlockState(blockPosSide);
|
||||
if (blockStateSide.getBlock().isAssociatedBlock(this)) {
|
||||
return false;
|
||||
if (blockStateSide.getBlock() instanceof BlockGas) {
|
||||
return blockState.getValue(COLOR) != blockStateSide.getValue(COLOR);
|
||||
}
|
||||
return blockAccess.isAirBlock(blockPosSide);
|
||||
return !blockAccess.isSideSolid(blockPosSide, opposite, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue