Jump to content

[1.7.10] How can I make my mod server compatible?


DaNatin

Recommended Posts

After I've setup  forge server and loaded my mod into it, it contained a crash report like this:

Exception in server tick loop

cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:692)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:97)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:318)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:210)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
Caused by: java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
at net.minecraftforge.client.MinecraftForgeClient.getStencilBits(MinecraftForgeClient.java:51)
at net.minecraftforge.client.MinecraftForgeClient.<clinit>(MinecraftForgeClient.java:55)
at com.natin.tf2mod.client.TF2Mod.init(TF2Mod.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:104)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 35 more

 

It mentions my mod in a line, and also states that there was an exception in the server tick.

 

So how do I make my mod server compatible?

Link to comment
Share on other sites

Mkay, Here is the main file:

 

package com.natin.tf2mod.client;

import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;

import com.natin.tf2mod.common.TF2ModCommonProxy;
import com.natin.tf2mod.items.guns.Rocket;
import com.natin.tf2mod.items.guns.RocketLauncher;
import com.natin.tf2mod.render.RenderRocketLauncher;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = TF2Mod.MODID, version = TF2Mod.VERSION)
public class TF2Mod
{							        
@SidedProxy(clientSide="com.natin.tf2mod.client.TF2ClientProxy", serverSide="com.natin.tf2mod.common.TF2ModCommonProxy")
public static TF2ModCommonProxy proxy;
public static final String MODID = "tf2mod";
    public static final String VERSION = "v0.4";

    /**Items**/
    public static Item RocketLauncher;
    public static Item Rocket;
  
   
    
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    	
    	
    	proxy.registerRenderThings();
    			
    	RocketLauncher = new RocketLauncher().setUnlocalizedName("RocketLauncher");
	MinecraftForgeClient.registerItemRenderer(TF2Mod.RocketLauncher, new RenderRocketLauncher());
	GameRegistry.registerItem(RocketLauncher, "RocketLauncher");
	GameRegistry.addRecipe(new ItemStack(RocketLauncher), new Object[]
			{

				"GRT", 
				"  S", 
				'T', Items.iron_ingot , 'G', Items.gunpowder, 'R', Items.redstone, 'S', Items.stick
			});

	Rocket = new Rocket().setUnlocalizedName("Rocket");
	GameRegistry.registerItem(Rocket, "Rocket");
	GameRegistry.addRecipe(new ItemStack(Rocket), new Object[]
			{

				"SGS", 
				'S', Items.iron_ingot, 'G', Items.gunpowder
			});



	    	
    }
    
   
    /**
    public static DamageSource causeMagnumDamage(EntityNormalBullet bullet, Entity par1Entity)
    {
        return par1Entity == null ? (new EntityDamageSourceIndirect("onFire", bullet, bullet)).setProjectile() : (new EntityDamageSourceIndirect("fireball", bullet, par1Entity)).setProjectile();
    }
    **/
}

 

The crash report really only mentions the main file, but if you need more just ask.

Link to comment
Share on other sites

I don't know what line 44 is, but I'm guessing it's

 

MinecraftForgeClient.registerItemRenderer(TF2Mod.RocketLauncher, new RenderRocketLauncher());

 

Try putting that code in your client proxy.

BEFORE ASKING FOR HELP READ THE EAQ!

 

I'll help if I can. Apologies if I do something obviously stupid. :D

 

If you don't know basic Java yet, go and follow these tutorials.

Link to comment
Share on other sites

Client Proxy

package com.natin.tf2mod.client;

import net.minecraftforge.client.MinecraftForgeClient;

import com.natin.tf2mod.common.TF2ModCommonProxy;
import com.natin.tf2mod.render.RenderRocketLauncher;

public class TF2ClientProxy extends TF2ModCommonProxy
{

 @Override
     public void registerRenderThings() 
 {
             // This is for rendering entities and so forth later on


 }

 @Override
 public void registerItemRenderer()
 {
	 MinecraftForgeClient.registerItemRenderer(TF2Mod.RocketLauncher, new RenderRocketLauncher());

 }



}

 

Common Proxy

package com.natin.tf2mod.common;

