Jump to content

[1.15.2] Entity crashing on summon (Unexpected error, NullPointerException)


SSilvamc

Recommended Posts

Crash report:

Quote

---- Minecraft Crash Report ----
// Don't do that.

Time: 2020-04-06 01:04
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
    at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:233) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:947) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:434) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:962) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:559) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:177) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_241] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_241] {}
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_241] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.0.0-milestone.4.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.0.0-milestone.4.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.0.0-milestone.4.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.0.0-milestone.4.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.0.0-milestone.4.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar:?] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
    at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:233)
    at net.minecraft.client.renderer.WorldRenderer.updateCameraAndRender(WorldRenderer.java:947)
    at net.minecraft.client.renderer.GameRenderer.renderWorld(GameRenderer.java:612)

-- Affected level --
Details:
    All players: 1 total; [ClientPlayerEntity['Dev'/67, l='MpServer', x=-134.50, y=4.00, z=-225.50]]
    Chunk stats: Client Chunk Cache: 225, 121
    Level dimension: DimensionType{minecraft:overworld}
    Level name: MpServer
    Level seed: -3096497290199905442
    Level generator: ID 01 - flat, ver 0. Features enabled: false
    Level generator options: {}
    Level spawn location: World: (-144,4,-224), Chunk: (at 0,0,0 in -9,-14; contains blocks -144,0,-224 to -129,255,-209), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
    Level time: 346 game time, 346 day time
    Known server brands: 
    Level was modded: false
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    Server brand: forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.world.ClientWorld.fillCrashReport(ClientWorld.java:457)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:1840)
    at net.minecraft.client.Minecraft.run(Minecraft.java:578)
    at net.minecraft.client.main.Main.main(Main.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55)
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:81)
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65)
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102)

-- System Details --
Details:
    Minecraft Version: 1.15.2
    Minecraft Version ID: 1.15.2
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_241, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 331055912 bytes (315 MB) / 1846018048 bytes (1760 MB) up to 3817865216 bytes (3641 MB)
    CPUs: 2
    JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx4096m
    ModLauncher: 5.0.0-milestone.4+67+b1a340b
    ModLauncher launch target: fmluserdevclient
    ModLauncher naming: mcp
    ModLauncher services: 
        /eventbus-2.0.0-milestone.1-service.jar eventbus PLUGINSERVICE 
        /forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-launcher.jar object_holder_definalize PLUGINSERVICE 
        /forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-launcher.jar runtime_enum_extender PLUGINSERVICE 
        /accesstransformers-2.0.0-milestone.1-shadowed.jar accesstransformer PLUGINSERVICE 
        /forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-launcher.jar capability_inject_definalize PLUGINSERVICE 
        /forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-launcher.jar runtimedistcleaner PLUGINSERVICE 
        /forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-launcher.jar fml TRANSFORMATIONSERVICE 
    FML: 31.1
    Forge: net.minecraftforge:31.1.0
    FML Language Providers: 
        [email protected]
        minecraft@1
    Mod List: 
        client-extra.jar Minecraft {[email protected] DONE}
        forge-1.15.2-31.1.0_mapped_snapshot_20200317-1.15.1-recomp.jar Forge {[email protected] DONE}
        main Empires {[email protected] DONE}
    Launched Version: MOD_DEV
    Backend library: LWJGL version 3.2.2 build 10
    Backend API: Intel(R) HD Graphics GL version 3.1.0 - Build 9.17.10.4229, Intel
    GL Caps: Using framebuffer using OpenGL 3.0
    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'forge'
    Type: Client (map_client.txt)
    Resource Packs: vanilla, mod_resources
    Current Language: English (US)
    CPU: 2x Intel(R) Pentium(R) CPU B970 @ 2.30GHz

Entity model:

Quote

package tatin.empires.client.renderer.entity.model;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;

import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.model.ModelRenderer;
import tatin.empires.entity.ElephantEntity;


