Jump to content

[Unsolved] [1.16.5] Java.lang.NullPointerExeption: Registry Object not present: lewdcraft:orangefoxgirl


Recommended Posts

Posted (edited)

My Entity refuses to launch and i am using geckolib. However no official tutorials or support are available for the 1.16.5 version. However my mod needs to be in 1.16.5 and uses it as a dependency. So with nothing to go on i decided to turn to the Forge Forums in hope of someone knowing even the slightest bit about how to fix my problem.


My Main Class:
 

package com.virtualfantasystudios.lewdcraft;

 

import org.apache.logging.log4j.LogManager;

import org.apache.logging.log4j.Logger;

 

import com.virtualfantasystudios.lewdcraft.core.init.ItemInit;

import com.virtualfantasystudios.lewdcraft.entity.EntityInit;

import com.virtualfantasystudios.lewdcraft.entity.client.girls.OrangeFoxGirlRenderer;

 

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.eventbus.api.IEventBus;

import net.minecraftforge.fml.client.registry.RenderingRegistry;

import net.minecraftforge.fml.common.Mod;

import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

import software.bernie.geckolib3.GeckoLib;

 

@Mod("lewdcraft")

public class Lewdcraft {

public static final Logger LOGGER = LogManager.getLogger();

public static final String MOD_ID = "lewdcraft";

 

public Lewdcraft() {

IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();

ItemInit.ITEMS.register(bus);

EntityInit.ENTITIES.register(bus);

GeckoLib.initialize();

RenderingRegistry.registerEntityRenderingHandler(EntityInit.ORANGEFOXGIRL.get(), OrangeFoxGirlRenderer::new);

MinecraftForge.EVENT_BUS.register(this);

}

}





My Entity Model Class:

 

package com.virtualfantasystudios.lewdcraft.entity.client.girls;

 

import com.virtualfantasystudios.lewdcraft.Lewdcraft;

import com.virtualfantasystudios.lewdcraft.entity.girls.OrangeFoxGirl;

import net.minecraft.util.ResourceLocation;

import software.bernie.geckolib3.model.AnimatedGeoModel;

 

public class OrangeFoxGirlModel extends AnimatedGeoModel<OrangeFoxGirl> {

@Override

public ResourceLocation getModelLocation(OrangeFoxGirl object) {

return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/geo/orangefoxgirl.geo.json");

}

 

@Override

public ResourceLocation getTextureLocation(OrangeFoxGirl object) {

return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/textures/orangefoxgirl.png");

}

@Override

public ResourceLocation getAnimationFileLocation(OrangeFoxGirl animatable) {

return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/animations/orangefoxgirl.animation.json");

}

}






My Entity Renderer Class:

 

package com.virtualfantasystudios.lewdcraft.entity.client.girls;

 

import com.mojang.blaze3d.matrix.MatrixStack;

import com.mojang.blaze3d.vertex.IVertexBuilder;

import com.virtualfantasystudios.lewdcraft.Lewdcraft;

import com.virtualfantasystudios.lewdcraft.entity.girls.OrangeFoxGirl;

 

import net.minecraft.client.renderer.IRenderTypeBuffer;

import net.minecraft.client.renderer.RenderType;

import net.minecraft.client.renderer.entity.EntityRendererManager;

import net.minecraft.util.ResourceLocation;

import software.bernie.geckolib3.renderers.geo.GeoEntityRenderer;

 

public class OrangeFoxGirlRenderer extends GeoEntityRenderer<OrangeFoxGirl>{

 

public OrangeFoxGirlRenderer(EntityRendererManager renderManager) {

super(renderManager, new OrangeFoxGirlModel());

this.shadowRadius = 0.3f;

}

@Override

public ResourceLocation getTextureLocation(OrangeFoxGirl instance) {

return new ResourceLocation(Lewdcraft.MOD_ID, "entity/girls/textures/orangefoxgirl.png");

}

@Override

public RenderType getRenderType(OrangeFoxGirl animatable, float partialTicks, MatrixStack stack,

IRenderTypeBuffer renderTypeBuffer,

IVertexBuilder vertexBuilder, int packedLightIn,

ResourceLocation textureLocation) {

stack.scale(0.8f, 0.8f, 0.8f);

return super.getRenderType(animatable, partialTicks, stack, renderTypeBuffer, vertexBuilder, packedLightIn,textureLocation);

}

}

 

 

 

 

