Jump to content

Recommended Posts

Posted (edited)

Whenever I try to start the server (client works fine), it crashes during the preInit phase of my mod. First, I thought I might've messed the proxies up, but nothing client-sided should be called server-side there. I have no idea why net/minecraft/client/renderer/entity/Render is being loaded serverside.

 

Crash log:

Spoiler

---- Minecraft Crash Report ----
// Would you like a cupcake?

Time: 30.05.17 18:08
Description: Exception in server tick loop

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from PotterMod (pottermod)
Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render
	at mennomax.pottermod.PotterMod.preInit(PotterMod.java:38)
	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.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:643)
	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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:246)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:224)
	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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147)
	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:647)
	at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:100)
	at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:331)
	at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:508)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.entity.Render
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 33 more
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@ca27722 from coremod FMLCorePlugin
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:257)
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)
	... 35 more
Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/entity/Render for invalid side SERVER
	at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62)
	at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:253)
	... 37 more


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

-- System Details --
Details:
	Minecraft Version: 1.11.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 847380712 bytes (808 MB) / 950009856 bytes (906 MB) up to 2856321024 bytes (2724 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.38 Powered by Forge 13.20.0.2262 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCH	minecraft{1.11.2} [Minecraft] (minecraft.jar) 
	UCH	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCH	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11.2-13.20.0.2262.jar) 
	UCH	forge{13.20.0.2262} [Minecraft Forge] (forgeSrc-1.11.2-13.20.0.2262.jar) 
	UCE	pottermod{0.1.1} [PotterMod] (bin) 
	Loaded coremods (and transformers): 
	Profiler Position: N/A (disabled)
	Is Modded: Definitely; Server brand changed to 'fml,forge'
	Type: Dedicated Server (map_server.txt)

    "at mennomax.pottermod.PotterMod.preInit(PotterMod.java:38)" = PotterEntities.init();

 

Here are classes that might be relevant;

 

  • PotterMod.class (main mod class);
Spoiler

package mennomax.pottermod;

import mennomax.pottermod.handler.PotterEventHandler;
import mennomax.pottermod.handler.PotterPacketHandler;
import mennomax.pottermod.init.PotterEntities;
import mennomax.pottermod.init.PotterItems;
import mennomax.pottermod.proxy.CommonProxy;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = PotterMod.MODID, name = PotterMod.NAME, version = PotterMod.VERSION, acceptedMinecraftVersions = PotterMod.ACCEPTEDVERSIONS)

public class PotterMod {

	@Instance
	public static PotterMod instance;
	
	@SidedProxy(clientSide = PotterMod.CLIENTPROXY, serverSide = PotterMod.SERVERPROXY)
	
	public static CommonProxy proxy;
	public static final String MODID = "pottermod";
	public static final String NAME = "PotterMod";
	public static final String VERSION = "0.1.1";
	public static final String ACCEPTEDVERSIONS = "1.11.2";
	public static final String CLIENTPROXY = "mennomax.pottermod.proxy.ClientProxy";
	public static final String SERVERPROXY = "mennomax.pottermod.proxy.ServerProxy";
	
	@EventHandler
	public void preInit(FMLPreInitializationEvent event)
	{
		PotterItems.init();
		PotterEntities.init();
		PotterPacketHandler.init();
		proxy.preInit();
	}
	
	@EventHandler
    public void init(FMLInitializationEvent event)
    {
		proxy.init();
		MinecraftForge.EVENT_BUS.register(new PotterEventHandler());
    }
	
	@EventHandler
	public void postInit(FMLPostInitializationEvent event)
	{
		proxy.postInit();
	}
}

 

  • PotterEntities.class;
Spoiler

package mennomax.pottermod.init;

import mennomax.pottermod.PotterMod;
import mennomax.pottermod.client.render.entity.RenderTestbroom;
import mennomax.pottermod.entity.EntityTestbroom;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public class PotterEntities
{
	
	public static void init()
	{
		int pottermodentityid = 0;
		EntityRegistry.registerModEntity(new ResourceLocation(PotterMod.MODID + ":textures/entity/brooms/entitytestbroom.png"), EntityTestbroom.class, "entitytestbroom", ++pottermodentityid, PotterMod.instance, 256, 10, true);
	}
	
	public static void registerRenders()
	{
		RenderingRegistry.registerEntityRenderingHandler(EntityTestbroom.class, new RenderTestbroom(Minecraft.getMinecraft().getRenderManager()));
	}

}

 

  • ModelTestbroom.class;
Spoiler

package mennomax.pottermod.client.model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class ModelTestbroom extends ModelBase
{
	private ModelRenderer stick;
	private ModelRenderer brush;
	
	public ModelTestbroom()
	{
		this.stick = new ModelRenderer(this);
		this.stick.addBox(-1F, -2F, -30F, 2, 2, 39);
		this.stick.setTextureSize(16, 16);
		
		this.brush = new ModelRenderer(this);
		this.brush.addBox(-3F, -4F, 9F, 6, 6, 13);
		this.brush.setTextureSize(16, 16);
		
		this.stick.addChild(brush);
	}
	
	@Override
	public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
    {
		this.setRotationAngles(0F, 0F, 0F, 0F, 0F, 0F, entityIn);
		this.stick.render(scale);
    }
}

 

  • RenderTestbroom.class
Spoiler

package mennomax.pottermod.client.render.entity;

import mennomax.pottermod.PotterMod;
import mennomax.pottermod.client.model.ModelTestbroom;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.ResourceLocation;

public class RenderTestbroom extends RenderLiving
{
	public static final ResourceLocation TEXTURE = new ResourceLocation(PotterMod.MODID + ":textures/entity/brooms/entitytestbroom.png");
	private static ModelTestbroom model = new ModelTestbroom();
	
	public RenderTestbroom(RenderManager rendermanagerIn)
	{
		super(rendermanagerIn, model, 0.3F);
		this.bindTexture(TEXTURE);
	}
	
	@Override
	public void doRender(EntityLiving entity, double x, double y, double z, float yaw, float partialTick)
	{
		super.doRender(entity, x, y, z, yaw, partialTick);
	}

	@Override
	protected ResourceLocation getEntityTexture(Entity entity) {
		return TEXTURE;
	}

}

 

Proxies;

Spoiler

ClientProxy.class;


package mennomax.pottermod.proxy;

import mennomax.pottermod.handler.PotterEventHandler;
import mennomax.pottermod.init.PotterEntities;
import mennomax.pottermod.init.PotterItems;
import net.minecraftforge.common.MinecraftForge;

public class ClientProxy implements CommonProxy
{

	@Override
	public void preInit()
	{
		
	}

	@Override
	public void init()
	{
		PotterItems.registerRenders();
		PotterEntities.registerRenders();
	}

	@Override
	public void postInit()
	{
		
	}
	
}

 

ServerProxy.class only contains empty methods implemented from the CommonProxy interface.

 

Basically, this mod currently only adds a flyable broom to the game that is steerable and locked to the players UUID once placed (so nobody else can ride it). If you need any other classes just tell me, I appreciate any help of you I can get. It's probably just some small thing causing this error and I just can't find it.

 

I am currently using forge 1.11.2-13.20.0.2262, but already tried using the latest build. (same error there)

Edited by MennoMax
Posted

Post the EntityTestbroom class, the issue may be there.

 

It's best to keep client-only code like model registration in dedicated client-only classes to help avoid issues like this, though PotterEntities.registerRenders probably isn't the cause of the issue.

 

Side note: RenderingRegistry#registerEntityRenderingHandler(Class<? Entity>, Render<? extends Entity>) is deprecated, call RenderingRegistry#registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit instead.

  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.