public class ElephantEntityModel<T extends ElephantEntity> extends EntityModel<T> {
	private final ModelRenderer body;
	private final ModelRenderer legs;
	private final ModelRenderer front;
	private final ModelRenderer frontLegRight;
	private final ModelRenderer frontLegLeft;
	private final ModelRenderer back;
	private final ModelRenderer backLegLeft;
	private final ModelRenderer backLegRight;
	private final ModelRenderer head;
	private final ModelRenderer tusks;
	private final ModelRenderer tuskRight;
	private final ModelRenderer tuskLeft;
	private final ModelRenderer ears;
	private final ModelRenderer earLeft;
	private final ModelRenderer earRight;
	private final ModelRenderer trunk;
	private final ModelRenderer trunk1;
	private final ModelRenderer trunk2;
	private final ModelRenderer trunk3;
	private final ModelRenderer trunk4;
	private final ModelRenderer trunk5;
	private final ModelRenderer trunk6;
	private final ModelRenderer jaw;
	private final ModelRenderer headMain;
	private final ModelRenderer bodyMain;

	public ElephantEntityModel() {
		textureWidth = 256;
		textureHeight = 256;

		body = new ModelRenderer(this);
		body.setRotationPoint(-8.0F, 16.0F, 8.0F);

		legs = new ModelRenderer(this);
		legs.setRotationPoint(-1.0F, -22.0F, -35.0F);
		body.addChild(legs);

		front = new ModelRenderer(this);
		front.setRotationPoint(0.0F, 0.0F, 0.0F);
		legs.addChild(front);

		frontLegRight = new ModelRenderer(this);
		frontLegRight.setRotationPoint(0.0F, -4.0F, 54.0F);
		front.addChild(frontLegRight);
		frontLegRight.setTextureOffset(108, 108).addBox(-10.0F, -2.0F, -6.0F, 12, 36, 12, 0.0F, false);

		frontLegLeft = new ModelRenderer(this);
		frontLegLeft.setRotationPoint(26.0F, -4.0F, 54.0F);
		front.addChild(frontLegLeft);
		frontLegLeft.setTextureOffset(0, 0).addBox(-10.0F, -2.0F, -6.0F, 12, 36, 12, 0.0F, false);

		back = new ModelRenderer(this);
		back.setRotationPoint(0.0F, 0.0F, 0.0F);
		legs.addChild(back);

		backLegLeft = new ModelRenderer(this);
		backLegLeft.setRotationPoint(26.0F, 0.0F, 0.0F);
		back.addChild(backLegLeft);
		backLegLeft.setTextureOffset(156, 108).addBox(-10.0F, -2.0F, -6.0F, 12, 32, 12, 0.0F, false);

		backLegRight = new ModelRenderer(this);
		backLegRight.setRotationPoint(0.0F, 0.0F, 0.0F);
		back.addChild(backLegRight);
		backLegRight.setTextureOffset(96, 156).addBox(-10.0F, -2.0F, -6.0F, 12, 32, 12, 0.0F, false);

		head = new ModelRenderer(this);
		head.setRotationPoint(12.0F, -42.0F, 17.0F);
		body.addChild(head);

		tusks = new ModelRenderer(this);
		tusks.setRotationPoint(0.0F, 0.0F, 0.0F);
		setRotationAngle(tusks, -0.3491F, 0.0F, 0.0F);
		head.addChild(tusks);

		tuskRight = new ModelRenderer(this);
		tuskRight.setRotationPoint(0.0F, 0.0F, 0.0F);
		tusks.addChild(tuskRight);
		tuskRight.setTextureOffset(44, 162).addBox(2.0F, -10.0F, 18.0F, 4, 4, 16, 0.0F, false);

		tuskLeft = new ModelRenderer(this);
		tuskLeft.setRotationPoint(0.0F, 0.0F, 0.0F);
		tusks.addChild(tuskLeft);
		tuskLeft.setTextureOffset(144, 39).addBox(-14.0F, -10.0F, 18.0F, 4, 4, 16, 0.0F, false);

		ears = new ModelRenderer(this);
		ears.setRotationPoint(0.0F, 0.0F, 0.0F);
		head.addChild(ears);

		earLeft = new ModelRenderer(this);
		earLeft.setRotationPoint(1.0F, -26.0F, 11.0F);
		setRotationAngle(earLeft, 0.1745F, 0.2618F, -0.0873F);
		ears.addChild(earLeft);
		earLeft.setTextureOffset(153, 153).addBox(1.0F, 0.0F, 0.0F, 24, 36, 3, 0.0F, false);

		earRight = new ModelRenderer(this);
		earRight.setRotationPoint(-9.0F, -26.0F, 11.0F);
		setRotationAngle(earRight, 0.1745F, -0.2618F, 0.0873F);
		ears.addChild(earRight);
		earRight.setTextureOffset(144, 0).addBox(-25.0F, 0.0F, 0.0F, 24, 36, 3, 0.0F, false);

		trunk = new ModelRenderer(this);
		trunk.setRotationPoint(0.0F, 0.0F, 4.0F);
		head.addChild(trunk);

		trunk1 = new ModelRenderer(this);
		trunk1.setRotationPoint(0.0F, 0.0F, 13.0F);
		trunk.addChild(trunk1);
		trunk1.setTextureOffset(0, 162).addBox(-10.0F, -15.0F, 3.0F, 12, 16, 10, 0.0F, false);

		trunk2 = new ModelRenderer(this);
		trunk2.setRotationPoint(0.0F, -2.0F, 5.0F);
		trunk1.addChild(trunk2);
		trunk2.setTextureOffset(36, 182).addBox(-8.0F, 1.0F, 1.0F, 8, 14, 8, 0.0F, false);

		trunk3 = new ModelRenderer(this);
		trunk3.setRotationPoint(0.0F, 15.0F, 2.0F);
		trunk2.addChild(trunk3);
		trunk3.setTextureOffset(0, 108).addBox(-7.0F, 0.0F, 1.0F, 6, 8, 6, 0.0F, false);

		trunk4 = new ModelRenderer(this);
		trunk4.setRotationPoint(0.0F, 8.0F, 4.0F);
		trunk3.addChild(trunk4);
		trunk4.setTextureOffset(36, 0).addBox(-6.0F, 0.0F, -1.0F, 4, 6, 4, 0.0F, false);

		trunk5 = new ModelRenderer(this);
		trunk5.setRotationPoint(0.0F, 5.0F, 2.0F);
		trunk4.addChild(trunk5);
		trunk5.setTextureOffset(48, 6).addBox(-6.0F, 0.0F, -3.0F, 4, 5, 4, 0.0F, false);

		trunk6 = new ModelRenderer(this);
		trunk6.setRotationPoint(0.0F, 5.0F, 0.0F);
		trunk5.addChild(trunk6);
		trunk6.setTextureOffset(44, 44).addBox(-6.0F, 0.0F, -3.0F, 4, 5, 4, 0.0F, false);

		jaw = new ModelRenderer(this);
		jaw.setRotationPoint(0.0F, 0.0F, 7.0F);
		head.addChild(jaw);
		jaw.setTextureOffset(0, 48).addBox(-10.0F, 1.0F, 0.0F, 12, 3, 12, 0.0F, false);

		headMain = new ModelRenderer(this);
		headMain.setRotationPoint(0.0F, 0.0F, 0.0F);
		head.addChild(headMain);
		headMain.setTextureOffset(0, 108).addBox(-16.0F, -23.0F, -8.0F, 24, 24, 30, 0.0F, false);

		bodyMain = new ModelRenderer(this);
		bodyMain.setRotationPoint(0.0F, 0.0F, 0.0F);
		body.addChild(bodyMain);
		bodyMain.setTextureOffset(0, 0).addBox(-12.0F, -62.0F, -40.0F, 40, 44, 64, 0.0F, false);
	}

