Serveur - Crash - Arc
-
Voila j’ai un problème lorsque je lance un serveur avec mon mod qui ajoute un arc.
L’arc en solo marche parfaitement mais pas en multijoueur : Dés que je lance le serveur il crash.
Classe de l’arc :
:::
[code_java]package net.pentiminax.IG.items;import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import net.pentiminax.IG.BaseIG;public class ItemAgateBow extends Item
{
public static final String[] bowPullIconNameArray = new String[] {“AgateBow_0”, “AgateBow_1”, “AgateBow_2”};
@SideOnly(Side.CLIENT)
private Icon[] iconArray;public ItemAgateBow(int par1)
{
super(par1);
this.maxStackSize = 1;
this.setMaxDamage(470);
this.bFull3D = true ;
}/**
- called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
*/
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
int j = this.getMaxItemUseDuration(par1ItemStack) - par4;
ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
{
return;
}
j = event.charge;boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (flag || par3EntityPlayer.inventory.hasItem(BaseIG.SoufreArrow.itemID))
{
float f = (float)j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;if ((double)f < 0.1D)
{
return;
}if (f > 1.0F)
{
f = 1.0F;
}EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F);
if (f == 1.0F)
{
entityarrow.setIsCritical(true);
}int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
if (k > 0)
{
entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
}int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
if (l > 0)
{
entityarrow.setKnockbackStrength(l);
}if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
{
entityarrow.setFire(100);
}par1ItemStack.damageItem(1, par3EntityPlayer);
par2World.playSoundAtEntity(par3EntityPlayer, “random.bow”, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);if (flag)
{
entityarrow.canBePickedUp = 2;
}
else
{
par3EntityPlayer.inventory.consumeInventoryItem(BaseIG.SoufreArrow.itemID);
}if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(entityarrow);
}
}
}public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}/**
- How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 72000;
}
/**
- returns the action that specifies what animation to play when the items is being used
/
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.bow;
}
/* - Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
{
return event.result;
}
if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(BaseIG.SoufreArrow.itemID))
{
par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
}return par1ItemStack;
}/**
- Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return 1;
}
@SideOnly(Side.CLIENT)
private Icon[] Texture = new Icon[4];
public void registerIcons(IconRegister iconRegister){
itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(5) + “0");
for (int N = 0; N < 4; N++)
{
this.Texture[N] = iconRegister.registerIcon(this.getUnlocalizedName().substring(5) + "” + N);}
}
public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
{
if(player.getItemInUse() == null) return this.itemIcon;
int Pulling = stack.getMaxItemUseDuration() - useRemaining;
if (Pulling >= 18)
{
return Texture[3];
}
else if (Pulling > 13)
{
return Texture[2];
}
else if (Pulling > 0)
{
return Texture[1];
}
return Texture[0];
}
}[/code_java]
:::Le
ForgeModLoader-client-0.log : http://www.mediafire.com/view/nbqddsyocl3if3o/ForgeModLoader-client-0.log
ForgeModLoader-server-0.logo : http://www.mediafire.com/view/wdedo1oewvl4yf3/ForgeModLoader-server-0.log
Le crash dans la console :
2013-06-30 21:51:42 [INFO] [ForgeModLoader] Forge Mod Loader version 5.2.23.738 for Minecraft 1.5.2 loading 2013-06-30 21:51:42 [INFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_25, running on Windows 8:amd64:6.2, installed at C:\Program Files\Java\jre7 2013-06-30 21:51:42 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation 2013-06-30 21:51:46 [INFO] [STDOUT] 229 recipes 2013-06-30 21:51:46 [INFO] [STDOUT] 27 achievements 2013-06-30 21:51:47 [INFO] [Minecraft-Server] Starting minecraft server version 1.5.2 2013-06-30 21:51:47 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization 2013-06-30 21:51:47 [INFO] [STDOUT] MinecraftForge v7.8.1.738 Initialized 2013-06-30 21:51:47 [INFO] [ForgeModLoader] MinecraftForge v7.8.1.738 Initialized 2013-06-30 21:51:47 [INFO] [STDOUT] Replaced 85 ore recipies 2013-06-30 21:51:47 [INFO] [MinecraftForge] Completed early MinecraftForge initialization 2013-06-30 21:51:47 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\TanguyPro\Desktop\Mod Officiel New Forge\mcp\jars\config\logging.properties 2013-06-30 21:51:47 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL 2013-06-30 21:51:47 [INFO] [ForgeModLoader] Searching C:\Users\TanguyPro\Desktop\Mod Officiel New Forge\mcp\jars\mods for mods 2013-06-30 21:51:50 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load 2013-06-30 21:51:50 [INFO] [mcp] Activating mod mcp 2013-06-30 21:51:50 [INFO] [FML] Activating mod FML 2013-06-30 21:51:50 [INFO] [Forge] Activating mod Forge 2013-06-30 21:51:50 [INFO] [IG] Activating mod IG 2013-06-30 21:51:50 [INFO] [ForgeModLoader] Registering Forge Packet Handler 2013-06-30 21:51:50 [INFO] [ForgeModLoader] Succeeded registering Forge Packet Handler 2013-06-30 21:51:50 [INFO] [STDERR] java.lang.NoSuchFieldError: Texture 2013-06-30 21:51:50 [INFO] [STDERR] at net.pentiminax.IG.items.ItemAgateBow.<init>(ItemAgateBow.java:165) 2013-06-30 21:51:50 [INFO] [STDERR] at net.pentiminax.IG.BaseIG.<clinit>(BaseIG.java:116) 2013-06-30 21:51:50 [INFO] [STDERR] at java.lang.Class.forName0(Native Method) 2013-06-30 21:51:50 [INFO] [STDERR] at java.lang.Class.forName(Unknown Source) 2013-06-30 21:51:50 [INFO] [STDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:425) 2013-06-30 21:51:50 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-06-30 21:51:50 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-06-30 21:51:50 [INFO] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-06-30 21:51:50 [INFO] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-06-30 21:51:50 [INFO] [STDERR] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192) 2013-06-30 21:51:50 [INFO] [STDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172) 2013-06-30 21:51:50 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-06-30 21:51:50 [INFO] [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-06-30 21:51:50 [INFO] [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-06-30 21:51:50 [INFO] [STDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) 2013-06-30 21:51:50 [INFO] [STDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267) 2013-06-30 21:51:50 [INFO] [STDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103) 2013-06-30 21:51:50 [INFO] [STDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:504) 2013-06-30 21:51:50 [INFO] [STDERR] at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:85) 2013-06-30 21:51:50 [INFO] [STDERR] at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) 2013-06-30 21:51:50 [INFO] [STDERR] at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) 2013-06-30 21:51:50 [INFO] [STDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:431) 2013-06-30 21:51:50 [INFO] [STDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-06-30 21:51:50 [SEVERE] [Minecraft-Server] Encountered an unexpected exception NoSuchFieldError java.lang.NoSuchFieldError: Texture at net.pentiminax.IG.items.ItemAgateBow.<init>(ItemAgateBow.java:165) at net.pentiminax.IG.BaseIG.<clinit>(BaseIG.java:116) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:425) 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:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172) 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:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103) at cpw.mods.fml.common.Loader.loadMods(Loader.java:504) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:85) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:431) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-06-30 21:51:50 [SEVERE] [Minecraft-Server] This crash report has been saved to: C:\Users\TanguyPro\Desktop\Mod Officiel New Forge\mcp\jars\.\crash-reports\crash-2013-06-30_21.51.50-server.txt 2013-06-30 21:51:52 [INFO] [Minecraft-Server] Stopping server 2013-06-30 21:51:52 [INFO] [Minecraft-Server] Saving worlds 2013-06-30 21:51:52 [INFO] [ForgeModLoader] The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded. 2013-06-30 21:51:52 [INFO] [ForgeModLoader] The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded. 2013-06-30 21:51:52 [INFO] [Minecraft-Server] Stopping server 2013-06-30 21:51:52 [INFO] [Minecraft-Server] Saving worlds ```</clinit></init></clinit></init>
- called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
-
[code_java]@SideOnly(Side.CLIENT)
private Icon[] Texture = new Icon[4];[/code_java]
Tu as déclaré l’icon en @SideOnly mais pas les autres méthodes qui utilise l’icone. Enlève ce @SideOnly, il ne sert à rienha en passant, je déplace dans le support pour moddeur, cette section est fait pour les joueurs.
-
Est-ce que tu as lancé reobfuscate.bat où reobfuscate_srg.bat ?
-
J’ai lancé reobfuscate.bat
-
à la limite, ça c’est rien, mais moi, vu le mod que je développe, il y a ÉNORMÉMENT de choses à “universaliser” ><
-
Dans ce cas, essaie ce que t’as dis Robin, et si ça ne fonctionne toujours pas, lance reobfuscate_srg.bat
-
J’ai essayer en faisant ce que a dit Robin et en lançant reobfuscate_srg.bat mais ça n’a pas fonctionner et j’obtiens ce crash :
:::
[code_java][INFO] Starting minecraft server version 1.5.2
[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.ProxyInjector.inject(ProxyInjector.java:58)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:471)
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:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172)
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:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:504)
at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:85)
at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:69)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:431)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.entity.Render
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:238)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 31 more
Caused by: java.lang.NullPointerException
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:227)
… 33 more
[SEVERE] This crash report has been saved to: C:\Users\TanguyPro\Desktop\Le serveur.\crash-reports\crash-2013-07-01_01.30.30-server.txt[/code_java]
::: -
java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render
Es-tu sur d’avoir mis une de tes classes reservé pour le client dans ton package client ? Ou avoir mis un @SideOnly(Side.CLIENT) pour ce qui concerne uniquement le client ? ^^
-
Je pense que ça viens du SideOnly, vu que le serveur n’as pas cette classe, et donc qu’il ne la trouve pas.
-
Des nouvelles ?