Custom Items (and further MC Items) in Trade?

Discuss Millénaire in English
Post Reply
UPR2000
Posts: 15
Joined: Sun Jul 07, 2013 5:40 pm

Custom Items (and further MC Items) in Trade?

Post by UPR2000 » Tue Jul 09, 2013 3:54 pm

How do I expand the shop lists - for example I want to sell apples to the villagers, and how can I trade custom items from other mods?
I tried adding apples into custom_traded_goods (in mods/millenaire_custom), into mods/millenaire i tried editing the byzantines (traded_goods and shops)
I also added apples in the itemlist.txt, but...

//Item key;item id;item meta;label (indicative only)
apple;260;0;Apple

In this case, what is an item key? since there's an ID, for which do I need a key and is it "apple" or is it another interpreter for the item ID?

A little help would be nice

greetings from germany ;)

//Edit:

Got it with apples now, but I still don't understand the item key (is it just an identifier for millenaire?)

And I still got the question - how do I implement custom Items (like Hop Ale from Growth Craft) into Millenaire?
(got the id - it's 5013)

But when I try to put all data into the 3 needed files (itemlist.txt, traded_goods.txt and townhall.txt) it just throws the following errors:

Code: Select all

Client> 2013-07-09 18:07:43 [INFO] [ForgeModLoader] CLIENT Tried creating InvItem with null id: 5013
Client> 2013-07-09 18:07:43 [INFO] [ForgeModLoader] CLIENT java.lang.Exception
Client> 	at org.millenaire.common.MillVillager$InvItem.<init>(MillVillager.java:122)
Client> 	at org.millenaire.common.item.Goods.loadGoodList(Goods.java:968)
Client> 	at org.millenaire.common.item.Goods.loadGoods(Goods.java:988)
Client> 	at org.millenaire.common.forge.Mill.load(Mill.java:701)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Client> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Client> 	at java.lang.reflect.Method.invoke(Unknown Source)
Client> 	at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
Client> 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
Client> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Client> 	at java.lang.reflect.Method.invoke(Unknown Source)
Client> 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
Client> 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
Client> 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
Client> 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
Client> 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
Client> 	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Client> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Client> 	at java.lang.reflect.Method.invoke(Unknown Source)
Client> 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
Client> 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
Client> 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
Client> 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
Client> 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
Client> 	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
Client> 	at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
Client> 	at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
Client> 	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:447)
Client> 	at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
Client> 	at net.minecraft.client.Minecraft.run(Minecraft.java:732)
Client> 	at java.lang.Thread.run(Unknown Source)
Client> 
Client> 2013-07-09 18:07:43 [INFO] [ForgeModLoader] CLIENT Exception, printing stack:
Client> 2013-07-09 18:07:43 [INFO] [ForgeModLoader] CLIENT java.lang.NullPointerException
Client> 	at net.minecraft.item.ItemStack.<init>(ItemStack.java:77)
Client> 	at org.millenaire.common.MillVillager$InvItem.<init>(MillVillager.java:127)
Client> 	at org.millenaire.common.item.Goods.loadGoodList(Goods.java:968)
Client> 	at org.millenaire.common.item.Goods.loadGoods(Goods.java:988)
Client> 	at org.millenaire.common.forge.Mill.load(Mill.java:701)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Client> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Client> 	at java.lang.reflect.Method.invoke(Unknown Source)
Client> 	at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)
Client> 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
Client> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Client> 	at java.lang.reflect.Method.invoke(Unknown Source)
Client> 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
Client> 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
Client> 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
Client> 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
Client> 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
Client> 	at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Client> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Client> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Client> 	at java.lang.reflect.Method.invoke(Unknown Source)
Client> 	at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
Client> 	at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
Client> 	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
Client> 	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
Client> 	at com.google.common.eventbus.EventBus.post(EventBus.java:267)
Client> 	at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
Client> 	at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
Client> 	at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)
Client> 	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:447)
Client> 	at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
Client> 	at net.minecraft.client.Minecraft.run(Minecraft.java:732)
Client> 	at java.lang.Thread.run(Unknown Source)
Client> 
Client> 2013-07-09 18:07:44 [INFO] [ForgeModLoader] CLIENT ERROR: Culture: byzantines: Unknown good on line: hop_ale,0,2*80,0,0,48,false,,0,tradehelp.genericfoodsweet
Client> 2013-07-09 18:07:44 [INFO] [ForgeModLoader] CLIENT ERROR: Culture: byzantines: Unknown good when loading shop townhall.txt: hop_ale
The game still starts, that's what's fascinating me actually ^^


//Edit:

I found the answer...
//Item key;item id;item meta;label (indicative only)
The Item key is a "mod readable name shorter" - for example I could rename my hops ale to hops_ale or hopsale
the label is indicative (for the user?)

My fault was forgetting to add the minecraft id's to my mod's item id ;)


1st entry in:
mods/millenaire/itemlist.txt:

Code: Select all

//Item key;item id;item meta;label (indicative only)
//Example Code! (my Item ID was 5013, after adding 256 minecraft item id's, the final id is 5269)
young_ale;5269;0;young_ale
2nd entry in:
mods/millenaire/cultures/byzantines/shops/townhall.txt

at the end of the line "buys" / "buysoptional" append

Code: Select all

buysoptional=....,young_ale
3rd entry in:
mods/millenaire/cultures/byzantines/traded_goods.txt

Code: Select all

//custom section (just for optional comment)
young_ale,0,2*64,0,0,48,false,,0,tradehelp.genericfoodsweet
As i think, everybody here knows how to find the minecraft folder, i only document from the mods folder on to save space^^

Post Reply