Jump to content

Recommended Posts

Posted

My mod works fine until I try to register a model in the client proxy. Here's the crash report...

 

  Reveal hidden contents

 

 

And the client proxy code

 

  Reveal hidden contents

 

 

It works fine without this line (MinecraftForgeClient.registerItemRenderer(TuxWeaponsCore.fireChargeCannon.itemID, (IItemRenderer) new FireChargeCannonRenderer())).

 

I am following Ichun's 3d item tutorial which can be found

.
Posted

1. Instead of using registerGlobalEntityID, use registerModEntity. The parameters are: entity class, entity name, mod-specific ID (beginning at 0, increase it by 1 for each entity which come afterwards), your mod instance (the field with the @Instance annotation), tracking range (I usually have this to 128), update frequency (I use 1 for sending an update each tick), send velocity updates (true on mobile entities as mobs or arrows, false on stationary entites which won't usually move around)

2. Don't use ModLoader as you will run into problems with dedicated servers. Look into the class and use the methods called by the ModLoader-method

3. You probably call registerRenderers() before you initialize your items / blocks. Do it afterwards.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

I did have my proxy registers before my weapons and items, I moved them to the end and now it works great. However when I did your mod loader to forge method quick fix I ran into some problems. It crashes again, but when I comment out the new methods its fine.

 

Here's my proxy again, I want to make sure that I get the little things like this too so that I'm up to standards =D

 

  Reveal hidden contents

 

Posted
  On 5/10/2013 at 12:11 AM, TuxCraft said:

I did have my proxy registers before my weapons and items, I moved them to the end and now it works great. However when I did your mod loader to forge method quick fix I ran into some problems. It crashes again, but when I comment out the new methods its fine.

 

Here's my proxy again, I want to make sure that I get the little things like this too so that I'm up to standards =D

 

  Reveal hidden contents

 

 

ModLoader.getUniqueEntityId()

I said don't use ModLoader D:

 

Also the ID is mod-unique, meaning you don't need to rely on any method. Just use 0 for your first entity, 1 for your second one, 2 for your third one and so on.

nvm, I didn't saw your edit.

 

Looks good to me.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

Maybe this will help? I'd prefer to not use modloader classes...

 

  Reveal hidden contents

 

Posted

can I see your main class? Seems like your instance field is null.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

I'd rather not post the whole core file, but I put what I think you'll need.

 

@Mod(modid = TuxWeaponsCore.modid, name = "Tux's Weapons Mod", version = "0.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false, 
channels={"TuxWeaponsC"})

...

@Instance("TuxWeapons")
public static TuxWeaponsCore instance;

@SidedProxy(clientSide="mods.TuxWeapons.ClientProxy", serverSide="mods.TuxWeapons.CommonProxy")
public static CommonProxy proxy;

public static final String modid = "TuxWeaponsCore";

...

proxy.registerRenderers();
proxy.registerServerTickHandler();

 

Did I reference it wrong in my proxy?

Posted
  On 5/10/2013 at 9:22 PM, TuxCraft said:

I'd rather not post the whole core file, but I put what I think you'll need.

 

@Mod(modid = TuxWeaponsCore.modid, name = "Tux's Weapons Mod", version = "0.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false, 
channels={"TuxWeaponsC"})

...

@Instance("TuxWeapons")
public static TuxWeaponsCore instance;

@SidedProxy(clientSide="mods.TuxWeapons.ClientProxy", serverSide="mods.TuxWeapons.CommonProxy")
public static CommonProxy proxy;

public static final String modid = "TuxWeaponsCore";

...

proxy.registerRenderers();
proxy.registerServerTickHandler();

 

Did I reference it wrong in my proxy?

 

Your Instance annotation must have the same modID as the @Mod annotation. So use the modid variable you declared also for the @Instance.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

  • 2 weeks later...

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.