Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16.4] How i can put my strucnures in to FlatGenerationSettings.STRUCTURES


Recommended Posts

How i can put my structures in to FlatGenerationSettings.STRUCTURES. The structures  var is final so i cant put mine like that

FlatGenerationSettings.STRUCTURES.put(MyStructure.RUN_DOWN_HOUSE.get(), CONFIGURED_RUN_DOWN_HOUSE);
Link to post
Share on other sites
13 minutes ago, Klarks said:

The structures  var is final so i cant put mine like that

The object itself is immutable, the data can be mutable. The issue is that the field accessor is private. ObfuscationReflectionHelper#getPrivateValue can be used to obtain the Map to which you can put the value during common setup.

Link to post
Share on other sites

But where i can get the instance
 

Map<Structure<?>, StructureFeature<?, ?>> STR = ObfuscationReflectionHelper.getPrivateValue(FlatGenerationSettings.class,instance,"STRUCTURES");
Link to post
Share on other sites

Is STRUCTURES a mapped name? forge-bot gave me this 
MC 1.16.3: net/minecraft/world/gen/FlatGenerationSettings.STRUCTURES

Name: c => field_202247_j => STRUCTURES

Comment: None

Side: BOTH

AT: public net.minecraft.world.gen.FlatGenerationSettings field_202247_j

# STRUCTURES

Link to post
Share on other sites
3 hours ago, Klarks said:

Is STRUCTURES a mapped name? forge-bot gave me this 

Yes, as you can see it has the obfuscated name which translate to its unique srg name and then finally the mapped name. You will need the srg name as your parameter.

19 hours ago, Klarks said:

But where i can get the instance

The static keyword makes the field/method available at class level meaning you do not need an instance to grab the associated value. So, a null value can be passed in instead.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.