Jump to content

Zetal911

Members
  • Posts

    11
  • Joined

  • Last visited

Zetal911's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. This is exactly what I attempted to do, but as described earlier in the thread, it is now impossible because the new way of doing OreConfig/Feature is using a Registry, and Registration is called before Config is loaded.
  2. Config loading hasn't, true, but the removal of BiomeLoadingEvent (in 1.18.2 I think?) means that configs cannot be used in that later step, which was after they'd been loaded. It doesn't really matter either way though now that I've figured out how to use Feature datapacks, it's just for the sake of discussion I guess.
  3. First, and this is more of a helpful aside, you shouldn't be sending the mana every tick. You should only send mana updates when the player first connects, and when the value changes, to minimize network traffic and the impact of your mod on server performance. As for the error, this simply means that wherever you're calling useMana from is passing in a player from the client side, instead of the server side. Either you need to ensure that the side calling useMana is the server, or you should include the code that's calling useMana.
  4. Switched over to Datapack style of creating Configured/Placed features, so it's technically all configurable again now. Hurray!
  5. TBH it looks fine to me now, Tucky. Maybe try updating to the latest forge, since it seems like you're a bit behind?
  6. Okay. I was trying to update my 1.16 mod, which supported this, to 1.19. It's a shame to lose that kind of configuration control for users, but at least it's good to know there's nothing to be done about it. Thanks, all.
  7. https://pastebin.com/LnRcubaZ Log ^ Constructor public HardModeOresMod() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, HardModeOresConfig.COMMON_SPEC); HardModeOresFeatureRegistry.register(modEventBus); HardModeOresRegistry.BLOCK_REGISTRY.register(modEventBus); HardModeOresRegistry.ITEM_REGISTRY.register(modEventBus); } Example where I'm trying to use the config values public static final RegistryObject<ConfiguredFeature<?, ?>> ORE_IRON_CFG = CONFIGURED_FEATURES.register("ore_rich_iron", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(ORE_IRON_TARGET_LIST.get(), HardModeOresConfig.COMMON.IronMaxVeinSize.get()))); Config Constructor public static final Common COMMON; public static final ForgeConfigSpec COMMON_SPEC; static //constructor { Pair<Common, ForgeConfigSpec> commonSpecPair = new ForgeConfigSpec.Builder().configure(Common::new); COMMON = commonSpecPair.getLeft(); COMMON_SPEC = commonSpecPair.getRight(); } Common Constructor public Common(ForgeConfigSpec.Builder builder) { builder.push("Ores"); this.IronMaxVeinSize = builder.worldRestart().define("Rich Iron Max Vein Size", defaultIronMaxVeinSize); this.GoldMaxVeinSize = builder.worldRestart().define("Rich Gold Max Vein Size", defaultGoldMaxVeinSize); this.DiamondMaxVeinSize = builder.worldRestart().define("Rich Diamond Max Vein Size", defaultDiamondMaxVeinSize); builder.pop(); } Should be everything relevant. Note that despite the Config being named 'Common', it is using the Server config type, and is still failing in the same way. It seems that Configs are not loaded until server/world start, but OreGeneration Registration is registered when opening the world creation screen. Does this mean that it is now impossible to use ForgeConfig to configure OreGeneration?
  8. There aren't any new logs?
  9. I'm using a Common config. Would a Server config avoid throwing this error? Edit: Error still seems to be thrown regardless of type of config, whether it be Server, Client, or Common.
  10. I've just updated my Ore Generation mod to 1.19 using BiomeModifiers and RegistryObject<ConfiguredFeature>, etc., and the ores are generated as expected. However, it seems that if I try and use ForgeConfig to configure the parameters of the OreConfiguration being passed into the ConfiguredFeature for the RegistryObject, I get an error saying how the Config cannot be used before it is instantiated. Is there a different lifecycle step that I should be initializing my config or my Feature registry? Is it still possible to have ForgeConfig that affects OreGeneration? Thanks!
  11. You aren't calling ModPlacedFeatures.register in your Mod constructor.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.