Jump to content

Recommended Posts

Posted

I get this weird error which I can't seem to remove.


[iNFO] [sTDERR] 2012-08-17 16:45:55 [sEVERE] Encountered an unexpected exception LoaderException
cpw.mods.fml.common.LoaderException: java.lang.reflect.InvocationTargetException
   at cpw.mods.fml.common.LoadController.transition(LoadController.java:106)
   at cpw.mods.fml.common.Loader.initializeMods(Loader.java:603)
   at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:116)
   at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:356)
   at ft.b(DedicatedServer.java:111)
   at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:415)
   at ep.run(SourceFile:539)
Caused by: java.lang.reflect.InvocationTargetException
   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:308)
   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.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:127)
   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.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:85)
   at cpw.mods.fml.common.Loader.initializeMods(Loader.java:602)
   ... 5 more
Caused by: java.lang.NoClassDefFoundError: arp
   at DayZ_Base.DayZload(DayZ_Base.java:60)
   ... 31 more
Caused by: java.lang.ClassNotFoundException: arp
   at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:99)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
   ... 32 more
Caused by: java.lang.NullPointerException
   at org.objectweb.asm.ClassReader.<init>(Unknown Source)
   at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:28)
   at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:141)
   at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:92)
   ... 34 more

 

I looked into the class not found error and learnt that class arp is ModelBase. I also looked into line 60 of DayZ_Base which is

 

DayZ_ClientProxy.loadDayzSounds();

 

DayZ_ClientProxy

 

package net.minecraft.src;


import java.io.File;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod.Instance;


public class DayZ_ClientProxy extends DayZ_CommonProxy
{
    public static void registerRenderInformation()
    {
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityZombie.class, new RenderBiped(new ModelZombie(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityCrawler.class, new DayZ_RenderCrawler(new DayZ_ModelCrawler(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityBandit.class, new RenderBiped(new ModelBiped(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityBullet.class, new DayZ_RenderBullet());
    }


    public static void loadDayzSounds()
    {
        Minecraft mc = ModLoader.getMinecraftInstance();
        mc.installResource("newsound/DayZ/reload.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/reload.ogg"));
        mc.installResource("newsound/DayZ/ak74u.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/ak74u.ogg"));
        mc.installResource("newsound/DayZ/makarov.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/makarov.ogg"));
        mc.installResource("newsound/DayZ/remington.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/remington.ogg"));
    }
}

 

Any help would be appreciated.

Posted

Interesting, somewhere you have a reference to ModelBase, find it, and move it to client only code.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Whoops I meant arp refers to ModelBiped. The only part I refer to ModelBiped is in DayZ_ClientProxy which is initialised (or whatever) in the main mod file under the load section as

DayZ_ClientProxy.registerRenderInformation();

Posted

I'd need to see full code, to see exactly how you're hardcoding a reference.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

DayZ_Base - I removed all the references to the items, blocks, .addName etc.

package net.minecraft.src;


import java.util.Map;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
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;



@NetworkMod(clientSideRequired = true, serverSideRequired = false)
@Mod(modid = "dayzminecraft", name = "Day Z", version = "5.0")
public class DayZ_Base
{
    public static DayZ_WorldType DayZ_WorldType = new DayZ_WorldType();
    public static final BiomeGenBase dayzforest = (new DayZ_BiomeGenForest(25)).setColor(747097).setBiomeName("Forest");


    @Init
    public void DayZload(FMLInitializationEvent event)
    {        
    	//Load the sound(s) in ClientProxy.
        DayZ_ClientProxy.loadDayzSounds();
        //Load the renderer(s) in ClientProxy.
        DayZ_ClientProxy.registerRenderInformation();
      	//Registers Blocks
      	GameRegistry.registerBlock(barbedwire);
        //Registers the biome.
        GameRegistry.addBiome(dayzforest);
        //Registers the entities
        EntityRegistry.registerGlobalEntityID(DayZ_EntityZombie.class, "DayZZombie", ModLoader.getUniqueEntityId());
        EntityRegistry.registerGlobalEntityID(DayZ_EntityBandit.class, "Bandit", ModLoader.getUniqueEntityId());
        EntityRegistry.registerGlobalEntityID(DayZ_EntityCrawler.class, "Crawler", ModLoader.getUniqueEntityId());
        //Registers the entities here.
        EntityRegistry.registerModEntity(DayZ_EntityBullet.class, "Bullet", 1, this, 250, 5, true);
        //This is pretty much the old ModLoader method (in fact, the ModLoader method just calls this)
        EntityRegistry.registerGlobalEntityID(DayZ_EntityBullet.class, "Bullet", 219);//last param is entity ID, must be unique.
        //Preload the textures.
        MinecraftForgeClient.preloadTexture("/DayZ/weapons.png");
        MinecraftForgeClient.preloadTexture("/DayZ/heal.png");
        MinecraftForgeClient.preloadTexture("/DayZ/food.png");
        MinecraftForgeClient.preloadTexture("/DayZ/terrain.png");
        MinecraftForgeClient.preloadTexture("/DayZ/armor.png");
        //Setting Localization.
        LanguageRegistry.instance().addStringLocalization("entity.Crawler.name", "en_US", "Crawler");
        LanguageRegistry.instance().addStringLocalization("entity.DayZZombie.name", "en_US", "Zombie");
        LanguageRegistry.instance().addStringLocalization("entity.Bandit.name", "en_US", "Bandit");
        LanguageRegistry.instance().addStringLocalization("generator.DAYZ", "en_US", "Day Z");
    }
}

 

DayZ_CommonProxy

 

package net.minecraft.src;
import java.io.File;
import net.minecraft.client.Minecraft;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.network.IGuiHandler;


public class DayZ_CommonProxy implements IGuiHandler
{
    public static void registerRenderInformation()
    {
        //No rendering for servers.
    }
    