	@Override
	public void render(MatrixStack matrixStackIn, IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn,
			float red, float green, float blue, float alpha) {
		body.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha);
	}
	
	public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
		modelRenderer.rotateAngleX = x;
		modelRenderer.rotateAngleY = y;
		modelRenderer.rotateAngleZ = z;
	}
	
	@Override
	public void setRotationAngles(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks,
			float netHeadYaw, float headPitch) {
		
	}
	@Override
	public void setLivingAnimations(T entityIn, float limbSwing, float limbSwingAmount, float partialTick) {
		super.setLivingAnimations(entityIn, limbSwing, limbSwingAmount, partialTick);
		
	}
	
	

}

 

Entity renderer:

Quote

package tatin.empires.client.renderer.entity;

import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.util.ResourceLocation;
import tatin.empires.EmpiresMain;
import tatin.empires.client.renderer.entity.model.ElephantEntityModel;
import tatin.empires.entity.ElephantEntity;

public class ElephantEntityRenderer extends MobRenderer<ElephantEntity, ElephantEntityModel<ElephantEntity>>{

	protected static final ResourceLocation TEXTURE = new ResourceLocation(EmpiresMain.MOD_ID, "textures/entity/elephant.png");
	
	public ElephantEntityRenderer(EntityRendererManager renderManagerIn) {
		super(renderManagerIn, new ElephantEntityModel<ElephantEntity>(), 2.5F);
	}

