Jump to content

Gianka1485

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by Gianka1485

  1. Delete it and leave it like this: @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { LOGGER.info("Hello from Register Item"); } The variable "LOGGER" only serves to guide me, so it is not necessary.
  2. I think that error is caused by the following line of code in the main class: @SubscribeEvent public static void onRegisterItems(final RegistryEvent.Register<Item> event) { BlockInit.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block -> { event.getRegistry().register(new BlockItem(block, new Item.Properties().tab(CreativeModeTab.TAB_MISC)) .setRegistryName(block.getRegistryName())); }); }
  3. After seeing your work, you must also create the properties of the block, but as an item, example: public class ItemInit { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MDG.MOD_ID); public static final RegistryObject<Item> RUBY = ITEMS.register("ruby", () -> new Item(new Item.Properties().tab(CreativeModeTab.TAB_MATERIALS))); public static final RegistryObjet<Item> RUBY_BLOCK = ITEMS.register("ruby_block", () -> new BlockItem((Block) ModBlocks.RUBY_BLOCK.get(), (new Item.Properties()).tab(CreativeModeTab.TAB_BUILDING_BLOCKS)); } And if it still does not appear, create a folder where you save the mod elements, called a block, and inside you put the information of the block. Example: package com.sotsuu.mdg.core.blocks; public class RubyBlock extends Block { public RubyBlock(Properties properties) { super(properties); } }
  4. And as for the textures, the information for the block to use a specific texture is saved in a .json file that is stored in src / main / resources / assets /% modid% / blockstates (example: example_ore.json) With the following information: { "variants": { "": { "model": "examplemod:block/example_ore" } } } Just for the blocks. And you need to save another .json file which will recognize the texture in src / main / resources / assets /% modid% / models / blocks (example: example_ore.json) (The information stored varies depending on what you want to use as a texture, whether you need one texture to cover all 6 faces, or just one on the top and a different one on the bottom). And you also need to create another .json file stored in src / main / resources / assets /% modid% / models / items for the block texture when in player inventory. (example: example_ore.json) Generally, you use the following information, but it can also vary: { "parent": "examplemod:block/example_ore" }
  5. You have to create a "loot table" of the block stored in src / main / resources / data /% modid% / loot_tables / blocks /% block_name%.json with the information you need depending on your needs (such as flowers, plants, etc), normally generator loot tables are used. If you want the block to be broken by a spike, then you create a file called "needs_% material_tool_need% _tool.json" (example: needs_diamond_tool.json, needs_wood_tool.json) and inside you enter the following values: { "replace": false, "values": [ "examplemod:example_ore" ] } For instance. (The file is stored in src / main / resources / data / minecraft / tags / blocks ) And you also need a file that specifies what kind of tool it will use, for example: pickaxe.json (With the same information I gave as an example before.) And it has to be located in src / main / resources / data / minecraft / tags / blocks / mineable. And that's it.
  6. I added a new system of tools with obviously modified statistics, everything is excellent until it is time to add an ax, in which minecraft crashes without even being able to see the main menu. The error is: ExampleMod (examplemod) encountered an error during the common_setup event phase java.lang.ExceptionInInitializerError: null The crash report: ---- Minecraft Crash Report ---- // You should try our sister game, Minceraft! Time: 26/08/21, 7:39 p. m. Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed at net.minecraftforge.fmllegacy.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:69) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at net.minecraftforge.fmlclient.ClientModLoader.completeModLoading(ClientModLoader.java:183) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.lambda$new$1(Minecraft.java:556) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.Util.ifElse(Util.java:361) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading} at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:550) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.LoadingOverlay.render(LoadingOverlay.java:135) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:874) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runTick(Minecraft.java:1040) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:660) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:186) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {} at net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:38) ~[fmlloader-1.17.1-37.0.44.jar%233!:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at java.util.Objects.requireNonNull(Objects.java:334) ~[?:?] {} -- MOD gworld -- Details: Caused by 0: java.lang.ExceptionInInitializerError at jp.gianka.gworld.elements.init.GWorldItems.lambda$static$0(GWorldItems.java:26) ~[%2378!:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:121) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:197) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:169) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-5.0.3.jar%237!:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%237!:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%237!:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) ~[javafmllanguage-1.17.1-37.0.44.jar%2375!:?] {} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:121) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1800) ~[?:?] {} at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:216) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModLoader.lambda$dispatchAndHandleError$21(ModLoader.java:201) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] {} at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:201) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$11(ModLoader.java:178) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {} at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:178) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fmlclient.ClientModLoader.lambda$begin$1(ClientModLoader.java:107) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fmlclient.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:127) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fmlclient.ClientModLoader.begin(ClientModLoader.java:107) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.<init>(Minecraft.java:461) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:151) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {} at net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:38) ~[fmlloader-1.17.1-37.0.44.jar%233!:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} Mod File: main Failure message: GWorld (gworld) encountered an error during the common_setup event phase java.lang.ExceptionInInitializerError: null Mod Version: 0.0.0.102 Mod Issue URL: NOT PROVIDED Exception message: java.lang.NullPointerException: Registry Object not present: gworld:kyptoite_gem Stacktrace: at java.util.Objects.requireNonNull(Objects.java:334) ~[?:?] {} at net.minecraftforge.fmllegacy.RegistryObject.get(RegistryObject.java:120) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at jp.gianka.gworld.elements.config.GWorldTiers.lambda$static$0(GWorldTiers.java:12) ~[%2378!:?] {re:classloading} at jp.gianka.gworld.elements.config.GWorldTiers.<init>(GWorldTiers.java:28) ~[%2378!:?] {re:classloading} at jp.gianka.gworld.elements.config.GWorldTiers.<clinit>(GWorldTiers.java:11) ~[%2378!:?] {re:classloading} at jp.gianka.gworld.elements.init.GWorldItems.lambda$static$0(GWorldItems.java:26) ~[%2378!:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:121) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:197) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:169) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-5.0.3.jar%237!:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-5.0.3.jar%237!:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-5.0.3.jar%237!:?] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:120) ~[javafmllanguage-1.17.1-37.0.44.jar%2375!:?] {} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:121) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1800) ~[?:?] {} at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:56) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:40) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:216) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModLoader.lambda$dispatchAndHandleError$21(ModLoader.java:201) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] {} at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:201) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$11(ModLoader.java:178) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {} at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:178) ~[fmlcore-1.17.1-37.0.44.jar%2377!:?] {} at net.minecraftforge.fmlclient.ClientModLoader.lambda$begin$1(ClientModLoader.java:107) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fmlclient.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:127) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fmlclient.ClientModLoader.begin(ClientModLoader.java:107) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2373%2379!:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.<init>(Minecraft.java:461) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:151) ~[forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp.jar%2374!:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?] {} at net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:38) ~[fmlloader-1.17.1-37.0.44.jar%233!:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%238!:?] {} at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} -- System Details -- Details: Minecraft Version: 1.17.1 Minecraft Version ID: 1.17.1 Operating System: Windows 10 (amd64) version 10.0 Java Version: 16.0.2, Oracle Corporation Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Oracle Corporation Memory: 761360384 bytes (726 MiB) / 1350565888 bytes (1288 MiB) up to 2147483648 bytes (2048 MiB) CPUs: 6 Processor Vendor: AuthenticAMD Processor Name: AMD Processor model unknown Identifier: AuthenticAMD Family 16 Model 10 Stepping 0 Microarchitecture: K10 Frequency (GHz): 4,01 Number of physical packages: 1 Number of physical CPUs: 6 Number of logical CPUs: 12 Graphics card #0 name: AMD Radeon (TM) R9 390X Series Graphics card #0 vendor: Advanced Micro Devices, Inc. (0x1002) Graphics card #0 VRAM (MB): 8192,00 Graphics card #0 deviceId: 0x6939 Graphics card #0 versionInfo: DriverVersion=27.20.20903.8001 Virtual memory max (MB): 15144,09 Virtual memory used (MB): 12227,07 Swap memory total (MB): 30.348,85 Swap memory used (MB): 799,25 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 9.0.7+91+master.8569cdf ModLauncher launch target: forgeclientuserdev ModLauncher naming: mcp ModLauncher services: eventbus PLUGINSERVICE object_holder_definalize PLUGINSERVICE runtime_enum_extender PLUGINSERVICE capability_inject_definalize PLUGINSERVICE accesstransformer PLUGINSERVICE runtimedistcleaner PLUGINSERVICE fml TRANSFORMATIONSERVICE FML Language Providers: [email protected] javafml@null Mod List: forge-1.17.1-37.0.44_mapped_official_1.17.1-recomp|Minecraft |minecraft |1.17.1 |COMMON_SET|Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f |Forge |forge |37.0.44 |COMMON_SET|Manifest: NOSIGNATURE main |GWorld |gworld |0.0.0.102 |ERROR |Manifest: NOSIGNATURE Crash Report UUID: 08751ce5-ac20-4a49-a512-b5af79c03159 FML: 37.0 Forge: net.minecraftforge:37.0.44 It seems like the error is starting the "GWorldItems" event, but I really don't know how to fix it. My code: The Main: @Mod(GWorld.modid) public class GWorld { public static final String modid = "gworld"; private static final Logger LOGGER = LogManager.getLogger("gworld"); public static final CreativeModeTab gworld = new GWorldTab(); public GWorld() { IEventBus modEventbus = FMLJavaModLoadingContext.get().getModEventBus(); GWorldBlocks.BLOCKS.register(modEventbus); GWorldItems.ITEMS.register(modEventbus); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); ModLoadingContext.get().registerConfig(Type.COMMON, GWorldConfig.SPEC, "gworld-common.toml"); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { event.enqueueWork(() -> { OreGeneration.registerConfiguredFeatures(); }); LOGGER.info("Hello from preinit"); LOGGER.info("Dirt block >> {}", Blocks.DIRT.getRegistryName()); } @OnlyIn(Dist.CLIENT) public void clientSetup(FMLClientSetupEvent event) { LOGGER.info("Hello from client setup"); } @SubscribeEvent public void serverStarting(FMLServerStartingEvent event) { LOGGER.info("Hello from server starting"); } @EventBusSubscriber(bus = Bus.MOD) public static class RegistryEvents { public RegistryEvents() { } @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { LOGGER.info("Hello from Register Block"); } @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { LOGGER.info("Hello from Register Item"); } } } The GWorldItems: public class GWorldItems { public static final DeferredRegister<Item> ITEMS; public static final RegistryObject<AxeItem> KYPTOITE_AXE; public static final RegistryObject<Item> KYPTOITE_DUST; public static final RegistryObject<Item> KYPTOITE_GEM; public static final RegistryObject<Item> KYPTOITE_ORE; public static final RegistryObject<PickaxeItem> KYPTOITE_PICKAXE; public static final RegistryObject<SwordItem> KYPTOITE_SWORD; static { ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "gworld"); KYPTOITE_AXE = ITEMS.register("kyptoite_axe", () -> { return new AxeItem(GWorldTiers.KYPTOITE_TOOL, 5.0F, -3.0F, (new Properties()).tab(GWorld.gworld)); }); KYPTOITE_DUST = ITEMS.register("kyptoite_dust", () -> { return new Item((new Properties()).tab(GWorld.gworld)); }); KYPTOITE_GEM = ITEMS.register("kyptoite_gem", () -> { return new Item((new Properties()).tab(GWorld.gworld)); }); KYPTOITE_ORE = ITEMS.register("kyptoite_ore", () -> { return new BlockItem((Block) GWorldBlocks.KYPTOITE_ORE.get(), (new Properties()).tab(GWorld.gworld)); }); KYPTOITE_PICKAXE = ITEMS.register("kyptoite_pickaxe", () -> { return new PickaxeItem(GWorldTiers.KYPTOITE_TOOL, 1, -2.8F, (new Properties()).tab(GWorld.gworld)); }); KYPTOITE_SWORD = ITEMS.register("kyptoite_sword", () -> { return new SwordItem(GWorldTiers.KYPTOITE_TOOL, 3, -2.4F, (new Properties()).tab(GWorld.gworld)); }); } } The GWorldTiers: public enum GWorldTiers implements Tier { KYPTOITE_TOOL(5, 2500, 15.0F, 5.0F, 25, () -> { return Ingredient.of(new ItemLike[]{(ItemLike) GWorldItems.KYPTOITE_GEM.get()}); }); private final int level; private final int uses; private final float speed; private final float damage; private final int enchantmentValue; private final Ingredient repairIngredient; private GWorldTiers(int level, int uses, float speed, float damage, int enchantmentValue, Supplier<Ingredient> repairIngredient) { this.level = level; this.uses = uses; this.speed = speed; this.damage = damage; this.enchantmentValue = enchantmentValue; this.repairIngredient = (Ingredient) repairIngredient.get(); } public int getLevel() { return this.level; } public int getUses() { return this.uses; } public float getSpeed() { return this.speed; } public float getAttackDamageBonus() { return this.damage; } public int getEnchantmentValue() { return this.enchantmentValue; } public Ingredient getRepairIngredient() { return this.repairIngredient; } } Could someone help me with this error?
  7. So, going back to what I was saying, this was my solution after so much talk: The Main: @Mod(ExampleMod.modid) public class ExampleMod { public static final String modid = "examplemod"; private static final Logger LOGGER = LogManager.getLogger("examplemod"); public static final CreativeModeTab examplemod = new ExampleTab(); public ExampleMod() { IEventBus modEventbus = FMLJavaModLoadingContext.get().getModEventBus(); ExampleBlocks.BLOCKS.register(modEventbus); ExampleItems.ITEMS.register(modEventbus); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); ModLoadingContext.get().registerConfig(Type.COMMON, GWorldConfig.SPEC, "example-common.toml"); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { event.enqueueWork(() -> { OreGeneration.registerConfiguredFeatures(); }); LOGGER.info("Hello from preinit"); LOGGER.info("Dirt block >> {}", Blocks.DIRT.getRegistryName()); } @OnlyIn(Dist.CLIENT) public void clientSetup(FMLClientSetupEvent event) { LOGGER.info("Hello from client setup"); } @SubscribeEvent public void serverStarting(FMLServerStartingEvent event) { LOGGER.info("Hello from server starting"); } @EventBusSubscriber(bus = Bus.MOD) public static class RegistryEvents { public RegistryEvents() { } @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { LOGGER.info("Hello from Register Block"); } } } The Config: public class ExampleConfig { public static final Builder BUILDER = new Builder(); public static final ForgeConfigSpec SPEC; public static final ConfigValue<Boolean> EXAMPLE_ORE_GENERATION; public static final ConfigValue<Integer> EXAMPLE_ORE_SIZE; public static final ConfigValue<Integer> EXAMPLE_ORE_MIN_HEIGHT; public static final ConfigValue<Integer> EXAMPLE_ORE_MAX_HEIGHT; public static final ConfigValue<Integer> EXAMPLE_ORE_CHANCE; public ExampleConfig() { } static { BUILDER.push("Example ore generation"); EXAMPLE_ORE_GENERATION = BUILDER.define("Generate kyptoite ore", true); EXAMPLE_ORE_SIZE = BUILDER.define("Example ore vein size", 4); EXAMPLE_ORE_MIN_HEIGHT = BUILDER.define("Minimum example ore generation height", 0); EXAMPLE_ORE_MAX_HEIGHT = BUILDER.define("Maximum example ore generation height", 16); EXAMPLE_ORE_CHANCE = BUILDER.define("Chance of generate example ore", 1); BUILDER.pop(); SPEC = BUILDER.build(); } } The OreGeneration: @EventBusSubscriber public class OreGeneration { public static ImmutableList<TargetBlockState> EXAMPLE_ORE_TARGET_LIST; public static ConfiguredFeature<?, ?> EXAMPLE_ORE; public OreGeneration() { } public static void registerConfiguredFeatures() { EXAMPLE_ORE_TARGET_LIST = ImmutableList.of(OreConfiguration.target(Predicates.NATURAL_STONE, ((Block) ExampleBlocks.KYPTOITE_ORE.get()).defaultBlockState()), OreConfiguration.target(Predicates.STONE_ORE_REPLACEABLES, ((Block) ExampleBlocks.KYPTOITE_ORE.get()).defaultBlockState())); EXAMPLE_ORE = (ConfiguredFeature)((ConfiguredFeature)((ConfiguredFeature) Feature.ORE.configured(new OreConfiguration(EXAMPLE_ORE_TARGET_LIST, (Integer) ExampleConfig.EXAMPLE_ORE_SIZE.get())).rangeUniform(VerticalAnchor.absolute((Integer) ExampleConfig.EXAMPLE_ORE_MIN_HEIGHT.get()), VerticalAnchor.absolute((Integer) ExampleConfig.EXAMPLE_ORE_MAX_HEIGHT.get()))).squared()).count((Integer) ExampleConfig.EXAMPLE_ORE_CHANCE.get()); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new ResourceLocation("examplemod", "example_ore"), EXAMPLE_ORE); } @SubscribeEvent(priority = EventPriority.HIGH) public static void registerBiomeModification(BiomeLoadingEvent event) { event.getGeneration().getFeatures(Decoration.UNDERGROUND_ORES).add(() -> { return EXAMPLE_ORE; }); } } And this was the solution that I found with the help of Grookey, Luis_ST and diesieben07
  8. "MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, FeatureInit::generateOre);" It should not be in "FMLCommonSetupEvent". Solution: The main: @Mod(Example.modid) public class Example { public static final String modid = "examplemod"; private static final Logger LOGGER = LogManager.getLogger("examplemod"); public static final CreativeModeTab examplemod = new ExampleTab(); public Example() { IEventBus modEventbus = FMLJavaModLoadingContext.get().getModEventBus(); ExampleBlocks.BLOCKS.register(modEventbus); ExampleItems.ITEMS.register(modEventbus); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, FeatureInit::generateOre); ModLoadingContext.get().registerConfig(Type.COMMON, GWorldConfig.SPEC, "example-common.toml"); MinecraftForge.EVENT_BUS.register(this); } etc......... }
  9. After a while searching, I concluded that if in the vein size section, a value is set <4 then the mineral is not generated, and that it is not necessary to have "registerConfiguredFeatures" in "BiomeLoadingEvent".
  10. Now, after reconfiguring the .toml files, it starts, now I will test the generation of the ores.
  11. Yes, but it seems that the cause was a conflict in the run / config / ". Toml" files.
  12. If I start the minecraft client without "registerConfiguredFeatures" in "BiomeLoadingEvent", minecraft crashes .... XD
  13. Sorry, the google translator.
  14. Just give the reason why it is there, but from FMLCommonSetupEvent, will it be custom?
  15. The mineral or mineral list is not generated if I remove "registerConfiguredFeatures" from "BiomeLoadingEvent"
  16. For those who still don't have the code working, this was the solution I made to my project: The config: public class ExampleConfig { public static final Builder BUILDER = new Builder(); public static final ForgeConfigSpec SPEC; public static final ConfigValue<Boolean> EXAMPLE_ORE_GENERATION; public static final ConfigValue<Integer> EXAMPLE_ORE_SIZE; public static final ConfigValue<Integer> EXAMPLE_ORE_MIN_HEIGHT; public static final ConfigValue<Integer> EXAMPLE_ORE_MAX_HEIGHT; public static final ConfigValue<Integer> EXAMPLE_ORE_CHANCE; public ExampleConfig() { } static { BUILDER.push("Example ore generation"); EXAMPLE_ORE_GENERATION = BUILDER.define("Generate example ore", true); EXAMPLE_ORE_SIZE = BUILDER.define("Example ore vein size", 4); EXAMPLE_ORE_MIN_HEIGHT = BUILDER.define("Minimum example ore generation height", 0); EXAMPLE_ORE_MAX_HEIGHT = BUILDER.define("Maximum example ore generation height", 16); EXAMPLE_ORE_CHANCE = BUILDER.define("Chance of generate example ore", 1); BUILDER.pop(); SPEC = BUILDER.build(); } } The OreGeneration: @EventBusSubscriber public class OreGeneration { public static ImmutableList<TargetBlockState> EXAMPLE_ORE_TARGET_LIST; public static ConfiguredFeature<?, ?> EXAMPLE_ORE; public OreGeneration() { } public static void registerConfiguredFeatures() { EXAMPLE_ORE_TARGET_LIST = ImmutableList.of(OreConfiguration.target(Predicates.NATURAL_STONE, ((Block) ExampleBlocks.EXAMPLE_ORE.get()).defaultBlockState()), OreConfiguration.target(Predicates.STONE_ORE_REPLACEABLES, ((Block) ExampleBlocks.EXAMPLE_ORE.get()).defaultBlockState())); EXAMPLE_ORE = (ConfiguredFeature)((ConfiguredFeature)((ConfiguredFeature) Feature.ORE.configured(new OreConfiguration(EXAMPLE_ORE_TARGET_LIST, (Integer) ExampleConfig.EXAMPLE_ORE_SIZE.get())).rangeUniform(VerticalAnchor.absolute((Integer) ExampleConfig.EXAMPLE_ORE_MIN_HEIGHT.get()), VerticalAnchor.absolute((Integer) ExampleConfig.EXAMPLE_ORE_MAX_HEIGHT.get()))).squared()).count((Integer) ExampleConfig.EXAMPLE_ORE_CHANCE.get()); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new ResourceLocation("examplemod", "example_ore"), EXAMPLE_ORE); } @SubscribeEvent(priority = EventPriority.HIGH) public static void registerBiomeModification(BiomeLoadingEvent event) { registerConfiguredFeatures(); event.getGeneration().getFeatures(Decoration.UNDERGROUND_ORES).add(() -> { return EXAMPLE_ORE; }); } } The Main: @Mod(Example.modid) public class Example { public static Example instance; public static final String modid = "examplemod"; private static final Logger LOGGER = LogManager.getLogger("examplemod"); public static final CreativeModeTab gworld = new GWorldTab(); public Examle() { instance = this; ExampleBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); ExampleItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); ModLoadingContext.get().registerConfig(Type.COMMON, ExampleConfig.SPEC, "example-common.toml"); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { OreGeneration.registerConfiguredFeatures(); LOGGER.info("Hello from preinit"); LOGGER.info("Dirt block >> {}", Blocks.DIAMOND_ORE.getRegistryName()); } @OnlyIn(Dist.CLIENT) public void clientSetup(FMLClientSetupEvent event) { LOGGER.info("Hello from client setup"); } @SubscribeEvent public void serverStarting(FMLServerStartingEvent event) { LOGGER.info("Hello from server starting"); } @EventBusSubscriber(bus = Bus.MOD) public static class RegistryEvents { public RegistryEvents() { } @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { LOGGER.info("Hello from Register Block"); } } }
  17. I already found the examples.
  18. When I enter features the following appears: public static final Feature<OreConfiguration> ORE = register("ore", new OreFeature(OreConfiguration.CODEC)); Upon entering OreFeature, the following appears: public class OreFeature extends Feature<OreConfiguration> { public OreFeature(Codec<OreConfiguration> p_66531_) { super(p_66531_); } public boolean place(FeaturePlaceContext<OreConfiguration> p_160177_) { Random random = p_160177_.random(); BlockPos blockpos = p_160177_.origin(); WorldGenLevel worldgenlevel = p_160177_.level(); OreConfiguration oreconfiguration = p_160177_.config(); float f = random.nextFloat() * (float)Math.PI; float f1 = (float)oreconfiguration.size / 8.0F; int i = Mth.ceil(((float)oreconfiguration.size / 16.0F * 2.0F + 1.0F) / 2.0F); double d0 = (double)blockpos.getX() + Math.sin((double)f) * (double)f1; double d1 = (double)blockpos.getX() - Math.sin((double)f) * (double)f1; double d2 = (double)blockpos.getZ() + Math.cos((double)f) * (double)f1; double d3 = (double)blockpos.getZ() - Math.cos((double)f) * (double)f1; int j = 2; double d4 = (double)(blockpos.getY() + random.nextInt(3) - 2); double d5 = (double)(blockpos.getY() + random.nextInt(3) - 2); int k = blockpos.getX() - Mth.ceil(f1) - i; int l = blockpos.getY() - 2 - i; int i1 = blockpos.getZ() - Mth.ceil(f1) - i; int j1 = 2 * (Mth.ceil(f1) + i); int k1 = 2 * (2 + i); for(int l1 = k; l1 <= k + j1; ++l1) { for(int i2 = i1; i2 <= i1 + j1; ++i2) { if (l <= worldgenlevel.getHeight(Heightmap.Types.OCEAN_FLOOR_WG, l1, i2)) { return this.doPlace(worldgenlevel, random, oreconfiguration, d0, d1, d2, d3, d4, d5, k, l, i1, j1, k1); } } } return false; } protected boolean doPlace(WorldGenLevel p_66533_, Random p_66534_, OreConfiguration p_66535_, double p_66536_, double p_66537_, double p_66538_, double p_66539_, double p_66540_, double p_66541_, int p_66542_, int p_66543_, int p_66544_, int p_66545_, int p_66546_) { int i = 0; BitSet bitset = new BitSet(p_66545_ * p_66546_ * p_66545_); BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); int j = p_66535_.size; double[] adouble = new double[j * 4]; for(int k = 0; k < j; ++k) { float f = (float)k / (float)j; double d0 = Mth.lerp((double)f, p_66536_, p_66537_); double d1 = Mth.lerp((double)f, p_66540_, p_66541_); double d2 = Mth.lerp((double)f, p_66538_, p_66539_); double d3 = p_66534_.nextDouble() * (double)j / 16.0D; double d4 = ((double)(Mth.sin((float)Math.PI * f) + 1.0F) * d3 + 1.0D) / 2.0D; adouble[k * 4 + 0] = d0; adouble[k * 4 + 1] = d1; adouble[k * 4 + 2] = d2; adouble[k * 4 + 3] = d4; } for(int l3 = 0; l3 < j - 1; ++l3) { if (!(adouble[l3 * 4 + 3] <= 0.0D)) { for(int i4 = l3 + 1; i4 < j; ++i4) { if (!(adouble[i4 * 4 + 3] <= 0.0D)) { double d8 = adouble[l3 * 4 + 0] - adouble[i4 * 4 + 0]; double d10 = adouble[l3 * 4 + 1] - adouble[i4 * 4 + 1]; double d12 = adouble[l3 * 4 + 2] - adouble[i4 * 4 + 2]; double d14 = adouble[l3 * 4 + 3] - adouble[i4 * 4 + 3]; if (d14 * d14 > d8 * d8 + d10 * d10 + d12 * d12) { if (d14 > 0.0D) { adouble[i4 * 4 + 3] = -1.0D; } else { adouble[l3 * 4 + 3] = -1.0D; } } } } } } BulkSectionAccess bulksectionaccess = new BulkSectionAccess(p_66533_); try { for(int j4 = 0; j4 < j; ++j4) { double d9 = adouble[j4 * 4 + 3]; if (!(d9 < 0.0D)) { double d11 = adouble[j4 * 4 + 0]; double d13 = adouble[j4 * 4 + 1]; double d15 = adouble[j4 * 4 + 2]; int k4 = Math.max(Mth.floor(d11 - d9), p_66542_); int l = Math.max(Mth.floor(d13 - d9), p_66543_); int i1 = Math.max(Mth.floor(d15 - d9), p_66544_); int j1 = Math.max(Mth.floor(d11 + d9), k4); int k1 = Math.max(Mth.floor(d13 + d9), l); int l1 = Math.max(Mth.floor(d15 + d9), i1); for(int i2 = k4; i2 <= j1; ++i2) { double d5 = ((double)i2 + 0.5D - d11) / d9; if (d5 * d5 < 1.0D) { for(int j2 = l; j2 <= k1; ++j2) { double d6 = ((double)j2 + 0.5D - d13) / d9; if (d5 * d5 + d6 * d6 < 1.0D) { for(int k2 = i1; k2 <= l1; ++k2) { double d7 = ((double)k2 + 0.5D - d15) / d9; if (d5 * d5 + d6 * d6 + d7 * d7 < 1.0D && !p_66533_.isOutsideBuildHeight(j2)) { int l2 = i2 - p_66542_ + (j2 - p_66543_) * p_66545_ + (k2 - p_66544_) * p_66545_ * p_66546_; if (!bitset.get(l2)) { bitset.set(l2); blockpos$mutableblockpos.set(i2, j2, k2); if (p_66533_.ensureCanWrite(blockpos$mutableblockpos)) { LevelChunkSection levelchunksection = bulksectionaccess.getSection(blockpos$mutableblockpos); if (levelchunksection != LevelChunk.EMPTY_SECTION) { int i3 = SectionPos.sectionRelative(i2); int j3 = SectionPos.sectionRelative(j2); int k3 = SectionPos.sectionRelative(k2); BlockState blockstate = levelchunksection.getBlockState(i3, j3, k3); for(OreConfiguration.TargetBlockState oreconfiguration$targetblockstate : p_66535_.targetStates) { if (canPlaceOre(blockstate, bulksectionaccess::getBlockState, p_66534_, p_66535_, oreconfiguration$targetblockstate, blockpos$mutableblockpos)) { levelchunksection.setBlockState(i3, j3, k3, oreconfiguration$targetblockstate.state, false); ++i; break; } } } } } } } } } } } } } } catch (Throwable throwable1) { try { bulksectionaccess.close(); } catch (Throwable throwable) { throwable1.addSuppressed(throwable); } throw throwable1; } bulksectionaccess.close(); return i > 0; } public static boolean canPlaceOre(BlockState p_160170_, Function<BlockPos, BlockState> p_160171_, Random p_160172_, OreConfiguration p_160173_, OreConfiguration.TargetBlockState p_160174_, BlockPos.MutableBlockPos p_160175_) { if (!p_160174_.target.test(p_160170_, p_160172_)) { return false; } else if (shouldSkipAirCheck(p_160172_, p_160173_.discardChanceOnAirExposure)) { return true; } else { return !isAdjacentToAir(p_160171_, p_160175_); } } protected static boolean shouldSkipAirCheck(Random p_160179_, float p_160180_) { if (p_160180_ <= 0.0F) { return true; } else if (p_160180_ >= 1.0F) { return false; } else { return p_160179_.nextFloat() >= p_160180_; } } } When entering OreConfiguration the following appears: public class OreConfiguration implements FeatureConfiguration { public static final Codec<OreConfiguration> CODEC = RecordCodecBuilder.create((p_67849_) -> { return p_67849_.group(Codec.list(OreConfiguration.TargetBlockState.CODEC).fieldOf("targets").forGetter((p_161027_) -> { return p_161027_.targetStates; }), Codec.intRange(0, 64).fieldOf("size").forGetter((p_161025_) -> { return p_161025_.size; }), Codec.floatRange(0.0F, 1.0F).fieldOf("discard_chance_on_air_exposure").forGetter((p_161020_) -> { return p_161020_.discardChanceOnAirExposure; })).apply(p_67849_, OreConfiguration::new); }); public final List<OreConfiguration.TargetBlockState> targetStates; public final int size; public final float discardChanceOnAirExposure; public OreConfiguration(List<OreConfiguration.TargetBlockState> p_161016_, int p_161017_, float p_161018_) { this.size = p_161017_; this.targetStates = p_161016_; this.discardChanceOnAirExposure = p_161018_; } public OreConfiguration(List<OreConfiguration.TargetBlockState> p_161013_, int p_161014_) { this(p_161013_, p_161014_, 0.0F); } public OreConfiguration(RuleTest p_161008_, BlockState p_161009_, int p_161010_, float p_161011_) { this(ImmutableList.of(new OreConfiguration.TargetBlockState(p_161008_, p_161009_)), p_161010_, p_161011_); } public OreConfiguration(RuleTest p_67843_, BlockState p_67844_, int p_67845_) { this(ImmutableList.of(new OreConfiguration.TargetBlockState(p_67843_, p_67844_)), p_67845_, 0.0F); } public static OreConfiguration.TargetBlockState target(RuleTest p_161022_, BlockState p_161023_) { return new OreConfiguration.TargetBlockState(p_161022_, p_161023_); } public static final class Predicates { public static final RuleTest NATURAL_STONE = new TagMatchTest(BlockTags.BASE_STONE_OVERWORLD); public static final RuleTest STONE_ORE_REPLACEABLES = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); public static final RuleTest DEEPSLATE_ORE_REPLACEABLES = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); public static final RuleTest NETHERRACK = new BlockMatchTest(Blocks.NETHERRACK); public static final RuleTest NETHER_ORE_REPLACEABLES = new TagMatchTest(BlockTags.BASE_STONE_NETHER); } public static class TargetBlockState { public static final Codec<OreConfiguration.TargetBlockState> CODEC = RecordCodecBuilder.create((p_161039_) -> { return p_161039_.group(RuleTest.CODEC.fieldOf("target").forGetter((p_161043_) -> { return p_161043_.target; }), BlockState.CODEC.fieldOf("state").forGetter((p_161041_) -> { return p_161041_.state; })).apply(p_161039_, OreConfiguration.TargetBlockState::new); }); public final RuleTest target; public final BlockState state; TargetBlockState(RuleTest p_161036_, BlockState p_161037_) { this.target = p_161036_; this.state = p_161037_; } } } And this is the only code snippet that I can recognize to be part of the netherite: public OreConfiguration(RuleTest p_67843_, BlockState p_67844_, int p_67845_) { this(ImmutableList.of(new OreConfiguration.TargetBlockState(p_67843_, p_67844_)), p_67845_, 0.0F); }
  19. So where can I find the netherite example? I already looked in features and only the base code of the generation appears, where then could I find the diamond one, for example?
  20. I already saw the code but it really didn't help me much, maybe you can give an example?
  21. Where do I find it? I have looked for it a lot, but I have not been able to find it.
  22. Now this brings another error, if in the ExampleConfig file the value of the variable "EXAMPLE_ORE_SIZE" is less than 4, the mineral is not generated, this is a big problem for me, since I want to add a mineral better than netherite, and That is just as rare, but it just doesn't appear, even if I increase the chance value a lot, it still doesn't work.
  23. It worked in the best possible way, it may seem very silly, but I spent about 3 days changing the code to fix the problem, and after so long, I just changed the values to absolute and it is as it should be, after a long time, my code It remained like this: @EventBusSubscriber public class OreGeneration { public static ImmutableList<TargetBlockState> EXAMPLE_ORE_TARGET_LIST; public static ConfiguredFeature<?, ?> EXAMPLE_ORE; public OreGeneration() { } public static void registerConfiguredFeatures() { EXAMPLE_ORE_TARGET_LIST = ImmutableList.of(OreConfiguration.target(Predicates.NATURAL_STONE, ((Block) ExampleBlocks.EXAMPLE_ORE.get()).defaultBlockState()), OreConfiguration.target(Predicates.STONE_ORE_REPLACEABLES, ((Block) ExampleBlocks.EXAMPLE_ORE.get()).defaultBlockState())); EXAMPLE_ORE = (ConfiguredFeature)((ConfiguredFeature)((ConfiguredFeature) Feature.ORE.configured(new OreConfiguration(EXAMPLE_ORE_TARGET_LIST, (Integer) ExampleConfig.EXAMPLE_ORE_SIZE.get())).rangeUniform(VerticalAnchor.absolute((Integer) ExampleConfig.EXAMPLE_ORE_MIN_HEIGHT.get()), VerticalAnchor.absolute((Integer) ExampleConfig.EXAMPLE_ORE_MAX_HEIGHT.get()))).squared()).count((Integer) ExampleConfig.EXAMPLE_ORE_CHANCE.get()); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new ResourceLocation("examplemod", "example_ore"), EXAMPLE_ORE); } @SubscribeEvent public static void registerBiomeModification(BiomeLoadingEvent event) { registerConfiguredFeatures(); event.getGeneration().getFeatures(Decoration.UNDERGROUND_ORES).add(() -> { return EXAMPLE_ORE; }); } }
  24. Cambié el código de generación de los minerales a lo siguiente: OreGeneration: @EventBusSubscriber public class OreGeneration { public static ImmutableList<TargetBlockState> EXAMPLE_ORE_TARGET_LIST; public static ConfiguredFeature<?, ?> EXAMPLE_ORE; public OreGeneration() { } public static void registerConfiguredFeatures() { EXAMPLE_ORE_TARGET_LIST = ImmutableList.of(OreConfiguration.target(Predicates.NATURAL_STONE, ((Block) ExampleBlocks.EXAMPLE_ORE.get()).defaultBlockState()), OreConfiguration.target(Predicates.STONE_ORE_REPLACEABLES, ((Block) ExampleBlocks.EXAMPLE_ORE.get()).defaultBlockState())); EXAMPLE_ORE = (ConfiguredFeature)((ConfiguredFeature)((ConfiguredFeature) Feature.ORE.configured(new OreConfiguration(EXAMPLE_ORE_TARGET_LIST, (Integer) ExampleConfig.EXAMPLE_ORE_SIZE.get())).rangeUniform(VerticalAnchor.aboveBottom((Integer) ExampleConfig.EXAMPLE_ORE_MIN_HEIGHT.get()), VerticalAnchor.belowTop((Integer) ExampleConfig.EXAMPLE_ORE_MAX_HEIGHT.get()))).squared()).count((Integer) ExampleConfig.EXAMPLE_ORE_CHANCE.get()); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new ResourceLocation("examplemod", "example_ore"), EXAMPLE_ORE); } @SubscribeEvent public static void registerBiomeModification(BiomeLoadingEvent event) { registerConfiguredFeatures(); event.getGeneration().getFeatures(Decoration.UNDERGROUND_ORES).add(() -> { return EXAMPLE_ORE; }); } } Los principales: @Mod("examplemod") public class ExampleMod { public static ExampleMod instance; public static final String modid = "examplemod"; private static final Logger LOGGER = LogManager.getLogger("examplemod"); public static final CreativeModeTab examplemod = new ExampleTab(); public ExampleMod() { instance = this; ExampleBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); ExampleItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); ModLoadingContext.get().registerConfig(Type.COMMON, ExampleModConfig.SPEC, "example-common.toml"); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { OreGeneration.registerConfiguredFeatures; <- THE CHANGE LOGGER.info("Hello from preinit"); LOGGER.info("Dirt block >> {}", Blocks.DIRT.getRegistryName()); } @OnlyIn(Dist.CLIENT) public void clientSetup(FMLClientSetupEvent event) { LOGGER.info("Hello from client setup"); } @SubscribeEvent public void serverStarting(FMLServerStartingEvent event) { LOGGER.info("Hello from server starting"); } @EventBusSubscriber(bus = Bus.MOD) public static class RegistryEvents { public RegistryEvents() { } @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { LOGGER.info("Hello from Register Block"); } @SubscribeEvent public static void registerItems(final RegistryEvent.Register<Item> event) { LOGGER.info("Hello from Register Item"); } @SubscribeEvent public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) { LOGGER.info("Hello from Register Entity"); } @SubscribeEvent public static void registerEnchantments(final RegistryEvent.Register<Enchantment> event) { LOGGER.info("Hello from Register Enchantment"); } @SubscribeEvent public static void registerSounds(final RegistryEvent.Register<SoundEvent> event) { LOGGER.info("Hello from Register Sound"); } } } Después de esto, ahora independientemente del número que pongas en la oportunidad de generar el mineral, se generará con los valores establecidos, pero todavía existe el error que ignora la altura máxima y mínima del mineral.
×
×
  • Create New...

Important Information

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