Jump to content

Recommended Posts

Posted (edited)
public class ModEffects {
    private ModEffects() {
    }

    static void register() {
        Effects.register();
      	//at reasure.reasurecraft.init.ModEffects.register(ModEffects.java:23) ~[?:?] {re:classloading}
        Potions.register();
    }

    public static class Effects {
        public static final RegistryObject<Effect> EXPLOSIVE = register("explosive", ExplosiveEffect::new);

        private Effects() {
        }

        static void register() {
        }

        private static <T extends Effect> RegistryObject<T> register(String name, Supplier<T> effect) {
            return Registration.EFFECTS.register(name, effect);
        }
    }

    public static class Potions {
        //at reasure.reasurecraft.init.ModEffects$Potions.<clinit>(ModEffects.java:47) ~[?:?] {re:classloading}
        public static final RegistryObject<Potion> EXPLOSIVE = register("explosive", new EffectInstance(Effects.EXPLOSIVE.get(), 1200, 0));
        public static final RegistryObject<Potion> LONG_EXPLOSIVE = register("long_explosive", new EffectInstance(Effects.EXPLOSIVE.get(), 2400, 0));
        public static final RegistryObject<Potion> STRONG_EXPLOSIVE = register("strong_explosive", new EffectInstance(Effects.EXPLOSIVE.get(), 600, 2));


        private Potions() {
        }

        static void register() {
        }

        private static RegistryObject<Potion> register(String name, EffectInstance potion) {
            return Registration.POTIONS.register(name, () -> new Potion(potion));
        }
    }
}
[21:48:59] [modloading-worker-6/ERROR] [ne.mi.fm.ja.FMLModContainer/LOADING]: Failed to create mod instance. ModID: reasurecraft, class reasure.reasurecraft.ReasureCraft
java.lang.ExceptionInInitializerError: null
	at reasure.reasurecraft.init.ModEffects.register(ModEffects.java:23) ~[?:?] {re:classloading}
	at reasure.reasurecraft.init.Registration.register(Registration.java:47) ~[?:?] {re:classloading}
	at reasure.reasurecraft.ReasureCraft.<init>(ReasureCraft.java:32) ~[?:?] {re:classloading}
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_281] {}
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_281] {}
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_281] {}
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_281] {}
	at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_281] {}
	at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[forge:36.2] {re:classloading}
	at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:120) ~[forge:?] {re:classloading}
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) [?:1.8.0_281] {}
	at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) [?:1.8.0_281] {}
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_281] {}
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1067) [?:1.8.0_281] {}
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1703) [?:1.8.0_281] {}
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:172) [?:1.8.0_281] {}
Caused by: java.lang.NullPointerException: Registry Object not present: reasurecraft:explosive
	at java.util.Objects.requireNonNull(Objects.java:290) ~[?:1.8.0_281] {}
	at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[forge:?] {re:classloading}
	at reasure.reasurecraft.init.ModEffects$Potions.<clinit>(ModEffects.java:47) ~[?:?] {re:classloading}
	... 16 more
[21:48:59] [main/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:39)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: Caused by: java.lang.reflect.InvocationTargetException
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at java.lang.reflect.Method.invoke(Method.java:498)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at net.minecraftforge.userdev.FMLUserdevDataLaunchProvider.lambda$launchService$0(FMLUserdevDataLaunchProvider.java:51)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	... 5 more
[21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: Caused by: net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
	fml.modloading.failedtoloadmod
]
[21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:269)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:236)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:194)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.DatagenModLoader.begin(DatagenModLoader.java:60)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraft.data.Main.main(Main.java:45)
[21:48:59] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	... 11 more
Exception in thread "main" 
Process finished with exit code 1

It has error

Edited by reasure
Posted
public class ModEffects {
    public static final DeferredRegister<Effect> EFFECTS = DeferredRegister.create(ForgeRegistries.POTIONS, ReasureCraft.MOD_ID);
    public static final DeferredRegister<Potion> POTIONS = DeferredRegister.create(ForgeRegistries.POTION_TYPES, ReasureCraft.MOD_ID);

    public static final RegistryObject<Effect> EXPLOSIVE_EFFECT = EFFECTS.register("explosive", ExplosiveEffect::new);

    public static final RegistryObject<Potion> EXPLOSIVE_POTION = register("explosive", new EffectInstance(EXPLOSIVE_EFFECT.get(), 1200, 0));
    public static final RegistryObject<Potion> LONG_EXPLOSIVE_POTION = register("long_explosive", new EffectInstance(EXPLOSIVE_EFFECT.get(), 2400, 0));
    public static final RegistryObject<Potion> STRONG_EXPLOSIVEPOTION = register("strong_explosive", new EffectInstance(EXPLOSIVE_EFFECT.get(), 600, 2));

    private static RegistryObject<Potion> register(String name, EffectInstance potion) {
        return POTIONS.register(name, () -> new Potion(potion));
    }
}

It has same error

Posted
public static final RegistryObject<Potion> EXPLOSIVE_POTION = POTIONS.register("explosive", () ->
            new Potion(new EffectInstance(EXPLOSIVE_EFFECT.get(), 1200, 0)));
    public static final RegistryObject<Potion> LONG_EXPLOSIVE_POTION = POTIONS.register("long_explosive", () ->
            new Potion(new EffectInstance(EXPLOSIVE_EFFECT.get(), 2400, 0)));
    public static final RegistryObject<Potion> STRONG_EXPLOSIVEPOTION = POTIONS.register("strong_explosive", () ->
            new Potion(new EffectInstance(EXPLOSIVE_EFFECT.get(), 600, 2)));

It worked! Thank you!

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I played my crazy craft server with friends for about a day and a half, but all of a sudden it crashed, and now it won't work, and these are the config files that are giving me problems in the server, and it keeps crashing. Can't join the server anymore or even load without it crashing. Does anybody know how I can fix this??   config codes: java.lang.NullPointerException: null at net.minecraftforge.eventbus.EventSubclassTransformer.buildEvents(EventSubclassTransformer.java:62) ~[eventbus-4.0.0.jar:?] at net.minecraftforge.eventbus.EventSubclassTransformer.transform(EventSubclassTransformer.java:44) [eventbus-4.0.0.jar:?] at net.minecraftforge.eventbus.EventBusEngine.processClass(EventBusEngine.java:21) [eventbus-4.0.0.jar:?] at net.minecraftforge.eventbus.service.ModLauncherService.processClassWithFlags(ModLauncherService.java:20) [eventbus-4.0.0.jar:4.0.0+65+master.6080a3f] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:85) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:265) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136) [modlauncher-8.1.3.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) [modlauncher-8.1.3.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) [?:1.8.0_312] at net.minecraftforge.fml.client.gui.screen.ModListScreen.<init>(ModListScreen.java:98) [forge:?] It is also version 1.16.5 and I have tried redownloading the modpack.
    • yea, theres no crash report for this one, that one was te old one  
    • is it the issue? like, isnt it in a conflict with other mods? because the modpack's whole point is the Big Globe mod
    • wait, so i sent the wrong one, i changed it to a forge modpack, something is off...
    • So, I did that. That partialy worked, but the second part of the problem was that several mods versions were not compatible( So for now I used older version and it works. Thanks!  
  • Topics

×
×
  • Create New...

Important Information

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