Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Let me start by saying that i have never made an multiplayer mod before and now im trying to make my mod multiplayer compatible. I have read that forge does most of the work but i have clearly done something wrong.

 

When i start the server i get this error:

[iNFO] Starting minecraft server version 1.4.7
[sEVERE] Encountered an unexpected exception NoClassDefFoundError
java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:416)
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.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
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.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:479)
at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:86)
at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:345)
at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:64)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.entity.Render
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:185)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/entity/Render for invalid side SERVER
at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:38)
at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:228)
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:173)
... 31 more
[sEVERE] This crash report has been saved to: C:\Users\Oscar\Desktop\1.4.7 SMP\jars\.\crash-reports\crash-2013-01-16_18.36.15-server.txt

This is my mod_x

import java.util.Map;

import javax.crypto.Mac;

import net.minecraft.block.Block;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="Castle Defenders", name ="Castle Defenders",version="1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)



public class mod_castledef 
{
public static Block BlockKnight;
public static Block BlockArcher;
public static Block BlockMerc;
public static Block BlockEKnight;
public static Block BlockEArcher;

public static Item ItemMedallion;

public static int defenderID;
public static int knightID;
public static int archerID;
public static int mercID;
public static int EknightID ;
public static int EarcherID;	

public static int BlockKnightID;
public static int BlockArcherID;
public static int BlockMercID;
public static int BlockEKnightID;
public static int BlockEArcherID;
public static int MedallionID;

public static int CastleSpawnRaste;
public static int MercSpawnRate;

@SidedProxy(clientSide="CastleDef.ClientProxyCastleDef", serverSide = "CastleDef.ClientProxyCastleDef")
public static CommonProxyCastleDef proxy;

@PreInit
public void PreLoad(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());

config.load();

BlockKnightID = config.get("BlockKnightID", Configuration.CATEGORY_BLOCK, 238).getInt();
BlockArcherID = config.get("BlockArcherID", Configuration.CATEGORY_BLOCK, 239).getInt();
BlockMercID = config.get("BlockMercID", Configuration.CATEGORY_BLOCK, 234).getInt();
BlockEKnightID = config.get("BlockEKnightID", Configuration.CATEGORY_BLOCK, 237).getInt();
BlockEArcherID = config.get("BlockEArcherID", Configuration.CATEGORY_BLOCK, 236).getInt();

MedallionID = config.get("MedallionID", Configuration.CATEGORY_ITEM, 3001).getInt();


defenderID = config.get("defenderID", Configuration.CATEGORY_GENERAL, -11).getInt();
knightID = config.get("knightID", Configuration.CATEGORY_GENERAL, -12).getInt();
archerID = config.get("archerID", Configuration.CATEGORY_GENERAL, -13).getInt();
mercID = config.get("mercID", Configuration.CATEGORY_GENERAL, -14).getInt();
EknightID = config.get("EknightID", Configuration.CATEGORY_GENERAL, -15).getInt();
EarcherID= config.get("EarcherID", Configuration.CATEGORY_GENERAL, -16).getInt();


CastleSpawnRaste = config.get("CastleSpawnRaste", Configuration.CATEGORY_GENERAL, 4).getInt();
MercSpawnRate = config.get("MercSpawnRate", Configuration.CATEGORY_GENERAL, 4).getInt();
config.save();
}


static int startEntityId = 300;


