The Meaning of Life, the Universe, and Everything.
Join Date:
7/16/2014
Posts:
47
Member Details
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.
This code caused a crash I could only call it as an Obj since it's an object method:
Otherwise I don't know how I am suppose to store the I block colors rather then an array list from calling it previously and also would have to do 0-5 tint indexes as well since it's faces? I can't call super this? In my client proxy I dynamically get the blocks/Items for the swamp...
@Override
public void init()
{
if(!Config.betaSwampGrass)
return;
Iterator it = MainCommonMod.mc_blocks.iterator();
while(it.hasNext())
{
Block b = (Block) it.next();
Material mat = b.getMaterial(b.getDefaultState());
if(mat == Material.GRASS || mat == Material.VINE && !(b instanceof BlockVine) || b instanceof BlockReed)
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(new GrasColor(), b);
if(b instanceof BlockVine || mat == Material.LEAVES)
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(new FoilageColor(), b);
}
}
Your code is infinitely recursing (the method is calling itself), so it crashes with a stack overflow.
There's no public method to get an existing IBlockColor instance, so you'll need to use reflection to access BlockColors.blockColorMap and get the IBlockColor from there. The IForgeRegistryEntry.Impl#delegate field contains the RegistryDelegate of a registry entry (e.g. a Block), which is used as a key in this Map.
You should store the existing IBlockColor instance in a field of your GrasColor/FoliageColor classes.
and also would have to do 0-5 tint indexes as well since it's faces?
Multiple faces can (and do) have the same tint indexes. None of Vanilla's block models use multiple tint indexes, only its item models do.
I can't call super this?
There's no super method to call, you're implementing IBlockColor directly rather than extending a Vanilla implementation (which isn't possible to do because they're anonymous classes).
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
There's no public method to get an existing IBlockColor instance, so you'll need to use reflection to access BlockColors.blockColorMap and get the IBlockColor from there.
No Idea how I am suppose to do omce I got here
public final RegistryDelegate<T> delegate = PersistentRegistryManager.makeDelegate((T)this, (Class<T>)token.getRawType());
if this is how I get the key then do I need another key to get this key?
public final RegistryDelegate<T> delegate = PersistentRegistryManager.makeDelegate((T)this, (Class<T>)token.getRawType());
if this is how I get the key then do I need another key to get this key?
Block extends IForgeRegistryEntry.Impl, so the IForgeRegistryEntry.Impl#delegate field can be accessed directly on any Block value (like BlockColors does).
You need to get the Map<RegistryDelegate<Block>, IBlockColor> from the BlockColors.blockColorMap field via reflection, then look up the Block's RegistryDelegate in the Map to get its IBlockColor.
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.
public class FeildsAccess {
public static java.util.Map<net.minecraftforge.fml.common.registry.RegistryDelegate, IBlockColor> BlockColor;
public static void CachePrivateFeilds()
{
//Try and Catch for all fields there should be no exceptions in a de-obfuscated environment
try {
BlockColor = (java.util.Map<net.minecraftforge.fml.common.registry.RegistryDelegate, IBlockColor>)ReflectionHelper.findField(BlockColors.class, MCPMappings.getFeildName(MainCommonMod.isEclipse, "blockColorMap") ).get(null);
}
catch (Exception e) {e.printStackTrace();}
}
}
Edit: So I gave up on this and just use inventory code you gave me and biome gen foliage if is not swamp.
Basically I am trying to port 1.7.10 swamp now to 1.10.2 and my freind was no help. I need to know how to convert generate terrain method since it uses chunk primers, I also need to know how to get IBlockAccess from an object since I need to know if the block is air.
I also need to know where the swamp hard coded water color is because the 1.7.10 multiplier value once I overrode it with the same value was no longer the same color
I plan on no longer using IBlockColor and just replacing the swamp biome entirely with either the new one or the old one based on the config so no need for IBlock colors soon. I have confirmed though that the biome grass and foilage event didn't work for the swamp nor on birch/pine leaves
BlockColors#blockColorMap is a non-static field (though I previously mistook it for a static field), so you need to pass the BlockColors instance to the Field#get method.
I need to know how to convert generate terrain method since it uses chunk primers,
I also need to know how to get IBlockAccess from an object since I need to know if the block is air.
If you don't have an explicit IBlockAccess argument, you'll usually have a World argument/field. World implements IBlockAccess.
Where do you need this?
I also need to know where the swamp hard coded water color is because the 1.7.10 multiplier value once I overrode it with the same value was no longer the same color
Biome#getWaterColor uses the Biome#waterColor field, which is set in the constructor from the Biome.BiomeProperties argument. Looking at the Biome.registerBiomes method, Biomes.SWAMPLAND uses 14745518 (0xe0ffae) for the water 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.
The Meaning of Life, the Universe, and Everything.
Join Date:
7/16/2014
Posts:
47
Member Details
If you don't have an explicit IBlockAccess[/i] argument, you'll usually have a World[/i] argument/field. World[/i] implements IBlockAccess[/i].
Where do you need this?
block.isAir and Block.isLeaves
Biome#getWaterColor[/i] uses the Biome#waterColor[/i] field, which is set in the constructor from the Biome.BiomeProperties[/i]argument. Looking at the Biome.registerBiomes[/i] method, Biomes.SWAMPLAND[/i] uses 14745518 (0xe0ffae) for the water colour.
I already had this in my constructor and it wasn't even mildly green even when I set the swamp foliage config to it's default noise generator foliage. There is another value hard coded somehwere else like either in the water class or minecraft just like pine and birch leaves?
If you're overriding them, you have an IBlockAccess argument.
If you're calling them, where are you calling them from?
I already had this in my constructor and it wasn't even mildly green even when I set the swamp foliage config to it's default noise generator foliage. There is another value hard coded somehwere else like either in the water class or minecraft just like pine and birch leaves?
0xe0ffae is the only water colour used by swamps. This is used as a multiplier of water's default blue colour, it's not displayed directly.
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.
They say no apis and libs if not all is necessary to run the coremod. No it's not all but, I need the apis and util/lib for the rest of my mods and some of them will be using asm helpers if possible like block properties and bnb gaming lib did. I also think it's unnecessary to split up the main common mod as it's function as the mod is suppose to be helping out just no asm like bonemeal events.... He was also completely ignoring anything I had to say maybe you could reason with them?
They say no apis and libs if not all is necessary to run the coremod. No it's not all but, I need the apis and util/lib for the rest of my mods and some of them will be using asm helpers if possible like block properties and bnb gaming lib did. I also think it's unnecessary to split up the main common mod as it's function as the mod is suppose to be helping out just no asm like bonemeal events.... He was also completely ignoring anything I had to say maybe you could reason with them?
So I don't think I could ever be 1.12+
diesieben07 and LexManos (to an extent) tried to explain how you can change your mod to comply with the policy. Your posts are often quite hard to understand and Lex doesn't have a lot of patience.
Your coremod can depend on any libraries it requires to function, but the actual coremod JAR should only contain the loading plugin and class transformers. The coremod JAR can be packaged inside the mod JAR (to be automatically extracted by Forge), and the mod can depend on the coremod.
If you have questions about this, you can try asking them on the Forge forums; but try to write your posts clearly and avoid complaining about things being impossible.
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.
Your posts are often quite hard to understand and Lex doesn't have a lot of patience
So they are saying to publicly release it extract the jar of the coremod and compile them separately that's a pain. How are my posts hard to understand? I know I try to be more understandable then the rest of my team.
Also he kept saying it wasn't a license agreement so what does that mean it's just a suggestion? I mean if it's not an agreement are they making it only forge forums specific?
You have a World instance as an argument, which implements IBlockAccess. It looks like you're already passing this as the IBlockAccess argument when calling Block#isAir and Block#isLeaves.
What's the issue here?
So they are saying to publicly release it extract the jar of the coremod and compile them separately that's a pain.
Compile the coremod and the regular mod into separate JARs and optionally package the coremod JAR inside the mod JAR, yes.
How are my posts hard to understand?
Sometimes it's your grammar and spelling, sometimes it's vagueness and lack of detail.
When talking about something (especially code-related), try to use its exact name. In your thread on the Forge forums you asked about an "index", but nobody knew what that meant since there's nothing called an "index" in the registry system.
Earlier in this thread you asked "how to get IBlockAccess from an object", but I had no idea what "object" you meant, why you needed an IBlockAccess or where you needed it.
Also he kept saying it wasn't a license agreement so what does that mean it's just a suggestion? I mean if it's not an agreement are they making it only forge forums specific?
diesieben07 said that it wasn't an EULA, which is a specific type of contract/legal document. To my understanding, the coremod policy is a set of recommended best practices rather than a legally-binding agreement. Failure to comply with the policy won't get you in legal trouble, but some sites like Curse may eventually reject mods that don't comply with it.
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.
Failure to comply with the policy won't get you in legal trouble, but some sites like Curse may eventually reject mods that don't comply with it.
Well There was a file called CoreModLoader in the curse project already and they didn't deny it (technically my class didn't implement the forge asm yet but, they would have said something). Glad to hear it's not a legal issue I won't unpackage the jar since I don't want people literally downloading the same mod 3 separate functions 3 times. Thanks this clears things up alot I don't know why lex just didn't tell me I didn't have to do it that way. I will tell the rest of my team right away to not worry about updating to 1.12 especially since you can't override any Iregistry forge indexes (technically they are called entries or something but, an index is usually used a position)
World instance as an argument, which implements IBlockAccess
So the issue is that I wasn't passing the world into all the arguments thanks. It won't be until later versions like 1.12 then that I will be able to override the swamp then.
This code caused a crash I could only call it as an Obj since it's an object method:
https://pastebin.com/eZmH47PT (Line 28 is the last return statement)
Otherwise I don't know how I am suppose to store the I block colors rather then an array list from calling it previously and also would have to do 0-5 tint indexes as well since it's faces? I can't call super this? In my client proxy I dynamically get the blocks/Items for the swamp...
Your code is infinitely recursing (the method is calling itself), so it crashes with a stack overflow.
There's no public method to get an existing IBlockColor instance, so you'll need to use reflection to access BlockColors.blockColorMap and get the IBlockColor from there. The IForgeRegistryEntry.Impl#delegate field contains the RegistryDelegate of a registry entry (e.g. a Block), which is used as a key in this Map.
You should store the existing IBlockColor instance in a field of your GrasColor/FoliageColor classes.
Multiple faces can (and do) have the same tint indexes. None of Vanilla's block models use multiple tint indexes, only its item models do.
There's no super method to call, you're implementing IBlockColor directly rather than extending a Vanilla implementation (which isn't possible to do because they're anonymous classes).
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.
No Idea how I am suppose to do omce I got here
public final RegistryDelegate<T> delegate = PersistentRegistryManager.makeDelegate((T)this, (Class<T>)token.getRawType());
if this is how I get the key then do I need another key to get this key?
Block extends IForgeRegistryEntry.Impl, so the IForgeRegistryEntry.Impl#delegate field can be accessed directly on any Block value (like BlockColors does).
You need to get the Map<RegistryDelegate<Block>, IBlockColor> from the BlockColors.blockColorMap field via reflection, then look up the Block's RegistryDelegate in the Map to get its IBlockColor.
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.
Doesn't seem to be working
On Startup:
https://pastebin.com/jhLLuF6s
In cache private feilds
In foilage and grass handlers
Ok got feild finally but, not same crash as earlier it's recursivly calling itself
Edit: So I gave up on this and just use inventory code you gave me and biome gen foliage if is not swamp.
Basically I am trying to port 1.7.10 swamp now to 1.10.2 and my freind was no help. I need to know how to convert generate terrain method since it uses chunk primers, I also need to know how to get IBlockAccess from an object since I need to know if the block is air.
I also need to know where the swamp hard coded water color is because the 1.7.10 multiplier value once I overrode it with the same value was no longer the same color
I plan on no longer using IBlockColor and just replacing the swamp biome entirely with either the new one or the old one based on the config so no need for IBlock colors soon. I have confirmed though that the biome grass and foilage event didn't work for the swamp nor on birch/pine leaves
BlockColors#blockColorMap is a non-static field (though I previously mistook it for a static field), so you need to pass the BlockColors instance to the Field#get method.
I explained this to someone else here.
If you don't have an explicit IBlockAccess argument, you'll usually have a World argument/field. World implements IBlockAccess.
Where do you need this?
Biome#getWaterColor uses the Biome#waterColor field, which is set in the constructor from the Biome.BiomeProperties argument. Looking at the Biome.registerBiomes method, Biomes.SWAMPLAND uses 14745518 (0xe0ffae) for the water 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.
block.isAir and Block.isLeaves
I already had this in my constructor and it wasn't even mildly green even when I set the swamp foliage config to it's default noise generator foliage. There is another value hard coded somehwere else like either in the water class or minecraft just like pine and birch leaves?
Are you overriding or calling these?
If you're overriding them, you have an IBlockAccess argument.
If you're calling them, where are you calling them from?
0xe0ffae is the only water colour used by swamps. This is used as a multiplier of water's default blue colour, it's not displayed directly.
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.
I am calling these methods but, I don't want to pass in null arguments.
Forge is directly saying my mod is every violation of what a coremod should be even though that this shouldn't be split up into three different mods
https://minecraft.curseforge.com/projects/evilnotch-core
They say no apis and libs if not all is necessary to run the coremod. No it's not all but, I need the apis and util/lib for the rest of my mods and some of them will be using asm helpers if possible like block properties and bnb gaming lib did. I also think it's unnecessary to split up the main common mod as it's function as the mod is suppose to be helping out just no asm like bonemeal events.... He was also completely ignoring anything I had to say maybe you could reason with them?
So I don't think I could ever be 1.12+
Where are you calling them from?
diesieben07 and LexManos (to an extent) tried to explain how you can change your mod to comply with the policy. Your posts are often quite hard to understand and Lex doesn't have a lot of patience.
Your coremod can depend on any libraries it requires to function, but the actual coremod JAR should only contain the loading plugin and class transformers. The coremod JAR can be packaged inside the mod JAR (to be automatically extracted by Forge), and the mod can depend on the coremod.
If you have questions about this, you can try asking them on the Forge forums; but try to write your posts clearly and avoid complaining about things being impossible.
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.
I am calling it from the block object. Here I could just show you since I appear to not have made myself clear?
https://gist.github.com/anonymous/2f8995d6e84041b7d65f8df2db8a49b6
So they are saying to publicly release it extract the jar of the coremod and compile them separately that's a pain. How are my posts hard to understand? I know I try to be more understandable then the rest of my team.
Also he kept saying it wasn't a license agreement so what does that mean it's just a suggestion? I mean if it's not an agreement are they making it only forge forums specific?
You have a World instance as an argument, which implements IBlockAccess. It looks like you're already passing this as the IBlockAccess argument when calling Block#isAir and Block#isLeaves.
What's the issue here?
Compile the coremod and the regular mod into separate JARs and optionally package the coremod JAR inside the mod JAR, yes.
Sometimes it's your grammar and spelling, sometimes it's vagueness and lack of detail.
When talking about something (especially code-related), try to use its exact name. In your thread on the Forge forums you asked about an "index", but nobody knew what that meant since there's nothing called an "index" in the registry system.
Earlier in this thread you asked "how to get IBlockAccess from an object", but I had no idea what "object" you meant, why you needed an IBlockAccess or where you needed it.
diesieben07 said that it wasn't an EULA, which is a specific type of contract/legal document. To my understanding, the coremod policy is a set of recommended best practices rather than a legally-binding agreement. Failure to comply with the policy won't get you in legal trouble, but some sites like Curse may eventually reject mods that don't comply with it.
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.
Well There was a file called CoreModLoader in the curse project already and they didn't deny it (technically my class didn't implement the forge asm yet but, they would have said something). Glad to hear it's not a legal issue I won't unpackage the jar since I don't want people literally downloading the same mod 3 separate functions 3 times. Thanks this clears things up alot I don't know why lex just didn't tell me I didn't have to do it that way. I will tell the rest of my team right away to not worry about updating to 1.12 especially since you can't override any Iregistry forge indexes (technically they are called entries or something but, an index is usually used a position)
So the issue is that I wasn't passing the world into all the arguments thanks. It won't be until later versions like 1.12 then that I will be able to override the swamp then.