Fixes #1368
This commit is contained in:
parent
ee075feea9
commit
dc4cdbb9cc
1 changed files with 16 additions and 6 deletions
|
@ -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;
|
||||
if(!fancyLeaves()){
|
||||
return super.isOpaqueCube(state);
|
||||
}
|
||||
|
||||
public boolean isFullCube() {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue