mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 15:36:18 +00:00
Fix "X-Ray" Leaves and wrong leaf particle color
This commit is contained in:
1 parent
34be92d462
commit
f270231e67
7 files changed
+22
-21
No files matched your search
@@ -43,8 +43,8 @@ import forestry.core.utils.BlockUtil;
|
||||
* Parent class for shared behavior between {@link BlockDefaultLeaves} and {@link BlockForestryLeaves}
|
||||
*/
|
||||
public abstract class BlockAbstractLeaves extends BlockLeaves implements IItemModelRegister, IColoredBlock {
|
||||
public static final int FOLIAGE_COLOR_INDEX = 1;
|
||||
public static final int FRUIT_COLOR_INDEX = 0;
|
||||
public static final int FOLIAGE_COLOR_INDEX = 0;
|
||||
public static final int FRUIT_COLOR_INDEX = 2;
|
||||
|
||||
@Nullable
|
||||
protected abstract ITree getTree(IBlockAccess world, BlockPos pos);
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ILeafSpriteProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
@@ -109,10 +110,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
|
||||
@@ -214,11 +215,11 @@ public abstract class BlockDecorativeLeaves extends Block implements IItemModelR
|
||||
TreeDefinition treeDefinition = state.getValue(getVariant());
|
||||
ITreeGenome genome = treeDefinition.getGenome();
|
||||
|
||||
if (tintIndex == BlockAbstractLeaves.FOLIAGE_COLOR_INDEX) {
|
||||
return genome.getPrimary().getLeafSpriteProvider().getColor(false);
|
||||
} else {
|
||||
if (tintIndex == BlockAbstractLeaves.FRUIT_COLOR_INDEX) {
|
||||
IFruitProvider fruitProvider = genome.getFruitProvider();
|
||||
return fruitProvider.getDecorativeColor();
|
||||
}
|
||||
ILeafSpriteProvider spriteProvider = genome.getPrimary().getLeafSpriteProvider();
|
||||
return spriteProvider.getColor(false);
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ILeafSpriteProvider;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
@@ -194,11 +195,11 @@ public abstract class BlockDefaultLeaves extends BlockAbstractLeaves {
|
||||
}
|
||||
ITreeGenome genome = treeDefinition.getGenome();
|
||||
|
||||
if (tintIndex == BlockAbstractLeaves.FOLIAGE_COLOR_INDEX) {
|
||||
return genome.getPrimary().getLeafSpriteProvider().getColor(false);
|
||||
} else {
|
||||
if (tintIndex == BlockAbstractLeaves.FRUIT_COLOR_INDEX) {
|
||||
IFruitProvider fruitProvider = genome.getFruitProvider();
|
||||
return fruitProvider.getDecorativeColor();
|
||||
}
|
||||
ILeafSpriteProvider spriteProvider = genome.getPrimary().getLeafSpriteProvider();
|
||||
return spriteProvider.getColor(false);
|
||||
}
|
||||
}
|
||||
@@ -207,11 +207,11 @@ public class BlockForestryLeaves extends BlockAbstractLeaves implements ITileEnt
|
||||
if (worldIn != null && pos != null) {
|
||||
TileLeaves leaves = TileUtil.getTile(worldIn, pos, TileLeaves.class);
|
||||
if (leaves != null) {
|
||||
if (tintIndex == BlockAbstractLeaves.FOLIAGE_COLOR_INDEX) {
|
||||
if (tintIndex == BlockAbstractLeaves.FRUIT_COLOR_INDEX) {
|
||||
return leaves.getFruitColour();
|
||||
}else {
|
||||
EntityPlayer thePlayer = Minecraft.getMinecraft().player;
|
||||
return leaves.getFoliageColour(thePlayer);
|
||||
} else {
|
||||
return leaves.getFruitColour();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,11 +36,10 @@ public class ItemBlockDecorativeLeaves extends ItemBlockForestry<BlockDecorative
|
||||
|
||||
ITreeGenome genome = treeDefinition.getGenome();
|
||||
|
||||
if (renderPass == BlockAbstractLeaves.FOLIAGE_COLOR_INDEX) {
|
||||
return genome.getPrimary().getLeafSpriteProvider().getColor(false);
|
||||
} else {
|
||||
if (renderPass == BlockAbstractLeaves.FRUIT_COLOR_INDEX) {
|
||||
IFruitProvider fruitProvider = genome.getFruitProvider();
|
||||
return fruitProvider.getDecorativeColor();
|
||||
}
|
||||
return genome.getPrimary().getLeafSpriteProvider().getColor(false);
|
||||
}
|
||||
}
|
||||
@@ -70,11 +70,11 @@ public class ItemBlockLeaves extends ItemBlockForestry<BlockAbstractLeaves> impl
|
||||
TileLeaves tileLeaves = new TileLeaves();
|
||||
tileLeaves.readFromNBT(itemStack.getTagCompound());
|
||||
|
||||
if (renderPass == BlockAbstractLeaves.FOLIAGE_COLOR_INDEX) {
|
||||
if (renderPass == BlockAbstractLeaves.FRUIT_COLOR_INDEX) {
|
||||
return tileLeaves.getFruitColour();
|
||||
}else {
|
||||
EntityPlayer player = Minecraft.getMinecraft().player;
|
||||
return tileLeaves.getFoliageColour(player);
|
||||
} else {
|
||||
return tileLeaves.getFruitColour();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user