Fix spectral blocks being opaque (#716)

Now you can see through the missing fluids

Also reduced the opacity slightly.
This commit is contained in:
Nicholas Ignoffo 2016-05-11 17:40:41 -07:00
parent b2fb264108
commit cfce1a4a6c
2 changed files with 23 additions and 0 deletions

View file

@ -9,12 +9,16 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
@ -45,6 +49,12 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider
return false; return false;
} }
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override @Override
public boolean isFullCube(IBlockState state) public boolean isFullCube(IBlockState state)
{ {
@ -57,12 +67,25 @@ public class BlockSpectral extends BlockContainer implements IVariantProvider
return false; return false;
} }
@SideOnly(Side.CLIENT)
@Override
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.TRANSLUCENT;
}
@Override @Override
public EnumBlockRenderType getRenderType(IBlockState state) public EnumBlockRenderType getRenderType(IBlockState state)
{ {
return EnumBlockRenderType.MODEL; return EnumBlockRenderType.MODEL;
} }
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
}
@Override @Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity) public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

After

Width:  |  Height:  |  Size: 15 KiB