public class TF2ModCommonProxy 
{


    public void registerRenderThings() 
    {
            // Nothing here as the server doesn't render graphics or entities!
    }

    


public void registerItemRenderer() {


}

}

 

Link to comment
Share on other sites

I've made this in the Client Proxy

 @Override
 public void registerItemRenderer()
 {
	 MinecraftForgeClient.registerItemRenderer(TF2Mod.RocketLauncher, new RenderRocketLauncher());
	 System.out.println("[TF2 Mod]TF2 Items Rendered!");
 }

 

The message I applied showed up in the console, some how the render code isn't working :/

Link to comment
Share on other sites

RenderRocketLauncher

package com.natin.tf2mod.render;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;

import org.lwjgl.opengl.GL11;

import com.natin.tf2mod.models.RocketLauncherModel;


public class RenderRocketLauncher implements IItemRenderer 
{
//public static final ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png");

protected RocketLauncherModel rocketlaunchermodel;



public RenderRocketLauncher()
{
	rocketlaunchermodel = new RocketLauncherModel();
}

// protected ResourceLocation func_110832_a(RocketLauncherModel par1EntitySpiderQueen)
    //{
  //      return Texture;
    //}

   
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) 
{
	switch(type)
	{
	case EQUIPPED_FIRST_PERSON: return true;
	case EQUIPPED: return true;
	default: return false;
	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) 
{
	return false;
}

  public EnumAction EQUIPPED(ItemStack par1ItemStack)
    {
        return EnumAction.bow;
    }

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) 
{
	switch(type)
	{
	case EQUIPPED:
	{

		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png"));			//ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png");

		boolean isFirstPerson = false;

	if(data[1] != null && data[1] instanceof EntityPlayer)	
	{
		if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 1 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)))			
		{
			isFirstPerson = false;
			GL11.glTranslatef(0.4F, 0.5F, 0.08F); //position
			GL11.glRotatef(-26F, 1.0F, 0.0F, 0.0F);	//X
			GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y
			GL11.glRotatef(140F, 1.0F, 0.0F, 1.0F);   //z
			//Size
			rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F);


		}

	}	
	 GL11.glPopMatrix();

	}
	   




	case EQUIPPED_FIRST_PERSON:
	{
		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png"));			//ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png");

		boolean isFirstPerson = true;

	if(data[1] != null && data[1] instanceof EntityPlayer)	
	{

			if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 0.0F)))			

			isFirstPerson = true;
			GL11.glTranslatef(0.5F, 0.8F, 0.1F); //position
			GL11.glRotatef(-10F, 1.0F, 0.0F, 0.0F);	//X
			GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y
			GL11.glRotatef(160F, 1.0F, 0.0F, 1.0F);   //z
			//Size
			rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F);

	}	

	}	
	GL11.glPopMatrix();

	default: break;
	}


}
}

Link to comment
Share on other sites

I found the problem:

renderItem's message was never mentioned in the console

Meaning this whole chunk of code is being ignored for some reason

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) 
{
	switch(type)
	{

	case EQUIPPED_FIRST_PERSON:
	{
		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png"));			//ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png");

		boolean isFirstPerson = true;

	if(data[1] != null && data[1] instanceof EntityPlayer)	
	{

			if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 0.0F)))			

			isFirstPerson = true;
			GL11.glTranslatef(0.5F, 0.8F, 0.1F); //position
			GL11.glRotatef(-10F, 1.0F, 0.0F, 0.0F);	//X
			GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y
			GL11.glRotatef(160F, 1.0F, 0.0F, 1.0F);   //z
			//Size
			rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F);

	}	

	}	
	GL11.glPopMatrix();

	default: break;

	case EQUIPPED:
	{

		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("tf2mod", "textures/models/RocketLauncher.png"));			//ResourceLocation Texture = new ResourceLocation(BattleOfTheBeastsMod.modid, "/textures/entity/RocketLauncher.png");

		boolean isFirstPerson = false;

	if(data[1] != null && data[1] instanceof EntityPlayer)	
	{
		if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 1 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F || RenderManager.instance.playerViewY == 0.0F)))			
		{
			isFirstPerson = false;
			GL11.glTranslatef(0.4F, 0.5F, 0.08F); //position
			GL11.glRotatef(-26F, 1.0F, 0.0F, 0.0F);	//X
			GL11.glRotatef(165F, 0.0F, 1.0F, 0.0F); //y
			GL11.glRotatef(140F, 1.0F, 0.0F, 1.0F);   //z
			//Size
			rocketlaunchermodel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.07F);


		}

	}	
	 GL11.glPopMatrix();

	}

	System.out.println("Item renderer loaded!");
	}

