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.

[Fixed] [1.6.4] When joining a server, client crashes (in dev environment)

Featured Replies

Posted

When I try to connect to a server with my mod, the client crashes. Log: https://gist.github.com/anonymous/f800fc22e52426eaad1c

Source:

 

 

EmeraldArmorCore:

 

 

package net.spideynn.emeraldarmor;

import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.EnumHelper;
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.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "ea", version = "1.0.0", name = "EmeraldArmor")
@NetworkMod(clientSideRequired = true, serverSideRequired = true)
public class EmeraldArmorCore {

@SidedProxy(clientSide="net.spideynn.emeraldarmor.ClientProxy", serverSide="net.spideynn.emeraldarmor.CommonProxy")
public static CommonProxy proxy;

public static EnumArmorMaterial EmeraldArmorMaterial;

public static ItemArmor emeraldHelmet;

public static ItemArmor emeraldChest;

public static ItemArmor EmeraldLeggings;

public static ItemArmor emeraldBoots;

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	EmeraldArmorMaterial = EnumHelper.addArmorMaterial(
			"EmeraldArmorMaterial", 3741,
			new int[] { 746, 1076, 1010, 878 }, 20);

	emeraldHelmet = (ItemArmor) new EmeraldHelmet(3200,
			EmeraldArmorCore.EmeraldArmorMaterial, 0, 0)
			.setUnlocalizedName("emeraldHelmet");
	GameRegistry.registerItem(emeraldHelmet, "emeraldHelmet");
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldHelmet), 1, 1, 005));
	ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldHelmet), 1, 1, 005));
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldHelmet), 1, 1, 005));

	emeraldChest = (ItemArmor) new EmeraldChestplate(
			EmeraldArmorCore.EmeraldArmorMaterial, 1, 1)
			.setUnlocalizedName("emeraldChest");
	GameRegistry.registerItem(emeraldChest, "emeraldChest");
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldChest), 1, 3, 005));
	ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldChest), 1, 3, 005));
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldChest), 1, 3, 005));

	EmeraldLeggings = (ItemArmor) new EmeraldLeggings(
			EmeraldArmorCore.EmeraldArmorMaterial, 2, 2)
			.setUnlocalizedName("EmeraldLeggings");
	GameRegistry.registerItem(EmeraldLeggings, "EmeraldLeggings");
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.EmeraldLeggings), 1, 3, 005));
	ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.EmeraldLeggings), 1, 3, 005));
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.EmeraldLeggings), 1, 3, 005));

	emeraldBoots = (ItemArmor) new EmeraldBoots(
			EmeraldArmorCore.EmeraldArmorMaterial, 3, 3)
			.setUnlocalizedName("emeraldBoots");
	GameRegistry.registerItem(emeraldBoots, "emeraldBoots");
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldBoots), 1, 3, 005));
	ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldBoots), 1, 3, 065));
	ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(
			new WeightedRandomChestContent(new ItemStack(
					EmeraldArmorCore.emeraldBoots), 1, 3, 005));
}

@EventHandler
public void init(FMLInitializationEvent event) {
	GameRegistry.addRecipe(new ItemStack(EmeraldArmorCore.emeraldHelmet),
			new Object[] { "XXX", "X0X", 'X', Item.emerald });

	GameRegistry.addRecipe(new ItemStack(EmeraldArmorCore.emeraldChest),
			new Object[] { "X0X", "XXX", "XXX", 'X', Item.emerald });

	GameRegistry.addRecipe(new ItemStack(EmeraldArmorCore.EmeraldLeggings),
			new Object[] { "XXX", "X0X", "X0X", 'X', Item.emerald });

	GameRegistry.addRecipe(new ItemStack(EmeraldArmorCore.emeraldBoots),
			new Object[] { "X0X", "X0X", "000", 'X', Item.emerald });
}

@EventHandler
public void postInit(FMLPostInitializationEvent event) {

}

@EventHandler
public void serverStarting(FMLServerStartingEvent event) {

}
}

 

 

 

EmeraldHelmet:

 

 

