Jump to content

Recommended Posts

Posted

Hello again,

 

I would like some help to make my mod working on SMP.

According to the previous topic, http://www.minecraftforge.net/forum/index.php/topic,3053.msg20596.html#msg20596, all you need to do is to put your mod in the server and that's fine. Well, not for me. In solo, mod works fine and does not crash. I get immediate crash when trying to set it up on SMP. I used the Forge ModLoader to load my mod. Here's the log:

 

 

  Reveal hidden contents

 

 

From what I read, it has trouble with the armor adding by ModLoader.

Here are the culprits:

 

  Reveal hidden contents

 

 

Can anyone give a hand? Thanks by advance.

Posted

I don't know if it helps, but when I put my mod in "coremods" instead of "mods" in my server folders, the server doesn't crash anymore. But! When I try to place a block from my mod, it instantly disappears (spawn protection not counted) and is removed from my inventory. Also, I don't see any traces of my custom ores...

Posted

Here's the code I use to register armor in Forge:

 

public static Item gemChest = new GemChest(5004, EnumArmorMaterial.IRON, 2, 1).setUnlocalizedName("gemChest");
Registration.itemRegistration(gemChest, "Gem Chest");

public static void itemRegistration(Item par1, String par2)
  {
	  GameRegistry.registerItem(par1, par2);
      LanguageRegistry.addName(par1, par2);
  }

Posted
  On 6/30/2013 at 4:34 PM, bl4ckscor3 said:

I used the tutorial by TheGrovesyProject101. It uses a deprecated class, but it works.

 

Doesn't work.

  Quote

Here's the code I use to register armor in Forge:

 

public static Item gemChest = new GemChest(5004, EnumArmorMaterial.IRON, 2, 1).setUnlocalizedName("gemChest");
Registration.itemRegistration(gemChest, "Gem Chest");

public static void itemRegistration(Item par1, String par2)
  {
	  GameRegistry.registerItem(par1, par2);
      LanguageRegistry.addName(par1, par2);
  }

 

I want to do an armor with custom textures. I don't want it to have iron textures.

Posted

No problem, just override the texture in the item class:

@Override
        public String getArmorTextureFile(ItemStack itemstack) 
        {
                        return "/mods/Amanus/textures/gemArmor.png";
        }

Posted
  On 6/30/2013 at 6:35 PM, SeaBass said:

No problem, just override the texture in the item class:

@Override
        public String getArmorTextureFile(ItemStack itemstack) 
        {
                        return "/mods/Amanus/textures/gemArmor.png";
        }

 

I mean, my items are textured. It's when worn they aren't.

Posted

I did like you said, I still get iron texture.

 

Pretty sure you method works but what do I have to change ?

Here's a sample of my code:

public final static Item bootsSteel = new SovSteelBoots(908, steelArmorMaterial2, 2, 3).setUnlocalizedName("steelBoots").setCreativeTab(CreativeTabs.tabCombat);

So, 2 is the iron texture. What do I replace it with ?

Posted

In the new version you have to use the getArmorTexture() function from the Item class to your armor item calss.Here is an example on how to use it:(took from my own mod)

 

 

  Reveal hidden contents

 

 

 

Also when you register the armor you have to do it like so:

 

reinforcedBoots = new ReinforcedBoots(reBoots, ReinforcedArmorMaterial, RenderingRegistry.addNewArmourRendererPrefix("reinforced"), 3).setUnlocalizedName("reinforcedboots").setCreativeTab(CreativeTabs.tabCombat);

 

Notice the RenderingRegistry added there with a custom name you want.

It works perfectly fine for me, with no errors.

Posted
  On 6/30/2013 at 7:15 PM, decebaldecebal said:

In the new version you have to use the getArmorTexture() function from the Item class to your armor item calss.Here is an example on how to use it:(took from my own mod)

 

 

  Reveal hidden contents

 

 

 

Also when you register the armor you have to do it like so:

 

reinforcedBoots = new ReinforcedBoots(reBoots, ReinforcedArmorMaterial, RenderingRegistry.addNewArmourRendererPrefix("reinforced"), 3).setUnlocalizedName("reinforcedboots").setCreativeTab(CreativeTabs.tabCombat);

 

