mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 15:36:18 +00:00
Fix #1989 "X-Ray" Leaves
This commit is contained in:
1 parent
d48fca4652
commit
6eab284cd1
3 files changed
+24
-13
No files matched your search
@@ -109,7 +109,7 @@ public abstract class BlockAbstractLeaves extends BlockLeaves implements IItemMo
|
||||
|
||||
/* RENDERING */
|
||||
@Override
|
||||
public final boolean isOpaqueCube(IBlockState state) {
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return !Proxies.render.fancyGraphicsEnabled();
|
||||
}
|
||||
|
||||
|
||||
@@ -109,10 +109,10 @@ public abstract class BlockDecorativeLeaves extends Block implements IItemModelR
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
if(!Proxies.render.fancyGraphicsEnabled()){
|
||||
return true;
|
||||
TreeDefinition treeDefinition = state.getValue(getVariant());
|
||||
return !TreeDefinition.Willow.equals(treeDefinition);
|
||||
}
|
||||
TreeDefinition treeDefinition = state.getValue(getVariant());
|
||||
return !TreeDefinition.Willow.equals(treeDefinition);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,7 @@ import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.arboriculture.genetics.TreeDefinition;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
/**
|
||||
* Genetic leaves with no tile entity, used for worldgen trees.
|
||||
@@ -154,15 +155,6 @@ public abstract class BlockDefaultLeaves extends BlockAbstractLeaves {
|
||||
return getDefaultState().withProperty(getVariant(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for (IBlockState state : blockState.getValidStates()) {
|
||||
int meta = getMetaFromState(state);
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation("forestry:leaves.default." + blockNumber, "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ITree getTree(IBlockAccess world, BlockPos pos) {
|
||||
IBlockState blockState = world.getBlockState(pos);
|
||||
@@ -174,6 +166,25 @@ public abstract class BlockDefaultLeaves extends BlockAbstractLeaves {
|
||||
}
|
||||
}
|
||||
|
||||
/* RENDERING */
|
||||
@Override
|
||||
public final boolean isOpaqueCube(IBlockState state) {
|
||||
if(!Proxies.render.fancyGraphicsEnabled()){
|
||||
TreeDefinition treeDefinition = state.getValue(getVariant());
|
||||
return !TreeDefinition.Willow.equals(treeDefinition);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for (IBlockState state : blockState.getValidStates()) {
|
||||
int meta = getMetaFromState(state);
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation("forestry:leaves.default." + blockNumber, "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex) {
|
||||
|
||||
Reference in new issue
Block a user