My Entity Class:

 

package com.virtualfantasystudios.lewdcraft.entity.girls;

 

import net.minecraft.block.BlockState;

import net.minecraft.entity.EntityType;

import net.minecraft.entity.ai.attributes.AttributeModifierMap;

import net.minecraft.entity.ai.attributes.Attributes;

import net.minecraft.entity.monster.MonsterEntity;

import net.minecraft.util.DamageSource;

import net.minecraft.util.SoundEvent;

import net.minecraft.util.SoundEvents;

import net.minecraft.util.math.BlockPos;

import net.minecraft.world.World;

import software.bernie.geckolib3.core.IAnimatable;

import software.bernie.geckolib3.core.PlayState;

import software.bernie.geckolib3.core.builder.AnimationBuilder;

import software.bernie.geckolib3.core.controller.AnimationController;

import software.bernie.geckolib3.core.event.predicate.AnimationEvent;

import software.bernie.geckolib3.core.manager.AnimationData;

import software.bernie.geckolib3.core.manager.AnimationFactory;

 

public class OrangeFoxGirl extends MonsterEntity implements IAnimatable {

private AnimationFactory factory = new AnimationFactory(this);

 

public OrangeFoxGirl(EntityType<? extends MonsterEntity> entityType, World worldIn) {

super(entityType, worldIn);

}

 

public static AttributeModifierMap setAttributes() {

return MonsterEntity.createMobAttributes()

.add(Attributes.MAX_HEALTH, 20.0D)

.add(Attributes.ATTACK_DAMAGE, 3.0f)

.add(Attributes.ATTACK_SPEED, 1.0f)

.add(Attributes.MOVEMENT_SPEED, 0.4f).build();

}

 

private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) {

if (event.isMoving()) {

event.getController()

.setAnimation(new AnimationBuilder().addRepeatingAnimation("animation.redfoxgirl.walk", 0));

return PlayState.CONTINUE;

}

 

event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.redfoxgirl.idle"));

return PlayState.CONTINUE;

}

 

@Override

public void registerControllers(AnimationData data) {

data.addAnimationController(new AnimationController<IAnimatable>(this, "controller", 0, this::predicate));

}

 

@Override

public AnimationFactory getFactory() {

return factory;

}

protected void playStepSound(BlockPos pos, BlockState blockIn) {

this.playSound(SoundEvents.SWEET_BERRY_BUSH_PICK_BERRIES, 0.15F, 1.0F);

}

protected SoundEvent getAmbientSound() { return SoundEvents.CAT_STRAY_AMBIENT; }

protected SoundEvent getHurtSound(DamageSource damageSourceIn) { return SoundEvents.DOLPHIN_HURT; }

protected SoundEvent getDeathSound() { return SoundEvents.DOLPHIN_DEATH; }

protected float getSoundVolume() { return 0.2F; }

}

 

 

 

 

 

 

My Entity Init class:

 

package com.virtualfantasystudios.lewdcraft.entity;

 

import com.virtualfantasystudios.lewdcraft.Lewdcraft;

import com.virtualfantasystudios.lewdcraft.entity.girls.OrangeFoxGirl;

 

import net.minecraft.entity.EntityClassification;

import net.minecraft.entity.EntityType;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.eventbus.api.IEventBus;

import net.minecraftforge.fml.RegistryObject;

import net.minecraftforge.registries.DeferredRegister;

import net.minecraftforge.registries.ForgeRegistries;

 