    public static void loadDayzSounds()
    {
        //No sounds for servers.
    }


    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
        return null;
    }


    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
        return null;
    }
}

 

DayZ_ClientProxy

 

 



package net.minecraft.src;


import java.io.File;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod.Instance;


public class DayZ_ClientProxy extends DayZ_CommonProxy
{
    public static void registerRenderInformation()
    {
    	//Basically the same as the old way to render entities.
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityZombie.class, new RenderBiped(new ModelZombie(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityCrawler.class, new DayZ_RenderCrawler(new DayZ_ModelCrawler(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityBandit.class, new RenderBiped(new ModelBiped(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityBullet.class, new DayZ_RenderBullet());
    }


    public static void loadDayzSounds()
    {
        Minecraft mc = ModLoader.getMinecraftInstance();
        mc.installResource("newsound/DayZ/reload.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/reload.ogg"));
        mc.installResource("newsound/DayZ/ak74u.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/ak74u.ogg"));
        mc.installResource("newsound/DayZ/makarov.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/makarov.ogg"));
        mc.installResource("newsound/DayZ/remington.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/remington.ogg"));
    }
}

 

This is really bugging me as the error makes no cents. I did a search of the common source folder and the only file with ModelBiped in it is DayZ_ClientProxy. I haven't touched anywhere else.

Posted

    	//Load the sound(s) in ClientProxy.
        DayZ_ClientProxy.loadDayzSounds();
        //Load the renderer(s) in ClientProxy.
        DayZ_ClientProxy.registerRenderInformation();

You have hard references to client proxy.

Thats bad, take a look at SideProxy

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

       //Load the sound(s) in ClientProxy.
        DayZ_ClientProxy.loadDayzSounds();
        //Load the renderer(s) in ClientProxy.
        DayZ_ClientProxy.registerRenderInformation();

You have hard references to client proxy.

Thats bad, take a look at SideProxy

 

 

D:

 

 

So to fix this I would put

 

 

 

@SidedProxy(clientSide = "net.minecraft.src.DayZ_ClientProxy", serverSide = "net.minecraft.src.DayZ_CommonProxy")

in the DayZ_Base file?

 

 

 

 

 

 

Posted

To my understanding, SideProxy is just client/server/bukkit. No choosing files. It will run the exact same code, but not run anything with @SideProxy(ClientSide) on the server.

Posted

You annotate a field with it, when the class is loaded that field will be populated with a instance of the class for the specific side you're running.

Is that to hard to get?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

I had a look at how IronChest does it and made some changes. The server starts now but nothing in the client proxy is rendered in either the client or the server. I also noticed that in  RenderingRegistry.instance().registerEntityRenderingHandler the .instance() comes out as deprecated.

 

 

DayZ_Base

package net.minecraft.src;


import java.util.Map;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Instance;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
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;
import cpw.mods.fml.common.SidedProxy;


@NetworkMod(clientSideRequired = true, serverSideRequired = false)
@Mod(modid = "dayzminecraft", name = "Day Z", version = "5.0")
public class DayZ_Base
{
@SidedProxy(clientSide = "DayZ_ClientProxy", serverSide = "DayZ_CommonProxy")
public static DayZ_CommonProxy proxy;
@Instance
public static DayZ_Base instance;
    