@Init
public void load(FMLInitializationEvent event)
{
  proxy.registerRenderThings();
  
  ItemMedallion=(new ItemMedallion(MedallionID)).setItemName("Medallion").setIconIndex(7);
  LanguageRegistry.addName(ItemMedallion, "Medallion");
  
  BlockKnight=(new BlockKnight(BlockKnightID,0)).setBlockName("BlockKnight").setHardness(2F).setResistance(5F);
  GameRegistry.registerBlock(BlockKnight);
  LanguageRegistry.addName(BlockKnight,"Knight Spawner"); 
  GameRegistry.registerTileEntity(TileEntityBlockKnight.class, "Knight Block");
  
  BlockArcher=(new BlockArcher(BlockArcherID,1)).setBlockName("BlockArcher").setHardness(2F).setResistance(5F);
  GameRegistry.registerBlock(BlockArcher);
  LanguageRegistry.addName(BlockArcher,"Archer Spawner"); 
  GameRegistry.registerTileEntity(TileEntityBlockArcher.class, "BlockArcher");
  
  BlockMerc=(new BlockMerc(BlockMercID,0)).setBlockName("BlockMerc").setHardness(2F).setResistance(5F);
GameRegistry.registerBlock(BlockMerc);
LanguageRegistry.addName(BlockMerc, "Merc Spawner");
GameRegistry.registerTileEntity(TileEntityBlockMerc.class, "Merc Block");

BlockEKnight=(new BlockEKnight(BlockEKnightID,6)).setBlockName("BlockEKnight").setHardness(2F).setResistance(5F);
GameRegistry.registerBlock(BlockEKnight);
LanguageRegistry.addName(BlockEKnight,"Enemy Knight Spawner"); 
GameRegistry.registerTileEntity(TileEntityBlockEKnight.class, "Enemy Knight Block");

BlockEArcher=(new BlockEArcher(BlockEArcherID,5)).setBlockName("BlockEArcher").setHardness(2F).setResistance(5F);
GameRegistry.registerBlock(BlockEArcher);
LanguageRegistry.addName(BlockEArcher, "Enemy Archer Spawner");
GameRegistry.registerTileEntity(TileEntityBlockEArcher.class, "Enemy Archer Block");


  	GameRegistry.addRecipe(new ItemStack(BlockKnight,1), new Object [] {
  	" X ","XYX"," X ", Character.valueOf('X'), Item.ingotIron,Character.valueOf('Y'), Item.swordSteel
});
GameRegistry.addRecipe(new ItemStack(BlockArcher,1), new Object [] {
" X ","XYX"," X ", Character.valueOf('X'), Item.ingotIron,Character.valueOf('Y'), Item.bow
});


  EntityRegistry.registerGlobalEntityID(EntityDefender.class, "Defender", defenderID);

  EntityRegistry.registerGlobalEntityID(EntityKnight.class, "Knight", knightID);
  EntityRegistry.addSpawn(EntityKnight.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  LanguageRegistry.instance().addStringLocalization("entity.Castle Defenders.Knight.name", "Knight");
  registerEntityEgg(EntityKnight.class, 0xffffff, 0x000000);
  
  EntityRegistry.registerGlobalEntityID(EntityArcher.class, "Archer", archerID);
  EntityRegistry.addSpawn(EntityArcher.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  LanguageRegistry.instance().addStringLocalization("entity.Castle Defenders.Archer.name", "Archer");
  registerEntityEgg(EntityArcher.class, 0xffffff, 0x500000);
  
  EntityRegistry.registerGlobalEntityID(EntityMerc.class, "Merc", mercID);
  EntityRegistry.addSpawn(EntityMerc.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  
  EntityRegistry.registerGlobalEntityID(EntityEKnight.class, "Enemy Knight", EknightID);
  EntityRegistry.addSpawn(EntityEKnight.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  
  EntityRegistry.registerGlobalEntityID(EntityEArcher.class, "Enemy Archer", EarcherID);
  EntityRegistry.addSpawn(EntityEArcher.class, 10, 0, 0, EnumCreatureType.creature, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.frozenOcean ,BiomeGenBase.frozenRiver, BiomeGenBase.hell, BiomeGenBase.iceMountains, BiomeGenBase.icePlains, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.sky, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
  
  GameRegistry.registerWorldGenerator(new WorldGeneratorMercbase());
  GameRegistry.registerWorldGenerator(new WorldGeneratorCastle());
  
  RenderingRegistry.registerEntityRenderingHandler(EntityKnight.class, new RenderBiped(new ModelBiped(), 0.5F));
  RenderingRegistry.registerEntityRenderingHandler(EntityArcher.class, new RenderBiped(new ModelBiped(), 0.5F));
  RenderingRegistry.registerEntityRenderingHandler(EntityMerc.class, new RenderBiped(new ModelBiped(), 0.5F));
  RenderingRegistry.registerEntityRenderingHandler(EntityEKnight.class, new RenderBiped(new ModelBiped(), 0.5F));
  RenderingRegistry.registerEntityRenderingHandler(EntityEArcher.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public static int getUniqueEntityId() 
{
  do 
  {
   startEntityId++;
  } 
  while (EntityList.getStringFromID(startEntityId) != null);

   return startEntityId;
}

public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) 
{
  int id = getUniqueEntityId();
  EntityList.IDtoClassMapping.put(id, entity);
  EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}



}

 

I would really appriciate any help or tips.

 

Thanks!

 

 

 

All your RenderingRegistry calls need to go in your proxy, as you are trying to reference a render file on the server!

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.