public class EntityInit {

public static final DeferredRegister<EntityType<?>> ENTITIES =

DeferredRegister.create(ForgeRegistries.ENTITIES, Lewdcraft.MOD_ID);

//Girls

public static final RegistryObject<EntityType<OrangeFoxGirl>> ORANGEFOXGIRL =

ENTITIES.register("orangefoxgirl",

() -> EntityType.Builder.of(OrangeFoxGirl::new, EntityClassification.MISC)

.sized(8.5f, 1.5f)

.build(new ResourceLocation(Lewdcraft.MOD_ID, "orangefoxgirl").toString()));

//Boys

public static void register(IEventBus eventBus) {

ENTITIES.register(eventBus);

}

}

 

 

 

 

 

 

My Crash Report:

 

---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 11/26/23, 5:24 PM
Description: Mod loading error has occurred

java.lang.Exception: Mod Loading has failed
    at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:71) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:174) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:508) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.util.Util.ifElse(Util.java:320) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading}
    at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:504) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.ResourceLoadProgressGui.render(ResourceLoadProgressGui.java:113) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:481) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:977) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:38) ~[forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:94) [forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp.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:336) ~[?:?] {}
-- MOD lewdcraft --
Details:
    Mod File: main
    Failure message: LewdCraft (lewdcraft) has failed to load correctly
        java.lang.NullPointerException: Registry Object not present: lewdcraft:orangefoxgirl
    Mod Version: 0.5
    Mod Issue URL: NOT PROVIDED
    Exception message: java.lang.NullPointerException: Registry Object not present: lewdcraft:orangefoxgirl
Stacktrace:
    at java.util.Objects.requireNonNull(Objects.java:336) ~[?:?] {}
    at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:106) ~[forge:?] {re:classloading}
    at com.virtualfantasystudios.lewdcraft.Lewdcraft.<init>(Lewdcraft.java:33) ~[?:?] {re:classloading}
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {re:classloading,re:classloading}
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {re:classloading,re:classloading}
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {re:classloading,re:classloading}
    at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
    at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?] {}
    at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) ~[?:?] {re:classloading,re:classloading}
    at java.lang.Class.newInstance(Class.java:645) ~[?:?] {}
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:67) ~[forge:?] {re:classloading}
    at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:106) ~[forge:?] {re:classloading}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {}
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {}


-- System Details --
Details:
    Minecraft Version: 1.16.5
    Minecraft Version ID: 1.16.5
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 17.0.7, Eclipse Adoptium
    Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Eclipse Adoptium
    Memory: 1154366864 bytes (1100 MB) / 1556086784 bytes (1484 MB) up to 4282384384 bytes (4084 MB)
    CPUs: 16
    JVM Flags: 3 total; -XX:+IgnoreUnrecognizedVMOptions -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:+ShowCodeDetailsInExceptionMessages
    ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec
    ModLauncher launch target: fmluserdevclient
    ModLauncher naming: mcp
    ModLauncher services: 
        /mixin-0.8.4.jar mixin PLUGINSERVICE 
        /eventbus-4.0.0.jar eventbus PLUGINSERVICE 
        /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar object_holder_definalize PLUGINSERVICE 
        /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar runtime_enum_extender PLUGINSERVICE 
        /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar capability_inject_definalize PLUGINSERVICE 
        /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE 
        /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar runtimedistcleaner PLUGINSERVICE 
        /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE 
        /forge-1.16.5-36.2.39_mapped_official_1.16.5-launcher.jar fml TRANSFORMATIONSERVICE 
    FML: 36.2
    Forge: net.minecraftforge:36.2.39
    FML Language Providers: 
        [email protected]
        minecraft@1
    Mod List: 
        client-extra.jar                                  |Minecraft                     |minecraft                     |1.16.5              |CREATE_REG|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
        main                                              |LewdCraft                     |lewdcraft                     |0.5                 |ERROR     |Manifest: NOSIGNATURE
        forge-1.16.5-36.2.39_mapped_official_1.16.5-recomp|Forge                         |forge                         |36.2.39             |CREATE_REG|Manifest: NOSIGNATURE
        geckolib-forge-1.16.5-3.0.97_mapped_official_1.16.|GeckoLib                      |geckolib3                     |3.0.97              |CREATE_REG|Manifest: NOSIGNATURE
    Crash Report UUID: bebb0b82-351c-4d21-ba61-d986b5ba4e4b