package net.spideynn.emeraldarmor;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EmeraldHelmet extends ItemArmor {

public final int renderIndex() {
	return 3;
}

public boolean getIsRepairable(ItemStack par1ItemStack,
		ItemStack par2ItemStack) {
	return true;
}

public final int armorType() {
	return 0;
}

public EmeraldHelmet(int i, EnumArmorMaterial par2EnumArmorMaterial,
		int par3, int par4) {
	super(par4, par2EnumArmorMaterial, par3, par4);
	this.setCreativeTab(CreativeTabs.tabCombat);
}

@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
	this.itemIcon = par1IconRegister.registerIcon("ea:emeraldHelmet");
}

public void onArmorTickUpdate(World world, EntityPlayer player,
		ItemStack itemStack) {

}

public String getArmorTexture(ItemStack stack, Entity entity, int slot,
		String type) {
	return "ea:EmeraldArmor.png";
}

}

 

 

 

EmeraldChestplate:

 

 

package net.spideynn.emeraldarmor;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EmeraldChestplate extends ItemArmor {

public boolean getIsRepairable(ItemStack par1ItemStack,
		ItemStack par2ItemStack) {
	return true;
}

public final int armorType() {
	return 1;
}

public EmeraldChestplate(EnumArmorMaterial par2EnumArmorMaterial, int par3,
		int par4) {
	super(par4, par2EnumArmorMaterial, par3, par4);
	this.setCreativeTab(CreativeTabs.tabCombat);
}

@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
	this.itemIcon = par1IconRegister.registerIcon("ea:emeraldChest");
}

public void onArmorTickUpdate(World world, EntityPlayer player,
		ItemStack itemStack) {

}

public String getArmorTexture(ItemStack stack, Entity entity, int slot,
		String type) {
	return "ea:EmeraldArmor.png";
}

}

 

 

 

EmeraldLeggings:

 

 

package net.spideynn.emeraldarmor;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EmeraldLeggings extends ItemArmor {

public boolean getIsRepairable(ItemStack par1ItemStack,
		ItemStack par2ItemStack) {
	return true;
}

public final int armorType() {
	return 2;
}

public EmeraldLeggings(EnumArmorMaterial par2EnumArmorMaterial, int par3,
		int par4) {
	super(par4, par2EnumArmorMaterial, par3, par4);
	this.setCreativeTab(CreativeTabs.tabCombat);
}

@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
	this.itemIcon = par1IconRegister.registerIcon("ea:emeraldLeggins");
}

public void onArmorTickUpdate(World world, EntityPlayer player,
		ItemStack itemStack) {

}

public String getArmorTexture(ItemStack stack, Entity entity, int slot,
		String type) {
	return "ea:EmeraldArmor.png";
}

}

 

 

 

EmeraldBoots:

 

 

package net.spideynn.emeraldarmor;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EmeraldBoots extends ItemArmor {

public boolean getIsRepairable(ItemStack par1ItemStack,
		ItemStack par2ItemStack) {
	return true;
}

public final int armorType() {
	return 3;
}

public EmeraldBoots(EnumArmorMaterial par2EnumArmorMaterial, int par3,
		int par4) {
	super(par4, par2EnumArmorMaterial, par3, par4);
	this.setCreativeTab(CreativeTabs.tabCombat);
}

@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
	this.itemIcon = par1IconRegister.registerIcon("ea:emeraldBoots");
}

public void onArmorTickUpdate(World world, EntityPlayer player,
		ItemStack itemStack) {

}

public String getArmorTexture(ItemStack stack, Entity entity, int slot,
		String type) {
	return "ea:EmeraldArmor.png";
}

}

 

 

 

ClientProxy:

 

 

package net.spideynn.emeraldarmor;

import net.spideynn.emeraldarmor.CommonProxy;

public class ClientProxy extends CommonProxy {
       
        @Override
        public void registerRenderers() {
               
        }
       
}

 

 

 

CommonProxy:

 

 

package net.spideynn.emeraldarmor;


public class CommonProxy {

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

 

 

 

 

 

 

Any ideas why? (I'm new to Forge modding, I combined lots of tutorials to get this)

Check to see that your server.properties has "online-mode=false". That's what kept it from working for me until I fixed that.

  • Author

Check to see that your server.properties has "online-mode=false". That's what kept it from working for me until I fixed that.

 

That fixed it! Now I just need to fix the armor not having a texture :)

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.