Jump to content

Recommended Posts

Posted

Hello,

first I use forge-1.10.2-12.18.1.2010

so when I want to use addSubstitutionAlias like previous versions, game compile,

but when I join a world the game freeze : the cause is a duplication of StatBase.

I think is a bug of forge.

Posted

my code :

public static void overrideItem(Item itemold, Item itemnew) {
    	try {
    		itemold.setCreativeTab(null);
    		String name = ((ResourceLocation)Item.REGISTRY.getNameForObject(itemold)).toString();
    		System.out.println("OVERRIDE: " + name);
    		itemnew.setUnlocalizedName(itemold.getUnlocalizedName().replaceFirst("item.", ""));
	GameRegistry.addSubstitutionAlias((name), GameRegistry.Type.ITEM, itemnew);

} catch (Exception e) {
		e.printStackTrace();
}
}

for example :

overrideItem(Items.IRON_HELMET, new ItemArmorMod(ItemArmor.ArmorMaterial.IRON, 2, EntityEquipmentSlot.HEAD));
overrideItem(Items.IRON_CHESTPLATE, new ItemArmorMod(ItemArmor.ArmorMaterial.IRON, 2, EntityEquipmentSlot.CHEST));
overrideItem(Items.IRON_LEGGINGS, new ItemArmorMod(ItemArmor.ArmorMaterial.IRON, 2, EntityEquipmentSlot.LEGS));
overrideItem(Items.IRON_BOOTS, new ItemArmorMod(ItemArmor.ArmorMaterial.IRON, 2, EntityEquipmentSlot.FEET));

error :

[23:35:58] [server thread/ERROR] [FML]: Fatal errors were detected during the transition from SERVER_ABOUT_TO_START to SERVER_STARTING. Loading cannot continue

[23:35:58] [server thread/ERROR] [FML]:

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UCHIJAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)

UCHIJAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.0.2010.jar)

UCHIJAAE Forge{12.18.0.2010} [Minecraft Forge] (forgeSrc-1.10.2-12.18.0.2010.jar)

UCHIJAAA mfr{1.0} [MineFunRevolution] (bin)

[23:35:58] [server thread/ERROR] [FML]: The following problems were captured during this phase

[23:35:58] [server thread/ERROR] [FML]: Caught exception from Forge

java.lang.RuntimeException: Duplicate stat id: "TranslatableComponent{key='stat.useItem', args=[TextComponent{text='[', siblings=[TextComponent{text='Iron Leggings', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}, TextComponent{text=']', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], style=Style{hasParent=true, color=§f, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}" and "TranslatableComponent{key='stat.useItem', args=[TextComponent{text='[', siblings=[TextComponent{text='Iron Leggings', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}, TextComponent{text=']', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], style=Style{hasParent=true, color=§f, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}" at id stat.useItem.minecraft.iron_leggings

at net.minecraft.stats.StatBase.registerStat(StatBase.java:111) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at net.minecraft.stats.StatList.initStats(StatList.java:214) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at net.minecraft.stats.StatList.reinit(StatList.java:356) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at net.minecraftforge.common.ForgeModContainer.mappingChanged(ForgeModContainer.java:459) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_66]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_66]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_66]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:235) ~[LoadController.class:?]

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:213) [LoadController.class:?]

at net.minecraftforge.fml.common.Loader.fireRemapEvent(Loader.java:1026) [Loader.class:?]

at net.minecraftforge.fml.common.registry.PersistentRegistryManager.injectSnapshot(PersistentRegistryManager.java:302) ~[PersistentRegistryManager.class:?]

at net.minecraftforge.fml.common.FMLContainer.readData(FMLContainer.java:327) ~[FMLContainer.class:?]

at net.minecraftforge.fml.common.FMLCommonHandler.handleWorldDataLoad(FMLCommonHandler.java:418) [FMLCommonHandler.class:?]

at net.minecraft.world.storage.SaveFormatOld.loadAndFix(SaveFormatOld.java:125) ~[saveFormatOld.class:?]

at net.minecraft.world.storage.SaveHandler.loadWorldInfo(SaveHandler.java:140) ~[saveHandler.class:?]

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:75) ~[integratedServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:124) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:496) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_66]

[23:35:58] [server thread/ERROR] [FML]: A fatal exception occurred during the server starting event

java.lang.RuntimeException: Duplicate stat id: "TranslatableComponent{key='stat.useItem', args=[TextComponent{text='[', siblings=[TextComponent{text='Iron Leggings', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}, TextComponent{text=']', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], style=Style{hasParent=true, color=§f, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}" and "TranslatableComponent{key='stat.useItem', args=[TextComponent{text='[', siblings=[TextComponent{text='Iron Leggings', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}, TextComponent{text=']', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], style=Style{hasParent=true, color=§f, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:iron_leggings",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}" at id stat.useItem.minecraft.iron_leggings

at net.minecraft.stats.StatBase.registerStat(StatBase.java:111) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at net.minecraft.stats.StatList.initStats(StatList.java:214) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at net.minecraft.stats.StatList.reinit(StatList.java:356) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at net.minecraftforge.common.ForgeModContainer.mappingChanged(ForgeModContainer.java:459) ~[forgeSrc-1.10.2-12.18.0.2010.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_66]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_66]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_66]

at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]

at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]

at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:235) ~[LoadController.class:?]

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:213) ~[LoadController.class:?]

at net.minecraftforge.fml.common.Loader.fireRemapEvent(Loader.java:1026) [Loader.class:?]

at net.minecraftforge.fml.common.registry.PersistentRegistryManager.injectSnapshot(PersistentRegistryManager.java:302) ~[PersistentRegistryManager.class:?]

at net.minecraftforge.fml.common.FMLContainer.readData(FMLContainer.java:327) ~[FMLContainer.class:?]

at net.minecraftforge.fml.common.FMLCommonHandler.handleWorldDataLoad(FMLCommonHandler.java:418) [FMLCommonHandler.class:?]

at net.minecraft.world.storage.SaveFormatOld.loadAndFix(SaveFormatOld.java:125) ~[saveFormatOld.class:?]

at net.minecraft.world.storage.SaveHandler.loadWorldInfo(SaveHandler.java:140) ~[saveHandler.class:?]

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:75) ~[integratedServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:124) [integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:496) [MinecraftServer.class:?]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_66]

 

Thank you for reply :)

Posted

However you're registering your object is wrong, its getting a duplicate name instead of using your items registry name.

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

Dont know if that better, but same error...  :-[

String name = ((ResourceLocation)Item.REGISTRY.getNameForObject(itemold)).toString();
String newName = name.replaceFirst("minecraft:", "");
itemnew.setUnlocalizedName(newName);
itemnew.setRegistryName(new ResourceLocation(MFRMod.MODID, newName));
GameRegistry.addSubstitutionAlias(name, GameRegistry.Type.ITEM, itemnew);

 

freezing at loading :

6xCtuZx.png

 

and same error finished by :

[15:46:19] [server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded.

[15:46:19] [server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded.

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.