Edited by Virtual Fantasy Studios
forgot to include the crash report
  • Virtual Fantasy Studios changed the title to [Unsolved] [1.16.5] Java.lang.NullPointerExeption: Registry Object not present: lewdcraft:orangefoxgirl

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

    • Hi,  I'm using Forge 47.3.0 for Minecraft 1.20.1 I apologise if this is obvious I am very new to modding for Minecraft. I sucessfully made a mod that launched without errors or crashes (without it doing anything) but in order to add the features I need, I need to add "Custom Portal API [Forge]" as a dependency. However no matter the way I've tried to acheive this, it crashes. I am pretty sure it's not the way I'm putting it in the repositories, the dependencies or the way I'm refrencing it, as I've a hundred diffrent combinations and multiple Maven methods. And on all those diffrent variations I still get this crash: pastebin.com/UhumzZCZ Any tips would be invaluable as I've been loosing my mind over this!
    • Hi, i'm really having problems trying to set the texture to my custom item. I thought i'm doing everything correctly, but all i see is the missing texture block for my item. I am trying this for over a week now and getting really frustrated. The only time i could make the texture work, was when i used an older Forge version (52.0.1) for Minecraft (1.21.4). Was there a fundamental change for textures and models somewhere between versions that i'm missing? I started with Forge 54.1.0 and had this problem, so in my frustration i tried many things: Upgrading to Forge 54.1.1, created multiple new projects, workspaces, redownloaded everything and setting things up multiple times, as it was suggested in an older thread. Therea are no errors in the console logs, but maybe i'm blind, so i pasted the console logs to pastebin anyway: https://pastebin.com/zAM8RiUN The only time i see an error is when i change the models JSON file to an incorrect JSON which makes sense and that suggests to me it is actually reading the JSON file.   I set the github repository to public, i would be so thankful if anyone could take a look and tell me what i did wrong: https://github.com/xLorkin/teleport_pug_forge   As a note: i'm pretty new to modding, this is my first mod ever. But i'm used to programming. I had some up and downs, but through reading the documentation, using google and experimenting, i could solve all other problems. I only started modding for Minecraft because my son is such a big fan and wanted this mod.
    • Please read the FAQ (link in orange bar at top of page), and post logs as described there.
    • Hello fellow Minecrafters! I recently returned to Minecraft and realized I needed a wiki that displays basic information easily and had great user navigation. That’s why I decided to build: MinecraftSearch — a site by a Minecraft fan, for Minecraft fans. Key Features So Far Straight-to-the-Point Info: No extra fluff; just the essentials on items, mobs, recipes, loot and more. Clean & Intuitive Layout: Easy navigation so you spend less time scrolling and more time playing. Optimized Search: Search for anything—items, mobs, blocks—and get results instantly. What I’m Thinking of Adding More data/information: Catch chances for fishing rod, traveling villager trades, biomes info and a lot more. The website is still under development and need a lot more data added. Community Contributions: Potential for user-uploaded tips for items/mobs/blocks in the future. Feature Requests Welcome: Your ideas could shape how the wiki evolves! You can see my roadmap at the About page https://minecraftsearch.com/about I’d love for you to check out MinecraftSearch and see if it helps you find the info you need faster. Feedback is crucial—I want to develop this further based on what the community needs most, so please let me know what you think. Thanks, and happy crafting!
  • Topics

×
×
  • Create New...

Important Information

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