    @Init
    public void DayZload(FMLInitializationEvent event)
    {        
    	//Load stuff in CommonProxy.
    	proxy.loadClientData();


        //Registers the entities
        EntityRegistry.registerGlobalEntityID(DayZ_EntityZombie.class, "DayZZombie", ModLoader.getUniqueEntityId());
        EntityRegistry.registerGlobalEntityID(DayZ_EntityBandit.class, "Bandit", ModLoader.getUniqueEntityId());
        EntityRegistry.registerGlobalEntityID(DayZ_EntityCrawler.class, "Crawler", ModLoader.getUniqueEntityId());
        //Registers the entities here.
        EntityRegistry.registerModEntity(DayZ_EntityBullet.class, "Bullet", 1, this, 250, 5, true);
        EntityRegistry.registerModEntity(DayZ_EntityGrenade.class, "Grenade", 1, this, 250, 5, true);
        //This is pretty much the old ModLoader method (in fact, the ModLoader method just calls this)
        EntityRegistry.registerGlobalEntityID(DayZ_EntityBullet.class, "Bullet", 219);//last param is entity ID, must be unique.
        EntityRegistry.registerGlobalEntityID(DayZ_EntityGrenade.class, "Grenade", 218);//last param is entity ID, must be unique.
        
        //Setting Localization.
        LanguageRegistry.instance().addStringLocalization("entity.Crawler.name", "en_US", "Crawler");
        LanguageRegistry.instance().addStringLocalization("entity.DayZZombie.name", "en_US", "Zombie");
        LanguageRegistry.instance().addStringLocalization("entity.Bandit.name", "en_US", "Bandit");
        LanguageRegistry.instance().addStringLocalization("generator.DAYZ", "en_US", "Day Z");


          LanguageRegistry.instance().addName(DayZ_Base.barbedwire, "Barbed Wire");
    }
}

 

 

DayZ_CommonProxy

 

 


package net.minecraft.src;


import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.network.IGuiHandler;


public class DayZ_CommonProxy implements IGuiHandler
{
    public static void loadClientData()
    {
    	
    }

    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
        return null;
    }


    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
        return null;
    }
}

 

DayZ_ClientProxy

 


package net.minecraft.src;


import java.io.File;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.registry.LanguageRegistry;


public class DayZ_ClientProxy extends DayZ_CommonProxy
{
    public static void loadClientData()
    {
    	//Render entities.
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityZombie.class, new RenderBiped(new ModelZombie(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityCrawler.class, new DayZ_RenderCrawler(new DayZ_ModelCrawler(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityBandit.class, new RenderBiped(new ModelBiped(), 0.5F));
        RenderingRegistry.instance().registerEntityRenderingHandler(DayZ_EntityBullet.class, new DayZ_RenderBullet());
        
        //Preload the textures.
        MinecraftForgeClient.preloadTexture("/DayZ/weapons.png");
        MinecraftForgeClient.preloadTexture("/DayZ/heal.png");
        MinecraftForgeClient.preloadTexture("/DayZ/food.png");
        MinecraftForgeClient.preloadTexture("/DayZ/terrain.png");
        MinecraftForgeClient.preloadTexture("/DayZ/armor.png");
        
        //Install sounds.
        Minecraft mc = ModLoader.getMinecraftInstance();
        mc.installResource("newsound/DayZ/reload.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/reload.ogg"));
        mc.installResource("newsound/DayZ/ak74u.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/ak74u.ogg"));
        mc.installResource("newsound/DayZ/makarov.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/makarov.ogg"));
        mc.installResource("newsound/DayZ/remington.ogg", new File(mc.mcDataDir, "resources/newsound/DayZ/remington.ogg"));
        
        //Adds Achievements
        ModLoader.addAchievementDesc(DayZ_Base.achievementFirstKill, "BRRAAAAAIINS", "Killed Your First Zombie");
        ModLoader.addAchievementDesc(DayZ_Base.achievementFoundGun, "Lock and Load", "Found A Gun");
        ModLoader.addAchievementDesc(DayZ_Base.achievementTakenPainkillers, "Pill Popper", "Taken Painkillers");
    }
}

Posted

They arnt getting loaded because "DayZ_ClientProxy" != "net.minecraft.src.DayZ_ClientProxy"

Why the fuck are you int he minecraft package?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Mmk so I rage quit from this for a few days and ended up figuring it out. Turns out I may be slightly retarded since I didn't read correctly how to do the @SidedProxy. I did find though that I had to put

@SidedProxy(clientSide = "net.minecraft.src.DayZ_ClientProxy", serverSide = "net.minecraft.src.DayZ_CommonProxy")

when I worked out of MCP. When I reobfuscated I changed it to

@SidedProxy(clientSide = "DayZ_ClientProxy", serverSide = "DayZ_CommonProxy")

so all good now :D thanks for the help.

 

 

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.