	@Override
	public ResourceLocation getEntityTexture(ElephantEntity entity) {
		return TEXTURE;
	}
	
}

 

Main class:

Quote

package tatin.empires;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import tatin.empires.init.EmpiresBlocks;
import tatin.empires.init.EmpiresEntities;
import tatin.empires.init.EmpiresItems;
import tatin.empires.init.EmpiresSetup;

@Mod(EmpiresMain.MOD_ID)
public class EmpiresMain {

	public static final String MOD_ID = "empires";
	public static IEventBus MOD_EVENT_BUS;
	
	@SuppressWarnings("unused")
	private static final Logger logger = LogManager.getLogger(MOD_ID);
	
	public EmpiresMain () {
		MOD_EVENT_BUS = FMLJavaModLoadingContext.get().getModEventBus();
		MinecraftForge.EVENT_BUS.register(EmpiresSetup.class);
		
		EmpiresItems.ITEMS.register(MOD_EVENT_BUS);
		EmpiresBlocks.BLOCKS.register(MOD_EVENT_BUS);
		EmpiresEntities.ENTITIES.register(MOD_EVENT_BUS);
		
	}
	
}

 

Entity registry:

Quote

package tatin.empires.init;

import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import tatin.empires.EmpiresMain;
import tatin.empires.entity.ElephantEntity;

public class EmpiresEntities {
	
	public static final DeferredRegister<EntityType<?>> ENTITIES = new DeferredRegister<>(ForgeRegistries.ENTITIES, EmpiresMain.MOD_ID);

	public static final RegistryObject<EntityType<ElephantEntity>> ELEPHANT = ENTITIES.register("elephant",	() -> EntityType.Builder.<ElephantEntity>create(ElephantEntity::new, EntityClassification.CREATURE).size(3f, 4.5f).build(new ResourceLocation(EmpiresMain.MOD_ID, "elephant").toString()));

}

Setup class:

Quote

package tatin.empires.init;

import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import tatin.empires.client.renderer.entity.ElephantEntityRenderer;

@Mod.EventBusSubscriber
public class EmpiresSetup {
	
	@SubscribeEvent
	public static void setupCommon(final FMLCommonSetupEvent event) {}

	@SubscribeEvent
	public static void setupClient(final FMLClientSetupEvent event) {
		RenderingRegistry.registerEntityRenderingHandler(EmpiresEntities.ELEPHANT.get(), ElephantEntityRenderer::new);
	}

}

 

 

Link to comment
Share on other sites

22 minutes ago, SSilvamc said:

@SubscribeEvent public static void setupClient(final FMLClientSetupEvent event) { RenderingRegistry.registerEntityRenderingHandler(EmpiresEntities.ELEPHANT.get(), ElephantEntityRenderer::new); }

Does this get called?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Just now, Animefan8888 said:

Does this get called?

That was the problem, thanks! I thought registering the EmpiresSetup class with the @SubscribeEvent functions would suffice, but apparently not. Added this to the main class constructor fixed it:

	MOD_EVENT_BUS.addListener(EmpiresSetup::setupCommon);
	MOD_EVENT_BUS.addListener(EmpiresSetup::setupClient);

 

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
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



×
×
  • Create New...

Important Information

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