Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.4] How i can put my strucnures in to FlatGenerationSettings.STRUCTURES
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Klarks

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

By Klarks, January 17 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Klarks    0

Klarks

Klarks    0

  • Stone Miner
  • Klarks
  • Members
  • 0
  • 95 posts
Posted January 17

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);
  • Quote

Share this post


Link to post
Share on other sites

ChampionAsh5357    165

ChampionAsh5357

ChampionAsh5357    165

  • World Shaper
  • ChampionAsh5357
  • Members
  • 165
  • 1038 posts
Posted January 17
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.

  • Quote

Share this post


Link to post
Share on other sites

Klarks    0

Klarks

Klarks    0

  • Stone Miner
  • Klarks
  • Members
  • 0
  • 95 posts
Posted January 17

But where i can get the instance
 

Map<Structure<?>, StructureFeature<?, ?>> STR = ObfuscationReflectionHelper.getPrivateValue(FlatGenerationSettings.class,instance,"STRUCTURES");
  • Quote

Share this post


Link to post
Share on other sites

ChampionAsh5357    165

ChampionAsh5357

ChampionAsh5357    165

  • World Shaper
  • ChampionAsh5357
  • Members
  • 165
  • 1038 posts
Posted January 17

How familiar are you with Java and reflection? Also, read the javadocs on the method, do not supply a mapped name and instead the associated srg name (which can be obtained from forge-bot via '!mcpf <mapped_name>).

  • Quote

Share this post


Link to post
Share on other sites

Klarks    0

Klarks

Klarks    0

  • Stone Miner
  • Klarks
  • Members
  • 0
  • 95 posts
Posted January 17

 forge-bot?

  • Quote

Share this post


Link to post
Share on other sites

Klarks    0

Klarks

Klarks    0

  • Stone Miner
  • Klarks
  • Members
  • 0
  • 95 posts
Posted January 17

I don't quite understand

  • Quote

Share this post


Link to post
Share on other sites

ChampionAsh5357    165

ChampionAsh5357

ChampionAsh5357    165

  • World Shaper
  • ChampionAsh5357
  • Members
  • 165
  • 1038 posts
Posted January 17
3 hours ago, Klarks said:

 forge-bot?

Apologies, you have to be on the forge discord to access the bot for the commands.

 

Now, if you wouldn't mind answering my question about your knowledge in Java and reflection.

  • Quote

Share this post


Link to post
Share on other sites

Klarks    0

Klarks

Klarks    0

  • Stone Miner
  • Klarks
  • Members
  • 0
  • 95 posts
Posted January 18 (edited)

I am a bigginer at Java and do not know much about reflection but I know it allows to get private var, methods, annotations and so

Edited January 18 by Klarks
  • Quote

Share this post


Link to post
Share on other sites

Klarks    0

Klarks

Klarks    0

  • Stone Miner
  • Klarks
  • Members
  • 0
  • 95 posts
Posted January 18

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

  • Quote

Share this post


Link to post
Share on other sites

ChampionAsh5357    165

ChampionAsh5357

ChampionAsh5357    165

  • World Shaper
  • ChampionAsh5357
  • Members
  • 165
  • 1038 posts
Posted January 18
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.

  • Quote

Share this post


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.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Game crashes whenever I try to increase the RAM

      By diesieben07 · Posted 1 minute ago

      That's not the debug.log.
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 25 minutes ago

      Hopefully this works, if not let me know. hs_err_pid4708.log
    • diesieben07
      Game crashes whenever I try to increase the RAM

      By diesieben07 · Posted 36 minutes ago

      Post the debug.log.
    • Sad Whale
      Game crashes whenever I try to increase the RAM

      By Sad Whale · Posted 42 minutes ago

      Whenever I try to increase the amount of RAM allocated to Minecraft it crashes with exit code 1. I have the latest Java 64-bit update, I've uninstalled and reinstalled both Minecraft and Java and have tried multiple 1.16.5 Forge versions and none of them will allow me to allocate more than the 2 gigs that it already has allocated.
    • diesieben07
      server wont start

      By diesieben07 · Posted 1 hour ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • Sad Whale
      3
      Game crashes whenever I try to increase the RAM

      By Sad Whale
      Started 42 minutes ago

    • fluiX
      1
      server wont start

      By fluiX
      Started 1 hour ago

    • Luis_ST
      6
      [1.16.5] Help with custom Event

      By Luis_ST
      Started 5 hours ago

    • hammy3502
      1
      [1.16.4] Fluid Flowing Very Oddly

      By hammy3502
      Started 20 hours ago

    • <Gl33p_0r4nge>
      0
      [1.16.4] Screen Render

      By <Gl33p_0r4nge>
      Started 5 hours ago

  • Who's Online (See full list)

    • diesieben07
    • Loganator711
    • therogueegamer
    • Microcellule
    • lupicus
    • Woosh
    • brok4d
    • Sad Whale
    • Squrikle
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.4] How i can put my strucnures in to FlatGenerationSettings.STRUCTURES
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community