This commit is contained in:
modmuss50 2017-12-17 21:53:14 +00:00
parent ee075feea9
commit dc4cdbb9cc
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82

View file

@ -29,6 +29,7 @@ import net.minecraft.block.BlockPlanks;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -72,15 +73,17 @@ public class BlockRubberLeaves extends BlockLeaves {
@Override
public BlockRenderLayer getBlockLayer() {
if(!fancyLeaves()){
return super.getBlockLayer();
}
return BlockRenderLayer.CUTOUT_MIPPED;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
public boolean isFullCube() {
if(!fancyLeaves()){
return super.isOpaqueCube(state);
}
return false;
}
@ -98,10 +101,10 @@ public class BlockRubberLeaves extends BlockLeaves {
@Override
public int getMetaFromState(IBlockState state) {
int meta = 0;
if (!(Boolean) state.getValue(DECAYABLE)) {
if (!state.getValue(DECAYABLE)) {
meta |= 1;
}
if ((Boolean) state.getValue(CHECK_DECAY)) {
if (state.getValue(CHECK_DECAY)) {
meta |= 2;
}
return meta;
@ -129,6 +132,13 @@ public class BlockRubberLeaves extends BlockLeaves {
@Override
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
if(!fancyLeaves()){
return super.shouldSideBeRendered(blockState, blockAccess, pos, side);
}
return true;
}
public boolean fancyLeaves(){
return Minecraft.getMinecraft().gameSettings.fancyGraphics;
}
}