Notice the RenderingRegistry added there with a custom name you want.

It works perfectly fine for me, with no errors.

 

I used your methods and yes, it works. Problem is, it still crashes my server.jar:

 

  Reveal hidden contents

 

Posted
  On 7/1/2013 at 4:06 PM, ObsequiousNewt said:

  Quote

Bump... Please, I don't understand what I have to do to make it work on SMP.

Line 56 of Alloycraft is...?

 

public final static Item bootsSteel = new SovSteelBoots(908, steelArmorMaterial2, RenderingRegistry.addNewArmourRendererPrefix("steel"), 3).setUnlocalizedName("steelBoots").setCreativeTab(CreativeTabs.tabCombat);

This is the first armor line in my main class.

Posted
  On 7/1/2013 at 4:42 PM, Soviet said:

  Quote

  Quote

Bump... Please, I don't understand what I have to do to make it work on SMP.

Line 56 of Alloycraft is...?

 

public final static Item bootsSteel = new SovSteelBoots(908, steelArmorMaterial2, RenderingRegistry.addNewArmourRendererPrefix("steel"), 3).setUnlocalizedName("steelBoots").setCreativeTab(CreativeTabs.tabCombat);

This is the first armor line in my main class.

Oh. Right. Erm, Decebal²? Where are you calling that? Because it's client-only.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted

my mod use proxy's but i can tell your how i make mine work step by step and if that don't work your can pm me your skype and i can explain it to your

1. we need the client so we are gonna put

   public static int addArmor(String Armor){
        return 0;
    }

in the commonproxy

the server do not need it so that's why commonproxy will return 0

2. add the same code in your client proxy but this time it is going to return RenderingRegistry.addNewArmourRendererPrefix(armor) insted of 0

    public static int addArmor(String armor){
        return RenderingRegistry.addNewArmourRendererPrefix(armor);
    }

3. now to use this code in a item your are simple just gonna add it like this

Name = new Armorclass(id, Enum, CommonProxy.addArmor("add something here"), 0);

4. now we need the armor to show up but i think your all ready now that so just say if your need more help (or as i said before pm me your skype)

 

edit--

feel free to look at my mods github to see with 100% how i make armor work with forge and SMP

https://github.com/henrikse55/Item-Pack

Posted

Easy fix use this:

 

Base Class

Static:

public static EnumArmorMaterial BRONZE = EnumHelper.addArmorMaterial("BRONZE", 8,  new int[]{2, 6, 4, 2}, 5);

Load:

BronzePlateChest = new BronzeArmor(2016,  Core.BRONZE, proxy.addArmor("Bronze Platechest"), 1).setUnlocalizedName("CyphScape_BronzeChestPlate");

 

Armor Class:

package mods.cyphereion.cyphscape.core;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IArmorTextureProvider;

public class BronzeArmor extends ItemArmor implements IArmorTextureProvider{

public BronzeArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial,
		int par3, int par4) {
	super(par1, par2EnumArmorMaterial, par3, par4);
	this.setCreativeTab(Core.tabCyphScape);
}

@Override
public String getArmorTextureFile(ItemStack itemstack) {
	if(itemstack.itemID == Core.BronzeFullHelmet.itemID || itemstack.itemID == Core.BronzePlateChest.itemID || itemstack.itemID == Core.BronzeBoots.itemID){
	return "/textures/armor/Bronze_1.png";
	}

	if(itemstack.itemID == Core.BronzePlateLegs.itemID){
		return "/textures/armor/Bronze_2.png";
	}

	else return null;

}

}

 

That is literally it. And btw try to avoid modloader methods, those need modloader mp to work. Forge has built in multiplayer so stick with that.

 

Whoops forgot. Here it is now :3

 

Client Proxy:

	public int addArmor(String armor){
	return RenderingRegistry.addNewArmourRendererPrefix(armor);
}

 

 

Common Proxy:

public static int addArmor(String Armor){
        return 0;
    }

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.