The Meaning of Life, the Universe, and Everything.
Join Date:
7/16/2014
Posts:
47
Member Details
How do I do this without base class editing or asm? I set a getter method in the biome gen base class but, no setter nor where the method is even called at.
Subscribe to DecorateBiomeEvent.Decorate (fired on MinecraftForge.TERRAIN_GEN_BUS, not MinecraftForge.EVENT_BUS) and check if the Biome at the event's BlockPos plus 16 x and z is Biomes.SWAMPLAND or Biomes.MUTATED_SWAMPLAND and the event's EventType is EventType.TREE. If these conditions are met, cancel the event and generate your own features.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Subscribe to DecorateBiomeEvent.Decorate (fired on MinecraftForge.TERRAIN_GEN_BUS, not MinecraftForge.EVENT_BUS) and check if the Biome at the event's BlockPos plus 16 x and z is Biomes.SWAMPLAND or Biomes.MUTATED_SWAMPLAND and the event's EventType is EventType.TREE. If these conditions are met, cancel the event and generate your own features.
So your saying to make a new block leaves and a new block grass for the swamp then do this?
So your saying to make a new block leaves and a new block grass for the swamp then do this?
If you want to use your own leaves and grass, yes.
Note that cancelling the event under the conditions I described in my previous post only prevents the features generated by WorldGenSwamp from generating, i.e. trees with vines.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
If you want to use your own leaves and grass, yes.
Note that cancelling the event under the conditions I described in my previous post only prevents the features generated by WorldGenSwamp from generating, i.e. trees with vines.
What about if I just replaced the vanilla grass and leaves? How do I currently replace vanilla blocks and leaves since their registry storage seems weird. I could extend the classes and change the colors to be biome specific?
How would I do this otherwise without new blocks. What you were telling me was to do stuff after canceling an event but, the grass and foliage would still return the same color values.
What about if I just replaced the vanilla grass and leaves? How do I currently replace vanilla blocks and leaves since their registry storage seems weird. I could extend the classes and change the colors to be biome specific?
How would I do this otherwise without new blocks. What you were telling me was to do stuff after canceling an event but, the grass and foliage would still return the same color values.
You can override an existing registry entry (e.g. a Block) by registering a new one with the same registry name. The new value should generally use or extend the old value's class.
If all you want to change is the colour, you can register your own IBlockColors for the vanilla Blocks instead of overriding them.
By "Replacing Biome Foliage", I thought you meant "replacing the tree generation"; I didn't realise you were talking about colours.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
You can override an existing registry entry (e.g. a Block) by registering a new one with the same registry name. The new value should generally use or extend the old value's class.
If all you want to change is the colour, you can register your own IBlockColors for the vanilla Blocks instead of overriding them.
By "Replacing Biome Foliage", I thought you meant "replacing the tree generation"; I didn't realise you were talking about colours.
Would Registering IBlock colors work with vanilla blocks or does it have to be my own blocks?
Would Registering IBlock colors work with vanilla blocks or does it have to be my own blocks?
You should be able to register your own IBlockColors for the vanilla Blocks to replace the vanilla IBlockColors.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Call BlockColors#registerBlockColorHandler in init from your client proxy, just like you would if you were registering an IBlockColor for your own Block.
This part of the model system hasn't really changed since it was introduced in 1.9, so it should work in 1.10.2 (though I haven't tested it in any version).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Call BlockColors#registerBlockColorHandler in init from your client proxy, just like you would if you were registering an IBlockColor for your own Block.
This part of the model system hasn't really changed since it was introduced in 1.9, so it should work in 1.10.2 (though I haven't tested it in any version).
"colorMultiplier" is the only method there I can only change multipliers not the actual color?
"colorMultiplier" is the only method there I can only change multipliers not the actual color?
It's a multiplier of whatever the texture's colour is. Since the vanilla leaf and grass textures are greyscale, the multiplier is essentially the same as the resulting colour.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
BlockColors.init creates and returns a new instance of BlockColors. The instance you create by calling it is never used by Minecraft, so your IBlockColor is never used either.
You need to get the existing BlockColors instance that Minecraft knows about with the Minecraft#getBlockColors method and register your IBlockColor with it. The same applies to ItemColors: Minecraft already has an instance that you can get with the Minecraft#getItemColors method.
IBlockColor/IItemColor use the colour format 0xRRGGBB, where RR is the red component, GG is the green component and BB is the blue component.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The Meaning of Life, the Universe, and Everything.
Join Date:
7/16/2014
Posts:
47
Member Details
Struggling to find out what the color is suppose to be in the inventory. I also want this compatible with seasons meaning I need it dynamically getting it from the grass/foilage in this case the grass.
Each face of each model element can set a tint index that allows the IBlockColor/IItemColor to know which element is being coloured. This allows models to have multiple dynamic colours.
How do I find out what biome color was returning for beta 1.8.1 swamp grass and foliage color?
You'd have to see if it's been documented anywhere (e.g. on the wiki) or decompile that version and find the numbers yourself.
Does this work in the same way vanilla does overlaying the green per biome?
The vanilla grass/foliage colours are handled by the IBlockColor/IItemColor implementations, yes.
I've just realised that the IBlockColor instances for grass and leaves use the Biome#getGrassColorAtPos and Biome#getFoliageColorAtPos methods (through BiomeColorHelper), which fire the BiomeEvent.GetGrassColor and BiomeEvent.GetFoliageColor events. These events can be used to change the grass/foliage colours at specific positions without replacing the IBlockColor instances.
Unfortunately BiomeSwamp overrides these methods and doesn't fire the events, so they can't actually be used for swamps. I'll open a Forge issue for this, but it's very unlikely that any fix for it gets backported to 1.10.2.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Each face of each model element can set a tint index that allows the IBlockColor/IItemColor to know which element is being coloured. This allows models to have multiple dynamic colours.
You'd have to see if it's been documented anywhere (e.g. on the wiki) or decompile that version and find the numbers yourself.
The vanilla grass/foliage colours are handled by the IBlockColor/IItemColor implementations, yes.
I've just realised that the IBlockColor instances for grass and leaves use the Biome#getGrassColorAtPos and Biome#getFoliageColorAtPos methods (through BiomeColorHelper), which fire the BiomeEvent.GetGrassColor and BiomeEvent.GetFoliageColor events. These events can be used to change the grass/foliage colours at specific positions without replacing the IBlockColor instances.
Unfortunately BiomeSwamp overrides these methods and doesn't fire the events, so they can't actually be used for swamps. I'll open a Forge issue for this, but it's very unlikely that any fix for it gets backported to 1.10.2.
Seems to work in 1.10.2 for IBlockColor thing. Would this be compatible if other mods registered the same block maybe I should be using an event?
For fun I decided to try blocks.STONE and it only effected the particle effects. I can see why you say this is bugged. The particle effects were green but, the block wasn't.
I just need to know what color it's suppose to be in the inventory?
Seems to work in 1.10.2 for IBlockColor thing. Would this be compatible if other mods registered the same block maybe I should be using an event?
The IBlockColor will only be used for the Blocks you register it for. If another mod registers an IBlockColor for the same Block after you register yours, it will overwrite yours.
I recommend storing the vanilla IBlockColor before overwriting and delegating to it (i.e. calling IBlockColor#colorMultiplier and returning the result) when the Biome isn't an instance of BiomeSwamp (or the World/BlockPos are null). This will allow you to use the vanilla colours for the inventory or other biomes and preserve the changes made by any other mod's IBlockColor.
For fun I decided to try blocks.STONE and it only effected the particle effects. I can see why you say this is bugged. The particle effects were green but, the block wasn't.
The IBlockColor is only used to colour a model when the tint index of a face is specified. Vanilla only specified this for models that it dynamically colours, e.g. leaves and grass.
It's also used by the digging particles, regardless of whether or not a tint index is specified.
I just need to know what color it's suppose to be in the inventory?
When the World/BlockPos are null (e.g. in the inventory), Vanilla uses ColorizerGrass.getGrassColor(0.5, 1.0) for grass and ColorizerFoliage.getFoliageColorBasic() for leaves
So yeah do you have a way to get it working for the inventory?
Do you have a way to get it working the resource packs or does the code above already do that?
The IItemColor for grass/leaves uses the Block's IBlockColor, so it should use your replacement IBlockColor for the item model automatically.
The IBlockColor/IItemColor are independent of the resource pack, though a resource pack could replace the grass/leaves models with ones that don't specify a tint index.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
How do I do this without base class editing or asm? I set a getter method in the biome gen base class but, no setter nor where the method is even called at.
Subscribe to DecorateBiomeEvent.Decorate (fired on MinecraftForge.TERRAIN_GEN_BUS, not MinecraftForge.EVENT_BUS) and check if the Biome at the event's BlockPos plus 16 x and z is Biomes.SWAMPLAND or Biomes.MUTATED_SWAMPLAND and the event's EventType is EventType.TREE. If these conditions are met, cancel the event and generate your own features.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
So your saying to make a new block leaves and a new block grass for the swamp then do this?
If you want to use your own leaves and grass, yes.
Note that cancelling the event under the conditions I described in my previous post only prevents the features generated by WorldGenSwamp from generating, i.e. trees with vines.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
What about if I just replaced the vanilla grass and leaves? How do I currently replace vanilla blocks and leaves since their registry storage seems weird. I could extend the classes and change the colors to be biome specific?
How would I do this otherwise without new blocks. What you were telling me was to do stuff after canceling an event but, the grass and foliage would still return the same color values.
You can override an existing registry entry (e.g. a Block) by registering a new one with the same registry name. The new value should generally use or extend the old value's class.
If all you want to change is the colour, you can register your own IBlockColors for the vanilla Blocks instead of overriding them.
By "Replacing Biome Foliage", I thought you meant "replacing the tree generation"; I didn't realise you were talking about colours.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Would Registering IBlock colors work with vanilla blocks or does it have to be my own blocks?
You should be able to register your own IBlockColors for the vanilla Blocks to replace the vanilla IBlockColors.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
How do I do that does it work in 1.10.2?
Call BlockColors#registerBlockColorHandler in init from your client proxy, just like you would if you were registering an IBlockColor for your own Block.
This part of the model system hasn't really changed since it was introduced in 1.9, so it should work in 1.10.2 (though I haven't tested it in any version).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
"colorMultiplier" is the only method there I can only change multipliers not the actual color?
It's a multiplier of whatever the texture's colour is. Since the vanilla leaf and grass textures are greyscale, the multiplier is essentially the same as the resulting colour.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Can't get it working I tried returning always purple since I thought it was in ms access color format.
Init:
Client Proxy init
Grass Color Class
BlockColors.init creates and returns a new instance of BlockColors. The instance you create by calling it is never used by Minecraft, so your IBlockColor is never used either.
You need to get the existing BlockColors instance that Minecraft knows about with the Minecraft#getBlockColors method and register your IBlockColor with it. The same applies to ItemColors: Minecraft already has an instance that you can get with the Minecraft#getItemColors method.
IBlockColor/IItemColor use the colour format 0xRRGGBB, where RR is the red component, GG is the green component and BB is the blue component.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
What does the "tintIndex" do?
How do I find out what biome color was returning for beta 1.8.1 swamp grass and foliage color?
Does this work in the same way vanilla does overlaying the green per biome?
Struggling to find out what the color is suppose to be in the inventory. I also want this compatible with seasons meaning I need it dynamically getting it from the grass/foilage in this case the grass.
Each face of each model element can set a tint index that allows the IBlockColor/IItemColor to know which element is being coloured. This allows models to have multiple dynamic colours.
You'd have to see if it's been documented anywhere (e.g. on the wiki) or decompile that version and find the numbers yourself.
The vanilla grass/foliage colours are handled by the IBlockColor/IItemColor implementations, yes.
I've just realised that the IBlockColor instances for grass and leaves use the Biome#getGrassColorAtPos and Biome#getFoliageColorAtPos methods (through BiomeColorHelper), which fire the BiomeEvent.GetGrassColor and BiomeEvent.GetFoliageColor events. These events can be used to change the grass/foliage colours at specific positions without replacing the IBlockColor instances.
Unfortunately BiomeSwamp overrides these methods and doesn't fire the events, so they can't actually be used for swamps. I'll open a Forge issue for this, but it's very unlikely that any fix for it gets backported to 1.10.2.
Edit: I've opened an issue here.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Seems to work in 1.10.2 for IBlockColor thing. Would this be compatible if other mods registered the same block maybe I should be using an event?
For fun I decided to try blocks.STONE and it only effected the particle effects. I can see why you say this is bugged. The particle effects were green but, the block wasn't.
I just need to know what color it's suppose to be in the inventory?
So yeah do you have a way to get it working for the inventory?
Do you have a way to get it working the resource packs or does the code above already do that?
The IBlockColor will only be used for the Blocks you register it for. If another mod registers an IBlockColor for the same Block after you register yours, it will overwrite yours.
I recommend storing the vanilla IBlockColor before overwriting and delegating to it (i.e. calling IBlockColor#colorMultiplier and returning the result) when the Biome isn't an instance of BiomeSwamp (or the World/BlockPos are null). This will allow you to use the vanilla colours for the inventory or other biomes and preserve the changes made by any other mod's IBlockColor.
The IBlockColor is only used to colour a model when the tint index of a face is specified. Vanilla only specified this for models that it dynamically colours, e.g. leaves and grass.
It's also used by the digging particles, regardless of whether or not a tint index is specified.
When the World/BlockPos are null (e.g. in the inventory), Vanilla uses ColorizerGrass.getGrassColor(0.5, 1.0) for grass and ColorizerFoliage.getFoliageColorBasic() for leaves
The IItemColor for grass/leaves uses the Block's IBlockColor, so it should use your replacement IBlockColor for the item model automatically.
The IBlockColor/IItemColor are independent of the resource pack, though a resource pack could replace the grass/leaves models with ones that don't specify a tint index.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.