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

[1.16.4] TopSolidRangeConfig topOffset mystery


frakier
 Share

Recommended Posts

I tried tracing the code but that went off the rails pretty quick.

what does topOffset do?
some samples from the minecraft code...
public static final ConfiguredFeature<?, ?> ORE_GRAVEL_NETHER = register("ore_gravel_nether", Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NETHERRACK, Features.States.GRAVEL, 33)).withPlacement(Placement.RANGE.configure(new TopSolidRangeConfig(5, 0, 37))).square().func_242731_b(2));
   public static final ConfiguredFeature<?, ?> ORE_BLACKSTONE = register("ore_blackstone", Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NETHERRACK, Features.States.BLACKSTONE, 33)).withPlacement(Placement.RANGE.configure(new TopSolidRangeConfig(5, 10, 37))).square().func_242731_b(2));

the official minecraft wiki has this for the generation...

Veins of blackstone attempt to replace netherrack 2 times per chunk in veins of size 1 to 33, from levels 5 to 28, in all Nether biomes except basalt deltas.
Veins of gravel attempt to replace netherrack 2 times per chunk in veins of size 1–33, from levels 5 to 41, in all Nether biomes except basalt deltas.

So the times per chunk makes sense... EX[func_242731_b(2)]
The 33 makes sense... EX[33] easy enough.
TopSolidRangeConfig falls apart, a bit but then the site is based on 1.16.2 it seems.

So does this sound right?
(5, 0, 37) would be 5 to 37
(5, 10, 37) would be what 5 to 47... 15 to 47? ??

Edited by frakier
Link to comment
Share on other sites

Hi

public class RangePlacement extends SimplePlacement<TopSolidRangeConfig> {
   public RangePlacement(Codec<TopSolidRangeConfig> codec) {
      super(codec);
   }

   public Stream<BlockPos> getPositions(Random random, TopSolidRangeConfig config, BlockPos pos) {
      int i = pos.getX();
      int j = pos.getZ();
      int k = random.nextInt(config.maximum - config.topOffset) + config.bottomOffset;
      return Stream.of(new BlockPos(i, k, j));
   }
}

 

Beats me why they found it necessary to have both config.maximum and config.topOffset in there.  Probably it means something, eg maximum is the highest y value of this feature but don't use the topmost topOffset rows.

 

TopSolidRangeConfig(int bottomOffset, int topOffset, int maximum)

means (5, 0, 37) gives you nextInt(37  - 0) + 5 = 5 to 41 inclusive

and (5,10, 37) gives you nextint(37 - 10) + 5 = 5 to 31 inclusive

 

-TGG

  • Thanks 1
Link to comment
Share on other sites

On 12/21/2020 at 4:46 AM, TheGreyGhost said:

Beats me why they found it necessary to have both config.maximum and config.topOffset in there.  Probably it means something, eg maximum is the highest y value of this feature but don't use the topmost topOffset rows.


TopSolidRangeConfig(int bottomOffset, int topOffset, int maximum)

means (5, 0, 37) gives you nextInt(37  - 0) + 5 = 5 to 41 inclusive

and (5,10, 37) gives you nextint(37 - 10) + 5 = 5 to 31 inclusive

Could be. That makes sense compared with how they do do the range(32) which is basically 0-31.
I get a chance I will do some testing with some xray and see how different settings work out.
Figured I would see if someone knew the answer before I started too far down the rabbit hole.

Edited by frakier
Link to comment
Share on other sites

  • 3 weeks later...

Did that testing, the conclusion was exactly what TGG said (well since he got it from the code that would be obvious lol):

// bottomOffset -> minimum height for the ore
// maximum -> minHeight + maximum = top level (the vertical expansion of the ore, it grows x levels from bottomOffset)
// topOffset -> subtracted from the maximum to give actual top level
// ore effectively exists from bottomOffset to (bottomOffset + maximum - topOffset)
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • no, the way he use it's the way to go
    • Minecraft 1.16 requires java 8-15, you currently using java 16, downgrade your java to 8-15 and the problem should be fixed.
    • Hi So Im trying to set up a Server for 1.16.4 now but when I go to launch it doesn't work, Im using the Life in the Village 2 server pack thats already pre-made but it still wont launch no matter what I try. If I can get some help that would be great thanks. D:\Modded Mc\LITV2-Serverpack-1.28a\LITV2-Serverpack-1.28a>java -Xmx4G -jar forge-1.16.5-36.2.4.jar nogui 2021-11-29 13:43:08,050 main WARN Advanced terminal features are not available in this environment [13:43:08] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmlserver, --fml.forgeVersion, 36.2.4, --fml.mcpVersion, 20210115.111550, --fml.mcVersion, 1.16.5, --fml.forgeGroup, net.minecraftforge, nogui] [13:43:08] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 8.0.9+86+master.3cf110c starting: java version 16.0.2 by Oracle Corporation Exception in thread "main" java.lang.IllegalAccessError: class cpw.mods.modlauncher.SecureJarHandler (in unnamed module @0x4de5031f) cannot access class sun.security.util.ManifestEntryVerifier (in module java.base) because module java.base does not export sun.security.util to unnamed module @0x4de5031f at cpw.mods.modlauncher.SecureJarHandler.lambda$static$1(SecureJarHandler.java:41) at cpw.mods.modlauncher.api.LamdbaExceptionUtils.uncheck(LamdbaExceptionUtils.java:95) at cpw.mods.modlauncher.SecureJarHandler.<clinit>(SecureJarHandler.java:41) at cpw.mods.modlauncher.Launcher.lambda$new$6(Launcher.java:55) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) at cpw.mods.modlauncher.api.TypesafeMap.computeIfAbsent(TypesafeMap.java:52) at cpw.mods.modlauncher.api.TypesafeMap.computeIfAbsent(TypesafeMap.java:47) at cpw.mods.modlauncher.Environment.computePropertyIfAbsent(Environment.java:62) at cpw.mods.modlauncher.Launcher.<init>(Launcher.java:55) at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) D:\Modded Mc\LITV2-Serverpack-1.28a\LITV2-Serverpack-1.28a>pause Press any key to continue . . .  
    • Still waiting on the issue.
    • Registering in static fields isn't ideal. You have a method that registers your deferred register to the event bus, right? leave your RegistryObject fields as non-final and empty, and set their reference in that method, right after registering the deferred register on the bus.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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