Link to comment
Share on other sites

You really should try clean your code and use correct indentation, because it helps you to see what part some if-statement handles for example.

 

and what is this about??

 

GL11.glPopMatrix();

default: break;

case EQUIPPED:

{

 

Check all your brackets and fix your switch-loop.

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • so I deleted all of my worlds after upgrading from 1.19 to 1.20, and I also deleted the cherished world favorites file. I have the same mods when the game did start up before the maps deleting. but I added 'em back and the game is still not loading. plz help 🙏 I even allocated 12gB of memory and i did use optifine my mod list my log
    • Minecraft opened, but when I went to create a new world I got another error. https://pastebin.com/mmdNztmW
    • java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'terrablender'!     at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388) ~[fabric-loader-0.15.11.jar:?]     at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.15.11.jar:?]     at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386) ~[fabric-loader-0.15.11.jar:?]     at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:63) ~[fabric-loader-0.15.11.jar:?]     at net.minecraft.server.Main.main(Main.java:112) ~[server-intermediary.jar:?]     at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.11.jar:?]     at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.11.jar:?]     at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) ~[fabric-loader-0.15.11.jar:?]     at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) ~[fabric-loader-0.15.11.jar:?] Caused by: java.lang.NoSuchFieldError: Class me.lortseam.completeconfig.data.BooleanEntry does not have member field 'boolean checkbox'     at me.lortseam.completeconfig.data.BooleanEntry.<init>(BooleanEntry.java:25) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at me.lortseam.completeconfig.data.Entry.create(Entry.java:42) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at me.lortseam.completeconfig.data.EntrySet.lambda$resolve$1(EntrySet.java:31) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:212) ~[?:?]     at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:194) ~[?:?]     at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024) ~[?:?]     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:556) ~[?:?]     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:546) ~[?:?]     at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]     at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265) ~[?:?]     at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:611) ~[?:?]     at me.lortseam.completeconfig.data.EntrySet.resolve(EntrySet.java:32) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at me.lortseam.completeconfig.data.Parent.resolveContainer(Parent.java:58) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at me.lortseam.completeconfig.data.Parent.resolve(Parent.java:110) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at me.lortseam.completeconfig.data.Config.lambda$new$0(Config.java:51) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at me.lortseam.completeconfig.data.Config.deserialize(Config.java:94) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at me.lortseam.completeconfig.data.Config.load(Config.java:121) ~[completeconfig-base-2.5.0-cd5950f26b406f27.jar:?]     at io.github.uhq_games.regions_unexplored.RegionsUnexplored.onTerraBlenderInitialized(RegionsUnexplored.java:70) ~[RegionsUnexploredFabric-0.5.31.20.1.jar:?]     at terrablender.core.TerraBlenderFabric.lambda$onInitialize$0(TerraBlenderFabric.java:40) ~[TerraBlender-fabric-1.20.1-3.0.1.7.jar:?]     at java.util.ArrayList.forEach(ArrayList.java:1597) ~[?:?]     at terrablender.core.TerraBlenderFabric.onInitialize(TerraBlenderFabric.java:38) ~[TerraBlender-fabric-1.20.1-3.0.1.7.jar:?]     at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384) ~[fabric-loader-0.15.11.jar:?]  
    • Hi, I have the oficial launcher using the version 1.21, and forge 51.0.13, as soon as I start the installation the games crashes and gives me "exit code: 1", I haven't put any mods yet in the folder. Its the second time that uninstall and install everything and nothing works, checket my graphics and they are updated. https://pastebin.com/STPgEiVs   thanks!
    • Ty very much it worked
  • Topics

×
×
  • Create New...

Important Information

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