the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2
3#include "net.minecraft.locale.h"
4#include "net.minecraft.world.h"
5#include "net.minecraft.world.entity.h"
6#include "net.minecraft.world.entity.item.h"
7#include "net.minecraft.world.level.h"
8#include "net.minecraft.world.level.tile.h"
9#include "net.minecraft.world.item.h"
10#include "net.minecraft.world.item.alchemy.h"
11#include "net.minecraft.world.food.h"
12#include "net.minecraft.world.effect.h"
13#include "net.minecraft.stats.h"
14#include "MapItem.h"
15#include "Item.h"
16#include "HangingEntityItem.h"
17#include "HtmlString.h"
18
19typedef Item::Tier _Tier;
20
21//const UUID Item::BASE_ATTACK_DAMAGE_UUID = UUID::fromString(L"CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
22
23wstring Item::ICON_DESCRIPTION_PREFIX = L"item.";
24
25const _Tier *_Tier::WOOD = new _Tier(0, 59, 2, 0, 15); //
26const _Tier *_Tier::STONE = new _Tier(1, 131, 4, 1, 5); //
27const _Tier *_Tier::IRON = new _Tier(2, 250, 6, 2, 14); //
28const _Tier *_Tier::DIAMOND = new _Tier(3, 1561, 8, 3, 10); //
29const _Tier *_Tier::GOLD = new _Tier(0, 32, 12, 0, 22);
30
31Random *Item::random = new Random();
32
33ItemArray Item::items = ItemArray( ITEM_NUM_COUNT );
34
35Item *Item::shovel_iron = NULL;
36Item *Item::pickAxe_iron = NULL;
37Item *Item::hatchet_iron = NULL;
38Item *Item::flintAndSteel = NULL;
39Item *Item::apple = NULL;
40BowItem *Item::bow = NULL;
41Item *Item::arrow = NULL;
42Item *Item::coal = NULL;
43Item *Item::diamond = NULL;
44Item *Item::ironIngot = NULL;
45Item *Item::goldIngot = NULL;
46Item *Item::sword_iron = NULL;
47
48Item *Item::sword_wood = NULL;
49Item *Item::shovel_wood = NULL;
50Item *Item::pickAxe_wood = NULL;
51Item *Item::hatchet_wood = NULL;
52
53Item *Item::sword_stone = NULL;
54Item *Item::shovel_stone = NULL;
55Item *Item::pickAxe_stone = NULL;
56Item *Item::hatchet_stone = NULL;
57
58Item *Item::sword_diamond = NULL;
59Item *Item::shovel_diamond = NULL;
60Item *Item::pickAxe_diamond = NULL;
61Item *Item::hatchet_diamond = NULL;
62
63Item *Item::stick = NULL;
64Item *Item::bowl = NULL;
65Item *Item::mushroomStew = NULL;
66
67Item *Item::sword_gold = NULL;
68Item *Item::shovel_gold = NULL;
69Item *Item::pickAxe_gold = NULL;
70Item *Item::hatchet_gold = NULL;
71
72Item *Item::string = NULL;
73Item *Item::feather = NULL;
74Item *Item::gunpowder = NULL;
75
76Item *Item::hoe_wood = NULL;
77Item *Item::hoe_stone = NULL;
78Item *Item::hoe_iron = NULL;
79Item *Item::hoe_diamond = NULL;
80Item *Item::hoe_gold = NULL;
81
82Item *Item::seeds_wheat = NULL;
83Item *Item::wheat = NULL;
84Item *Item::bread = NULL;
85
86ArmorItem *Item::helmet_leather = NULL;
87ArmorItem *Item::chestplate_leather = NULL;
88ArmorItem *Item::leggings_leather = NULL;
89ArmorItem *Item::boots_leather = NULL;
90
91ArmorItem *Item::helmet_chain = NULL;
92ArmorItem *Item::chestplate_chain = NULL;
93ArmorItem *Item::leggings_chain = NULL;
94ArmorItem *Item::boots_chain = NULL;
95
96ArmorItem *Item::helmet_iron = NULL;
97ArmorItem *Item::chestplate_iron = NULL;
98ArmorItem *Item::leggings_iron = NULL;
99ArmorItem *Item::boots_iron = NULL;
100
101ArmorItem *Item::helmet_diamond = NULL;
102ArmorItem *Item::chestplate_diamond = NULL;
103ArmorItem *Item::leggings_diamond = NULL;
104ArmorItem *Item::boots_diamond = NULL;
105
106ArmorItem *Item::helmet_gold = NULL;
107ArmorItem *Item::chestplate_gold = NULL;
108ArmorItem *Item::leggings_gold = NULL;
109ArmorItem *Item::boots_gold = NULL;
110
111Item *Item::flint = NULL;
112Item *Item::porkChop_raw = NULL;
113Item *Item::porkChop_cooked = NULL;
114Item *Item::painting = NULL;
115
116Item *Item::apple_gold = NULL;
117
118Item *Item::sign = NULL;
119Item *Item::door_wood = NULL;
120
121Item *Item::bucket_empty = NULL;
122Item *Item::bucket_water = NULL;
123Item *Item::bucket_lava = NULL;
124
125Item *Item::minecart = NULL;
126Item *Item::saddle = NULL;
127Item *Item::door_iron = NULL;
128Item *Item::redStone = NULL;
129Item *Item::snowBall = NULL;
130
131Item *Item::boat = NULL;
132
133Item *Item::leather = NULL;
134Item *Item::bucket_milk = NULL;
135Item *Item::brick = NULL;
136Item *Item::clay = NULL;
137Item *Item::reeds = NULL;
138Item *Item::paper = NULL;
139Item *Item::book = NULL;
140Item *Item::slimeBall = NULL;
141Item *Item::minecart_chest = NULL;
142Item *Item::minecart_furnace = NULL;
143Item *Item::egg = NULL;
144Item *Item::compass = NULL;
145FishingRodItem *Item::fishingRod = NULL;
146Item *Item::clock = NULL;
147Item *Item::yellowDust = NULL;
148Item *Item::fish_raw = NULL;
149Item *Item::fish_cooked = NULL;
150
151Item *Item::dye_powder = NULL;
152Item *Item::bone = NULL;
153Item *Item::sugar = NULL;
154Item *Item::cake = NULL;
155
156Item *Item::bed = NULL;
157
158Item *Item::repeater = NULL;
159Item *Item::cookie = NULL;
160
161MapItem *Item::map = NULL;
162
163Item *Item::record_01 = NULL;
164Item *Item::record_02 = NULL;
165Item *Item::record_03 = NULL;
166Item *Item::record_04 = NULL;
167Item *Item::record_05 = NULL;
168Item *Item::record_06 = NULL;
169Item *Item::record_07 = NULL;
170Item *Item::record_08 = NULL;
171Item *Item::record_09 = NULL;
172Item *Item::record_10 = NULL;
173Item *Item::record_11 = NULL;
174Item *Item::record_12 = NULL;
175
176ShearsItem *Item::shears = NULL;
177
178Item *Item::melon = NULL;
179
180Item *Item::seeds_pumpkin = NULL;
181Item *Item::seeds_melon = NULL;
182
183Item *Item::beef_raw = NULL;
184Item *Item::beef_cooked = NULL;
185Item *Item::chicken_raw = NULL;
186Item *Item::chicken_cooked = NULL;
187Item *Item::rotten_flesh = NULL;
188
189Item *Item::enderPearl = NULL;
190
191Item *Item::blazeRod = NULL;
192Item *Item::ghastTear = NULL;
193Item *Item::goldNugget = NULL;
194Item *Item::netherwart_seeds = NULL;
195PotionItem *Item::potion = NULL;
196Item *Item::glassBottle = NULL;
197Item *Item::spiderEye = NULL;
198Item *Item::fermentedSpiderEye = NULL;
199Item *Item::blazePowder = NULL;
200Item *Item::magmaCream = NULL;
201Item *Item::brewingStand = NULL;
202Item *Item::cauldron = NULL;
203Item *Item::eyeOfEnder = NULL;
204Item *Item::speckledMelon = NULL;
205
206Item *Item::spawnEgg = NULL;
207
208Item *Item::expBottle = NULL;
209
210// TU9
211Item *Item::fireball = NULL;
212Item *Item::frame = NULL;
213
214Item *Item::skull = NULL;
215
216
217// TU14
218//Item *Item::writingBook = NULL;
219//Item *Item::writtenBook = NULL;
220
221Item *Item::emerald = NULL;
222
223Item *Item::flowerPot = NULL;
224
225Item *Item::carrots = NULL;
226Item *Item::potato = NULL;
227Item *Item::potatoBaked = NULL;
228Item *Item::potatoPoisonous = NULL;
229
230EmptyMapItem *Item::emptyMap = NULL;
231
232Item *Item::carrotGolden = NULL;
233
234Item *Item::carrotOnAStick = NULL;
235Item *Item::netherStar = NULL;
236Item *Item::pumpkinPie = NULL;
237Item *Item::fireworks = NULL;
238Item *Item::fireworksCharge = NULL;
239
240EnchantedBookItem *Item::enchantedBook = NULL;
241
242Item *Item::comparator = NULL;
243Item *Item::netherbrick = NULL;
244Item *Item::netherQuartz = NULL;
245Item *Item::minecart_tnt = NULL;
246Item *Item::minecart_hopper = NULL;
247
248Item *Item::horseArmorMetal = NULL;
249Item *Item::horseArmorGold = NULL;
250Item *Item::horseArmorDiamond = NULL;
251Item *Item::lead = NULL;
252Item *Item::nameTag = NULL;
253
254
255void Item::staticCtor()
256{
257 Item::sword_wood = ( new WeaponItem(12, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_wood) ->setIconName(L"swordWood")->setDescriptionId(IDS_ITEM_SWORD_WOOD)->setUseDescriptionId(IDS_DESC_SWORD);
258 Item::sword_stone = ( new WeaponItem(16, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_stone) ->setIconName(L"swordStone")->setDescriptionId(IDS_ITEM_SWORD_STONE)->setUseDescriptionId(IDS_DESC_SWORD);
259 Item::sword_iron = ( new WeaponItem(11, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_iron) ->setIconName(L"swordIron")->setDescriptionId(IDS_ITEM_SWORD_IRON)->setUseDescriptionId(IDS_DESC_SWORD);
260 Item::sword_diamond = ( new WeaponItem(20, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_diamond) ->setIconName(L"swordDiamond")->setDescriptionId(IDS_ITEM_SWORD_DIAMOND)->setUseDescriptionId(IDS_DESC_SWORD);
261 Item::sword_gold = ( new WeaponItem(27, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_gold) ->setIconName(L"swordGold")->setDescriptionId(IDS_ITEM_SWORD_GOLD)->setUseDescriptionId(IDS_DESC_SWORD);
262
263 Item::shovel_wood = ( new ShovelItem(13, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_wood) ->setIconName(L"shovelWood")->setDescriptionId(IDS_ITEM_SHOVEL_WOOD)->setUseDescriptionId(IDS_DESC_SHOVEL);
264 Item::shovel_stone = ( new ShovelItem(17, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_stone) ->setIconName(L"shovelStone")->setDescriptionId(IDS_ITEM_SHOVEL_STONE)->setUseDescriptionId(IDS_DESC_SHOVEL);
265 Item::shovel_iron = ( new ShovelItem(0, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_iron) ->setIconName(L"shovelIron")->setDescriptionId(IDS_ITEM_SHOVEL_IRON)->setUseDescriptionId(IDS_DESC_SHOVEL);
266 Item::shovel_diamond = ( new ShovelItem(21, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_diamond) ->setIconName(L"shovelDiamond")->setDescriptionId(IDS_ITEM_SHOVEL_DIAMOND)->setUseDescriptionId(IDS_DESC_SHOVEL);
267 Item::shovel_gold = ( new ShovelItem(28, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_gold) ->setIconName(L"shovelGold")->setDescriptionId(IDS_ITEM_SHOVEL_GOLD)->setUseDescriptionId(IDS_DESC_SHOVEL);
268
269 Item::pickAxe_wood = ( new PickaxeItem(14, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_wood) ->setIconName(L"pickaxeWood")->setDescriptionId(IDS_ITEM_PICKAXE_WOOD)->setUseDescriptionId(IDS_DESC_PICKAXE);
270 Item::pickAxe_stone = ( new PickaxeItem(18, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_stone) ->setIconName(L"pickaxeStone")->setDescriptionId(IDS_ITEM_PICKAXE_STONE)->setUseDescriptionId(IDS_DESC_PICKAXE);
271 Item::pickAxe_iron = ( new PickaxeItem(1, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_iron) ->setIconName(L"pickaxeIron")->setDescriptionId(IDS_ITEM_PICKAXE_IRON)->setUseDescriptionId(IDS_DESC_PICKAXE);
272 Item::pickAxe_diamond = ( new PickaxeItem(22, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_diamond) ->setIconName(L"pickaxeDiamond")->setDescriptionId(IDS_ITEM_PICKAXE_DIAMOND)->setUseDescriptionId(IDS_DESC_PICKAXE);
273 Item::pickAxe_gold = ( new PickaxeItem(29, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_gold) ->setIconName(L"pickaxeGold")->setDescriptionId(IDS_ITEM_PICKAXE_GOLD)->setUseDescriptionId(IDS_DESC_PICKAXE);
274
275 Item::hatchet_wood = ( new HatchetItem(15, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_wood) ->setIconName(L"hatchetWood")->setDescriptionId(IDS_ITEM_HATCHET_WOOD)->setUseDescriptionId(IDS_DESC_HATCHET);
276 Item::hatchet_stone = ( new HatchetItem(19, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_stone) ->setIconName(L"hatchetStone")->setDescriptionId(IDS_ITEM_HATCHET_STONE)->setUseDescriptionId(IDS_DESC_HATCHET);
277 Item::hatchet_iron = ( new HatchetItem(2, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_iron) ->setIconName(L"hatchetIron")->setDescriptionId(IDS_ITEM_HATCHET_IRON)->setUseDescriptionId(IDS_DESC_HATCHET);
278 Item::hatchet_diamond = ( new HatchetItem(23, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_diamond) ->setIconName(L"hatchetDiamond")->setDescriptionId(IDS_ITEM_HATCHET_DIAMOND)->setUseDescriptionId(IDS_DESC_HATCHET);
279 Item::hatchet_gold = ( new HatchetItem(30, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_gold) ->setIconName(L"hatchetGold")->setDescriptionId(IDS_ITEM_HATCHET_GOLD)->setUseDescriptionId(IDS_DESC_HATCHET);
280
281 Item::hoe_wood = ( new HoeItem(34, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_wood) ->setIconName(L"hoeWood")->setDescriptionId(IDS_ITEM_HOE_WOOD)->setUseDescriptionId(IDS_DESC_HOE);
282 Item::hoe_stone = ( new HoeItem(35, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_stone) ->setIconName(L"hoeStone")->setDescriptionId(IDS_ITEM_HOE_STONE)->setUseDescriptionId(IDS_DESC_HOE);
283 Item::hoe_iron = ( new HoeItem(36, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_iron) ->setIconName(L"hoeIron")->setDescriptionId(IDS_ITEM_HOE_IRON)->setUseDescriptionId(IDS_DESC_HOE);
284 Item::hoe_diamond = ( new HoeItem(37, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_diamond) ->setIconName(L"hoeDiamond")->setDescriptionId(IDS_ITEM_HOE_DIAMOND)->setUseDescriptionId(IDS_DESC_HOE);
285 Item::hoe_gold = ( new HoeItem(38, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_gold) ->setIconName(L"hoeGold")->setDescriptionId(IDS_ITEM_HOE_GOLD)->setUseDescriptionId(IDS_DESC_HOE);
286
287 Item::door_wood = ( new DoorItem(68, Material::wood) ) ->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_wood)->setIconName(L"doorWood")->setDescriptionId(IDS_ITEM_DOOR_WOOD)->setUseDescriptionId(IDS_DESC_DOOR_WOOD);
288 Item::door_iron = ( new DoorItem(74, Material::metal) ) ->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_iron)->setIconName(L"doorIron")->setDescriptionId(IDS_ITEM_DOOR_IRON)->setUseDescriptionId(IDS_DESC_DOOR_IRON);
289
290 Item::helmet_leather = (ArmorItem *) ( ( new ArmorItem(42, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_cloth) ->setIconName(L"helmetCloth")->setDescriptionId(IDS_ITEM_HELMET_CLOTH)->setUseDescriptionId(IDS_DESC_HELMET_LEATHER) );
291 Item::helmet_iron = (ArmorItem *) ( ( new ArmorItem(50, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_iron) ->setIconName(L"helmetIron")->setDescriptionId(IDS_ITEM_HELMET_IRON)->setUseDescriptionId(IDS_DESC_HELMET_IRON) );
292 Item::helmet_diamond = (ArmorItem *) ( ( new ArmorItem(54, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_diamond) ->setIconName(L"helmetDiamond")->setDescriptionId(IDS_ITEM_HELMET_DIAMOND)->setUseDescriptionId(IDS_DESC_HELMET_DIAMOND) );
293 Item::helmet_gold = (ArmorItem *) ( ( new ArmorItem(58, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_gold) ->setIconName(L"helmetGold")->setDescriptionId(IDS_ITEM_HELMET_GOLD)->setUseDescriptionId(IDS_DESC_HELMET_GOLD) );
294
295 Item::chestplate_leather = (ArmorItem *) ( ( new ArmorItem(43, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_cloth) ->setIconName(L"chestplateCloth")->setDescriptionId(IDS_ITEM_CHESTPLATE_CLOTH)->setUseDescriptionId(IDS_DESC_CHESTPLATE_LEATHER) );
296 Item::chestplate_iron = (ArmorItem *) ( ( new ArmorItem(51, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_iron) ->setIconName(L"chestplateIron")->setDescriptionId(IDS_ITEM_CHESTPLATE_IRON)->setUseDescriptionId(IDS_DESC_CHESTPLATE_IRON) );
297 Item::chestplate_diamond = (ArmorItem *) ( ( new ArmorItem(55, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_diamond) ->setIconName(L"chestplateDiamond")->setDescriptionId(IDS_ITEM_CHESTPLATE_DIAMOND)->setUseDescriptionId(IDS_DESC_CHESTPLATE_DIAMOND) );
298 Item::chestplate_gold = (ArmorItem *) ( ( new ArmorItem(59, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_gold) ->setIconName(L"chestplateGold")->setDescriptionId(IDS_ITEM_CHESTPLATE_GOLD)->setUseDescriptionId(IDS_DESC_CHESTPLATE_GOLD) );
299
300 Item::leggings_leather = (ArmorItem *) ( ( new ArmorItem(44, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_cloth) ->setIconName(L"leggingsCloth")->setDescriptionId(IDS_ITEM_LEGGINGS_CLOTH)->setUseDescriptionId(IDS_DESC_LEGGINGS_LEATHER) );
301 Item::leggings_iron = (ArmorItem *) ( ( new ArmorItem(52, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_iron) ->setIconName(L"leggingsIron")->setDescriptionId(IDS_ITEM_LEGGINGS_IRON)->setUseDescriptionId(IDS_DESC_LEGGINGS_IRON) );
302 Item::leggings_diamond = (ArmorItem *) ( ( new ArmorItem(56, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_diamond) ->setIconName(L"leggingsDiamond")->setDescriptionId(IDS_ITEM_LEGGINGS_DIAMOND)->setUseDescriptionId(IDS_DESC_LEGGINGS_DIAMOND) );
303 Item::leggings_gold = (ArmorItem *) ( ( new ArmorItem(60, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_gold) ->setIconName(L"leggingsGold")->setDescriptionId(IDS_ITEM_LEGGINGS_GOLD)->setUseDescriptionId(IDS_DESC_LEGGINGS_GOLD) );
304
305 Item::helmet_chain = (ArmorItem *) ( ( new ArmorItem(46, ArmorItem::ArmorMaterial::CHAIN, 1, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_chain) ->setIconName(L"helmetChain")->setDescriptionId(IDS_ITEM_HELMET_CHAIN)->setUseDescriptionId(IDS_DESC_HELMET_CHAIN) );
306 Item::chestplate_chain = (ArmorItem *) ( ( new ArmorItem(47, ArmorItem::ArmorMaterial::CHAIN, 1, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_chain) ->setIconName(L"chestplateChain")->setDescriptionId(IDS_ITEM_CHESTPLATE_CHAIN)->setUseDescriptionId(IDS_DESC_CHESTPLATE_CHAIN) );
307 Item::leggings_chain = (ArmorItem *) ( ( new ArmorItem(48, ArmorItem::ArmorMaterial::CHAIN, 1, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_chain) ->setIconName(L"leggingsChain")->setDescriptionId(IDS_ITEM_LEGGINGS_CHAIN)->setUseDescriptionId(IDS_DESC_LEGGINGS_CHAIN) );
308 Item::boots_chain = (ArmorItem *) ( ( new ArmorItem(49, ArmorItem::ArmorMaterial::CHAIN, 1, ArmorItem::SLOT_FEET) ) ->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_chain) ->setIconName(L"bootsChain")->setDescriptionId(IDS_ITEM_BOOTS_CHAIN)->setUseDescriptionId(IDS_DESC_BOOTS_CHAIN) );
309
310 Item::boots_leather = (ArmorItem *) ( ( new ArmorItem(45, ArmorItem::ArmorMaterial::CLOTH, 0, ArmorItem::SLOT_FEET) ) ->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_cloth) ->setIconName(L"bootsCloth")->setDescriptionId(IDS_ITEM_BOOTS_CLOTH)->setUseDescriptionId(IDS_DESC_BOOTS_LEATHER) );
311 Item::boots_iron = (ArmorItem *) ( ( new ArmorItem(53, ArmorItem::ArmorMaterial::IRON, 2, ArmorItem::SLOT_FEET) ) ->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_iron) ->setIconName(L"bootsIron")->setDescriptionId(IDS_ITEM_BOOTS_IRON)->setUseDescriptionId(IDS_DESC_BOOTS_IRON) );
312 Item::boots_diamond = (ArmorItem *) ( ( new ArmorItem(57, ArmorItem::ArmorMaterial::DIAMOND, 3, ArmorItem::SLOT_FEET) ) ->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_diamond) ->setIconName(L"bootsDiamond")->setDescriptionId(IDS_ITEM_BOOTS_DIAMOND)->setUseDescriptionId(IDS_DESC_BOOTS_DIAMOND) );
313 Item::boots_gold = (ArmorItem *) ( ( new ArmorItem(61, ArmorItem::ArmorMaterial::GOLD, 4, ArmorItem::SLOT_FEET) ) ->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_gold) ->setIconName(L"bootsGold")->setDescriptionId(IDS_ITEM_BOOTS_GOLD)->setUseDescriptionId(IDS_DESC_BOOTS_GOLD) );
314
315 Item::ironIngot = ( new Item(9) )->setIconName(L"ingotIron") ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_iron)->setDescriptionId(IDS_ITEM_INGOT_IRON)->setUseDescriptionId(IDS_DESC_INGOT);
316 Item::goldIngot = ( new Item(10) )->setIconName(L"ingotGold") ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_gold)->setDescriptionId(IDS_ITEM_INGOT_GOLD)->setUseDescriptionId(IDS_DESC_INGOT);
317
318
319 // 4J-PB - todo - add materials and base types to the ones below
320 Item::bucket_empty = ( new BucketItem(69, 0) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_water)->setIconName(L"bucket")->setDescriptionId(IDS_ITEM_BUCKET)->setUseDescriptionId(IDS_DESC_BUCKET)->setMaxStackSize(16);
321 Item::bowl = ( new Item(25) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_wood)->setIconName(L"bowl")->setDescriptionId(IDS_ITEM_BOWL)->setUseDescriptionId(IDS_DESC_BOWL)->setMaxStackSize(64);
322
323 Item::bucket_water = ( new BucketItem(70, Tile::water_Id) ) ->setIconName(L"bucketWater")->setDescriptionId(IDS_ITEM_BUCKET_WATER)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_WATER);
324 Item::bucket_lava = ( new BucketItem(71, Tile::lava_Id) ) ->setIconName(L"bucketLava")->setDescriptionId(IDS_ITEM_BUCKET_LAVA)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_LAVA);
325 Item::bucket_milk = ( new MilkBucketItem(79) )->setIconName(L"milk")->setDescriptionId(IDS_ITEM_BUCKET_MILK)->setCraftingRemainingItem(Item::bucket_empty)->setUseDescriptionId(IDS_DESC_BUCKET_MILK);
326
327 Item::bow = (BowItem *)( new BowItem(5) ) ->setIconName(L"bow")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_bow) ->setDescriptionId(IDS_ITEM_BOW)->setUseDescriptionId(IDS_DESC_BOW);
328 Item::arrow = ( new Item(6) ) ->setIconName(L"arrow")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_arrow) ->setDescriptionId(IDS_ITEM_ARROW)->setUseDescriptionId(IDS_DESC_ARROW);
329
330 Item::compass = ( new CompassItem(89) ) ->setIconName(L"compass")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_compass) ->setDescriptionId(IDS_ITEM_COMPASS)->setUseDescriptionId(IDS_DESC_COMPASS);
331 Item::clock = ( new ClockItem(91) ) ->setIconName(L"clock")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_clock) ->setDescriptionId(IDS_ITEM_CLOCK)->setUseDescriptionId(IDS_DESC_CLOCK);
332 Item::map = (MapItem *) ( new MapItem(102) ) ->setIconName(L"map")->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_map) ->setDescriptionId(IDS_ITEM_MAP)->setUseDescriptionId(IDS_DESC_MAP);
333
334 Item::flintAndSteel = ( new FlintAndSteelItem(3) ) ->setIconName(L"flintAndSteel")->setBaseItemTypeAndMaterial(eBaseItemType_devicetool, eMaterial_flintandsteel)->setDescriptionId(IDS_ITEM_FLINT_AND_STEEL)->setUseDescriptionId(IDS_DESC_FLINTANDSTEEL);
335 Item::apple = ( new FoodItem(4, 4, FoodConstants::FOOD_SATURATION_LOW, false) ) ->setIconName(L"apple")->setDescriptionId(IDS_ITEM_APPLE)->setUseDescriptionId(IDS_DESC_APPLE);
336 Item::coal = ( new CoalItem(7) ) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_coal)->setIconName(L"coal")->setDescriptionId(IDS_ITEM_COAL)->setUseDescriptionId(IDS_DESC_COAL);
337 Item::diamond = ( new Item(8) ) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_diamond)->setIconName(L"diamond")->setDescriptionId(IDS_ITEM_DIAMOND)->setUseDescriptionId(IDS_DESC_DIAMONDS);
338 Item::stick = ( new Item(24) ) ->setIconName(L"stick")->handEquipped()->setDescriptionId(IDS_ITEM_STICK)->setUseDescriptionId(IDS_DESC_STICK);
339 Item::mushroomStew = ( new BowlFoodItem(26, 6) ) ->setIconName(L"mushroomStew")->setDescriptionId(IDS_ITEM_MUSHROOM_STEW)->setUseDescriptionId(IDS_DESC_MUSHROOMSTEW);
340
341 Item::string = ( new TilePlanterItem(31, Tile::tripWire) ) ->setIconName(L"string")->setDescriptionId(IDS_ITEM_STRING)->setUseDescriptionId(IDS_DESC_STRING);
342 Item::feather = ( new Item(32) ) ->setIconName(L"feather")->setDescriptionId(IDS_ITEM_FEATHER)->setUseDescriptionId(IDS_DESC_FEATHER);
343 Item::gunpowder = ( new Item(33) ) ->setIconName(L"sulphur")->setDescriptionId(IDS_ITEM_SULPHUR)->setUseDescriptionId(IDS_DESC_SULPHUR)->setPotionBrewingFormula(PotionBrewing::MOD_GUNPOWDER);
344
345
346 Item::seeds_wheat = ( new SeedItem(39, Tile::wheat_Id, Tile::farmland_Id) ) ->setIconName(L"seeds")->setDescriptionId(IDS_ITEM_WHEAT_SEEDS)->setUseDescriptionId(IDS_DESC_WHEAT_SEEDS);
347 Item::wheat = ( new Item(40) ) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_wheat)->setIconName(L"wheat")->setDescriptionId(IDS_ITEM_WHEAT)->setUseDescriptionId(IDS_DESC_WHEAT);
348 Item::bread = ( new FoodItem(41, 5, FoodConstants::FOOD_SATURATION_NORMAL, false) ) ->setIconName(L"bread")->setDescriptionId(IDS_ITEM_BREAD)->setUseDescriptionId(IDS_DESC_BREAD);
349
350
351 Item::flint = ( new Item(62) ) ->setIconName(L"flint")->setDescriptionId(IDS_ITEM_FLINT)->setUseDescriptionId(IDS_DESC_FLINT);
352 Item::porkChop_raw = ( new FoodItem(63, 3, FoodConstants::FOOD_SATURATION_LOW, true) ) ->setIconName(L"porkchopRaw")->setDescriptionId(IDS_ITEM_PORKCHOP_RAW)->setUseDescriptionId(IDS_DESC_PORKCHOP_RAW);
353 Item::porkChop_cooked = ( new FoodItem(64, 8, FoodConstants::FOOD_SATURATION_GOOD, true) ) ->setIconName(L"porkchopCooked")->setDescriptionId(IDS_ITEM_PORKCHOP_COOKED)->setUseDescriptionId(IDS_DESC_PORKCHOP_COOKED);
354 Item::painting = ( new HangingEntityItem(65,eTYPE_PAINTING) ) ->setBaseItemTypeAndMaterial(eBaseItemType_HangingItem, eMaterial_cloth)->setIconName(L"painting")->setDescriptionId(IDS_ITEM_PAINTING)->setUseDescriptionId(IDS_DESC_PICTURE);
355
356 Item::apple_gold = ( new GoldenAppleItem(66, 4, FoodConstants::FOOD_SATURATION_SUPERNATURAL, false) )->setCanAlwaysEat()->setEatEffect(MobEffect::regeneration->id, 5, 1, 1.0f)
357 ->setBaseItemTypeAndMaterial(eBaseItemType_giltFruit,eMaterial_apple)->setIconName(L"appleGold")->setDescriptionId(IDS_ITEM_APPLE_GOLD);//->setUseDescriptionId(IDS_DESC_GOLDENAPPLE);
358
359 Item::sign = ( new SignItem(67) ) ->setBaseItemTypeAndMaterial(eBaseItemType_HangingItem, eMaterial_wood)->setIconName(L"sign")->setDescriptionId(IDS_ITEM_SIGN)->setUseDescriptionId(IDS_DESC_SIGN);
360
361
362
363 Item::minecart = ( new MinecartItem(72, Minecart::TYPE_RIDEABLE) ) ->setIconName(L"minecart")->setDescriptionId(IDS_ITEM_MINECART)->setUseDescriptionId(IDS_DESC_MINECART);
364 Item::saddle = ( new SaddleItem(73) ) ->setIconName(L"saddle")->setDescriptionId(IDS_ITEM_SADDLE)->setUseDescriptionId(IDS_DESC_SADDLE);
365 Item::redStone = ( new RedStoneItem(75) ) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_redstone)->setIconName(L"redstone")->setDescriptionId(IDS_ITEM_REDSTONE)->setUseDescriptionId(IDS_DESC_REDSTONE_DUST)->setPotionBrewingFormula(PotionBrewing::MOD_REDSTONE);
366 Item::snowBall = ( new SnowballItem(76) ) ->setIconName(L"snowball")->setDescriptionId(IDS_ITEM_SNOWBALL)->setUseDescriptionId(IDS_DESC_SNOWBALL);
367
368 Item::boat = ( new BoatItem(77) ) ->setIconName(L"boat")->setDescriptionId(IDS_ITEM_BOAT)->setUseDescriptionId(IDS_DESC_BOAT);
369
370 Item::leather = ( new Item(78) ) ->setIconName(L"leather")->setDescriptionId(IDS_ITEM_LEATHER)->setUseDescriptionId(IDS_DESC_LEATHER);
371 Item::brick = ( new Item(80) ) ->setIconName(L"brick")->setDescriptionId(IDS_ITEM_BRICK)->setUseDescriptionId(IDS_DESC_BRICK);
372 Item::clay = ( new Item(81) ) ->setIconName(L"clay")->setDescriptionId(IDS_ITEM_CLAY)->setUseDescriptionId(IDS_DESC_CLAY);
373 Item::reeds = ( new TilePlanterItem(82, Tile::reeds) ) ->setIconName(L"reeds")->setDescriptionId(IDS_ITEM_REEDS)->setUseDescriptionId(IDS_DESC_REEDS);
374 Item::paper = ( new Item(83) ) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_paper, Item::eMaterial_paper)->setIconName(L"paper")->setDescriptionId(IDS_ITEM_PAPER)->setUseDescriptionId(IDS_DESC_PAPER);
375 Item::book = ( new BookItem(84) ) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_paper, Item::eMaterial_book)->setIconName(L"book")->setDescriptionId(IDS_ITEM_BOOK)->setUseDescriptionId(IDS_DESC_BOOK);
376 Item::slimeBall = ( new Item(85) ) ->setIconName(L"slimeball")->setDescriptionId(IDS_ITEM_SLIMEBALL)->setUseDescriptionId(IDS_DESC_SLIMEBALL);
377 Item::minecart_chest = ( new MinecartItem(86, Minecart::TYPE_CHEST) ) ->setIconName(L"minecart_chest")->setDescriptionId(IDS_ITEM_MINECART_CHEST)->setUseDescriptionId(IDS_DESC_MINECARTWITHCHEST);
378 Item::minecart_furnace = ( new MinecartItem(87, Minecart::TYPE_FURNACE) )->setIconName(L"minecart_furnace")->setDescriptionId(IDS_ITEM_MINECART_FURNACE)->setUseDescriptionId(IDS_DESC_MINECARTWITHFURNACE);
379 Item::egg = ( new EggItem(88) ) ->setIconName(L"egg")->setDescriptionId(IDS_ITEM_EGG)->setUseDescriptionId(IDS_DESC_EGG);
380 Item::fishingRod = (FishingRodItem *)( new FishingRodItem(90) ) ->setBaseItemTypeAndMaterial(eBaseItemType_rod, eMaterial_wood)->setIconName(L"fishingRod")->setDescriptionId(IDS_ITEM_FISHING_ROD)->setUseDescriptionId(IDS_DESC_FISHINGROD);
381 Item::yellowDust = ( new Item(92) ) ->setIconName(L"yellowDust")->setDescriptionId(IDS_ITEM_YELLOW_DUST)->setUseDescriptionId(IDS_DESC_YELLOW_DUST)->setPotionBrewingFormula(PotionBrewing::MOD_GLOWSTONE);
382 Item::fish_raw = ( new FoodItem(93, 2, FoodConstants::FOOD_SATURATION_LOW, false) ) ->setIconName(L"fishRaw")->setDescriptionId(IDS_ITEM_FISH_RAW)->setUseDescriptionId(IDS_DESC_FISH_RAW);
383 Item::fish_cooked = ( new FoodItem(94, 5, FoodConstants::FOOD_SATURATION_NORMAL, false) ) ->setIconName(L"fishCooked")->setDescriptionId(IDS_ITEM_FISH_COOKED)->setUseDescriptionId(IDS_DESC_FISH_COOKED);
384
385 Item::dye_powder = ( new DyePowderItem(95) ) ->setBaseItemTypeAndMaterial(eBaseItemType_dyepowder, eMaterial_dye)->setIconName(L"dyePowder")->setDescriptionId(IDS_ITEM_DYE_POWDER)->setUseDescriptionId(-1);
386
387 Item::bone = ( new Item(96) ) ->setIconName(L"bone")->setDescriptionId(IDS_ITEM_BONE)->handEquipped()->setUseDescriptionId(IDS_DESC_BONE);
388 Item::sugar = ( new Item(97) ) ->setIconName(L"sugar")->setDescriptionId(IDS_ITEM_SUGAR)->setUseDescriptionId(IDS_DESC_SUGAR)->setPotionBrewingFormula(PotionBrewing::MOD_SUGAR);
389 // 4J-PB - changing the cake to be stackable - Jens ok'ed this 23/10/12
390 //Item::cake = ( new TilePlanterItem(98, Tile::cake) )->setMaxStackSize(1)->setIcon(13, 1)->setDescriptionId(IDS_ITEM_CAKE)->setUseDescriptionId(IDS_DESC_CAKE);
391 Item::cake = ( new TilePlanterItem(98, Tile::cake) ) ->setIconName(L"cake")->setDescriptionId(IDS_ITEM_CAKE)->setUseDescriptionId(IDS_DESC_CAKE);
392
393 Item::bed = ( new BedItem(99) ) ->setMaxStackSize(1)->setIconName(L"bed")->setDescriptionId(IDS_ITEM_BED)->setUseDescriptionId(IDS_DESC_BED);
394
395 Item::repeater = ( new TilePlanterItem(100, (Tile *)Tile::diode_off) ) ->setIconName(L"diode")->setDescriptionId(IDS_ITEM_DIODE)->setUseDescriptionId(IDS_DESC_REDSTONEREPEATER);
396 Item::cookie = ( new FoodItem(101, 2, FoodConstants::FOOD_SATURATION_POOR, false) ) ->setIconName(L"cookie")->setDescriptionId(IDS_ITEM_COOKIE)->setUseDescriptionId(IDS_DESC_COOKIE);
397
398
399 Item::shears = (ShearsItem *)( new ShearsItem(103) ) ->setIconName(L"shears")->setBaseItemTypeAndMaterial(eBaseItemType_devicetool, eMaterial_shears)->setDescriptionId(IDS_ITEM_SHEARS)->setUseDescriptionId(IDS_DESC_SHEARS);
400
401 Item::melon = (new FoodItem(104, 2, FoodConstants::FOOD_SATURATION_LOW, false)) ->setIconName(L"melon")->setDescriptionId(IDS_ITEM_MELON_SLICE)->setUseDescriptionId(IDS_DESC_MELON_SLICE);
402
403 Item::seeds_pumpkin = (new SeedItem(105, Tile::pumpkinStem_Id, Tile::farmland_Id)) ->setIconName(L"seeds_pumpkin")->setBaseItemTypeAndMaterial(eBaseItemType_seed, eMaterial_pumpkin)->setDescriptionId(IDS_ITEM_PUMPKIN_SEEDS)->setUseDescriptionId(IDS_DESC_PUMPKIN_SEEDS);
404 Item::seeds_melon = (new SeedItem(106, Tile::melonStem_Id, Tile::farmland_Id)) ->setIconName(L"seeds_melon")->setBaseItemTypeAndMaterial(eBaseItemType_seed, eMaterial_melon)->setDescriptionId(IDS_ITEM_MELON_SEEDS)->setUseDescriptionId(IDS_DESC_MELON_SEEDS);
405
406 Item::beef_raw = (new FoodItem(107, 3, FoodConstants::FOOD_SATURATION_LOW, true)) ->setIconName(L"beefRaw")->setDescriptionId(IDS_ITEM_BEEF_RAW)->setUseDescriptionId(IDS_DESC_BEEF_RAW);
407 Item::beef_cooked = (new FoodItem(108, 8, FoodConstants::FOOD_SATURATION_GOOD, true))->setIconName(L"beefCooked")->setDescriptionId(IDS_ITEM_BEEF_COOKED)->setUseDescriptionId(IDS_DESC_BEEF_COOKED);
408 Item::chicken_raw = (new FoodItem(109, 2, FoodConstants::FOOD_SATURATION_LOW, true))->setEatEffect(MobEffect::hunger->id, 30, 0, .3f)->setIconName(L"chickenRaw")->setDescriptionId(IDS_ITEM_CHICKEN_RAW)->setUseDescriptionId(IDS_DESC_CHICKEN_RAW);
409 Item::chicken_cooked = (new FoodItem(110, 6, FoodConstants::FOOD_SATURATION_NORMAL, true))->setIconName(L"chickenCooked")->setDescriptionId(IDS_ITEM_CHICKEN_COOKED)->setUseDescriptionId(IDS_DESC_CHICKEN_COOKED);
410 Item::rotten_flesh = (new FoodItem(111, 4, FoodConstants::FOOD_SATURATION_POOR, true))->setEatEffect(MobEffect::hunger->id, 30, 0, .8f)->setIconName(L"rottenFlesh")->setDescriptionId(IDS_ITEM_ROTTEN_FLESH)->setUseDescriptionId(IDS_DESC_ROTTEN_FLESH);
411
412 Item::enderPearl = (new EnderpearlItem(112)) ->setIconName(L"enderPearl")->setDescriptionId(IDS_ITEM_ENDER_PEARL)->setUseDescriptionId(IDS_DESC_ENDER_PEARL);
413
414 Item::blazeRod = (new Item(113) ) ->setIconName(L"blazeRod")->setDescriptionId(IDS_ITEM_BLAZE_ROD)->setUseDescriptionId(IDS_DESC_BLAZE_ROD)->handEquipped();
415 Item::ghastTear = (new Item(114) ) ->setIconName(L"ghastTear")->setDescriptionId(IDS_ITEM_GHAST_TEAR)->setUseDescriptionId(IDS_DESC_GHAST_TEAR)->setPotionBrewingFormula(PotionBrewing::MOD_GHASTTEARS);
416 Item::goldNugget = (new Item(115) ) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_gold)->setIconName(L"goldNugget")->setDescriptionId(IDS_ITEM_GOLD_NUGGET)->setUseDescriptionId(IDS_DESC_GOLD_NUGGET);
417
418 Item::netherwart_seeds = (new SeedItem(116, Tile::netherStalk_Id, Tile::soulsand_Id) ) ->setIconName(L"netherStalkSeeds")->setDescriptionId(IDS_ITEM_NETHER_STALK_SEEDS)->setUseDescriptionId(IDS_DESC_NETHER_STALK_SEEDS)->setPotionBrewingFormula(PotionBrewing::MOD_NETHERWART);
419
420 Item::potion = (PotionItem *) ( ( new PotionItem(117) ) ->setIconName(L"potion")->setDescriptionId(IDS_ITEM_POTION)->setUseDescriptionId(IDS_DESC_POTION) );
421 Item::glassBottle = (new BottleItem(118) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_glass)->setIconName(L"glassBottle")->setDescriptionId(IDS_ITEM_GLASS_BOTTLE)->setUseDescriptionId(IDS_DESC_GLASS_BOTTLE);
422
423 Item::spiderEye = (new FoodItem(119, 2, FoodConstants::FOOD_SATURATION_GOOD, false) ) ->setEatEffect(MobEffect::poison->id, 5, 0, 1.0f)->setIconName(L"spiderEye")->setDescriptionId(IDS_ITEM_SPIDER_EYE)->setUseDescriptionId(IDS_DESC_SPIDER_EYE)->setPotionBrewingFormula(PotionBrewing::MOD_SPIDEREYE);
424 Item::fermentedSpiderEye = (new Item(120) ) ->setIconName(L"fermentedSpiderEye")->setDescriptionId(IDS_ITEM_FERMENTED_SPIDER_EYE)->setUseDescriptionId(IDS_DESC_FERMENTED_SPIDER_EYE)->setPotionBrewingFormula(PotionBrewing::MOD_FERMENTEDEYE);
425
426 Item::blazePowder = (new Item(121) ) ->setIconName(L"blazePowder")->setDescriptionId(IDS_ITEM_BLAZE_POWDER)->setUseDescriptionId(IDS_DESC_BLAZE_POWDER)->setPotionBrewingFormula(PotionBrewing::MOD_BLAZEPOWDER);
427 Item::magmaCream = (new Item(122) ) ->setIconName(L"magmaCream")->setDescriptionId(IDS_ITEM_MAGMA_CREAM)->setUseDescriptionId(IDS_DESC_MAGMA_CREAM)->setPotionBrewingFormula(PotionBrewing::MOD_MAGMACREAM);
428
429 Item::brewingStand = (new TilePlanterItem(123, Tile::brewingStand) ) ->setBaseItemTypeAndMaterial(eBaseItemType_device, eMaterial_blaze)->setIconName(L"brewingStand")->setDescriptionId(IDS_ITEM_BREWING_STAND)->setUseDescriptionId(IDS_DESC_BREWING_STAND);
430 Item::cauldron = (new TilePlanterItem(124, Tile::cauldron) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_iron)->setIconName(L"cauldron")->setDescriptionId(IDS_ITEM_CAULDRON)->setUseDescriptionId(IDS_DESC_CAULDRON);
431 Item::eyeOfEnder = (new EnderEyeItem(125) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_ender)->setIconName(L"eyeOfEnder")->setDescriptionId(IDS_ITEM_EYE_OF_ENDER)->setUseDescriptionId(IDS_DESC_EYE_OF_ENDER);
432 Item::speckledMelon = (new Item(126) ) ->setBaseItemTypeAndMaterial(eBaseItemType_giltFruit, eMaterial_melon)->setIconName(L"speckledMelon")->setDescriptionId(IDS_ITEM_SPECKLED_MELON)->setUseDescriptionId(IDS_DESC_SPECKLED_MELON)->setPotionBrewingFormula(PotionBrewing::MOD_SPECKLEDMELON);
433
434 Item::spawnEgg = (new SpawnEggItem(127)) ->setIconName(L"monsterPlacer")->setDescriptionId(IDS_ITEM_MONSTER_SPAWNER)->setUseDescriptionId(IDS_DESC_MONSTER_SPAWNER);
435
436 // 4J Stu - Brought this forward
437 Item::expBottle = (new ExperienceItem(128)) ->setIconName(L"expBottle")->setDescriptionId(IDS_ITEM_EXP_BOTTLE)->setUseDescriptionId(IDS_DESC_EXP_BOTTLE);
438
439 Item::record_01 = ( new RecordingItem(2000, L"13") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_01)->setUseDescriptionId(IDS_DESC_RECORD);
440 Item::record_02 = ( new RecordingItem(2001, L"cat") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_02)->setUseDescriptionId(IDS_DESC_RECORD);
441
442 // 4J - new records brought forward from 1.2.3
443 Item::record_03 = ( new RecordingItem(2002, L"blocks") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_03)->setUseDescriptionId(IDS_DESC_RECORD);
444 Item::record_04 = ( new RecordingItem(2003, L"chirp") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_04)->setUseDescriptionId(IDS_DESC_RECORD);
445 Item::record_05 = ( new RecordingItem(2004, L"far") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_05)->setUseDescriptionId(IDS_DESC_RECORD);
446 Item::record_06 = ( new RecordingItem(2005, L"mall") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_06)->setUseDescriptionId(IDS_DESC_RECORD);
447 Item::record_07 = ( new RecordingItem(2006, L"mellohi") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_07)->setUseDescriptionId(IDS_DESC_RECORD);
448 Item::record_09 = ( new RecordingItem(2007, L"stal") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_08)->setUseDescriptionId(IDS_DESC_RECORD);
449 Item::record_10 = ( new RecordingItem(2008, L"strad") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_09)->setUseDescriptionId(IDS_DESC_RECORD);
450 Item::record_11 = ( new RecordingItem(2009, L"ward") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_10)->setUseDescriptionId(IDS_DESC_RECORD);
451 Item::record_12 = ( new RecordingItem(2010, L"11") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_11)->setUseDescriptionId(IDS_DESC_RECORD);
452 Item::record_08 = ( new RecordingItem(2011, L"where are we now") ) ->setIconName(L"record")->setDescriptionId(IDS_ITEM_RECORD_12)->setUseDescriptionId(IDS_DESC_RECORD);
453
454 // TU9
455 // putting the fire charge in as a torch, so that it stacks without being near the middle of the selection boxes
456 Item::fireball = (new FireChargeItem(129)) ->setBaseItemTypeAndMaterial(eBaseItemType_torch, eMaterial_setfire)->setIconName(L"fireball")->setDescriptionId(IDS_ITEM_FIREBALL)->setUseDescriptionId(IDS_DESC_FIREBALL);
457 Item::frame = (new HangingEntityItem(133,eTYPE_ITEM_FRAME)) ->setBaseItemTypeAndMaterial(eBaseItemType_HangingItem, eMaterial_glass)->setIconName(L"frame")->setDescriptionId(IDS_ITEM_ITEMFRAME)->setUseDescriptionId(IDS_DESC_ITEMFRAME);
458
459
460 // TU12
461 Item::skull = (new SkullItem(141)) ->setIconName(L"skull")->setDescriptionId(IDS_ITEM_SKULL)->setUseDescriptionId(IDS_DESC_SKULL);
462
463 // TU14
464 //Item::writingBook = (new WritingBookItem(130))->setIcon(11, 11)->setDescriptionId("writingBook");
465 //Item::writtenBook = (new WrittenBookItem(131))->setIcon(12, 11)->setDescriptionId("writtenBook");
466
467 Item::emerald = (new Item(132)) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_emerald)->setIconName(L"emerald")->setDescriptionId(IDS_ITEM_EMERALD)->setUseDescriptionId(IDS_DESC_EMERALD);
468
469 Item::flowerPot = (new TilePlanterItem(134, Tile::flowerPot)) ->setIconName(L"flowerPot")->setDescriptionId(IDS_FLOWERPOT)->setUseDescriptionId(IDS_DESC_FLOWERPOT);
470
471 Item::carrots = (new SeedFoodItem(135, 4, FoodConstants::FOOD_SATURATION_NORMAL, Tile::carrots_Id, Tile::farmland_Id)) ->setIconName(L"carrots")->setDescriptionId(IDS_CARROTS)->setUseDescriptionId(IDS_DESC_CARROTS);
472 Item::potato = (new SeedFoodItem(136, 1, FoodConstants::FOOD_SATURATION_LOW, Tile::potatoes_Id, Tile::farmland_Id)) ->setIconName(L"potato")->setDescriptionId(IDS_POTATO)->setUseDescriptionId(IDS_DESC_POTATO);
473 Item::potatoBaked = (new FoodItem(137, 6, FoodConstants::FOOD_SATURATION_NORMAL, false)) ->setIconName(L"potatoBaked")->setDescriptionId(IDS_ITEM_POTATO_BAKED)->setUseDescriptionId(IDS_DESC_POTATO_BAKED);
474 Item::potatoPoisonous = (new FoodItem(138, 2, FoodConstants::FOOD_SATURATION_LOW, false)) ->setEatEffect(MobEffect::poison->id, 5, 0, .6f)->setIconName(L"potatoPoisonous")->setDescriptionId(IDS_ITEM_POTATO_POISONOUS)->setUseDescriptionId(IDS_DESC_POTATO_POISONOUS);
475
476 Item::emptyMap = (EmptyMapItem *) (new EmptyMapItem(139))->setIconName(L"map_empty")->setDescriptionId(IDS_ITEM_MAP_EMPTY)->setUseDescriptionId(IDS_DESC_MAP_EMPTY);
477
478 Item::carrotGolden = (new FoodItem(140, 6, FoodConstants::FOOD_SATURATION_SUPERNATURAL, false)) ->setBaseItemTypeAndMaterial(eBaseItemType_giltFruit, eMaterial_carrot)->setIconName(L"carrotGolden")->setPotionBrewingFormula(PotionBrewing::MOD_GOLDENCARROT)->setDescriptionId(IDS_ITEM_CARROT_GOLDEN)->setUseDescriptionId(IDS_DESC_CARROT_GOLDEN);
479
480 Item::carrotOnAStick = (new CarrotOnAStickItem(142)) ->setBaseItemTypeAndMaterial(eBaseItemType_rod, eMaterial_carrot)->setIconName(L"carrotOnAStick")->setDescriptionId(IDS_ITEM_CARROT_ON_A_STICK)->setUseDescriptionId(IDS_DESC_CARROT_ON_A_STICK);
481 Item::netherStar = (new SimpleFoiledItem(143)) ->setIconName(L"nether_star")->setDescriptionId(IDS_NETHER_STAR)->setUseDescriptionId(IDS_DESC_NETHER_STAR);
482 Item::pumpkinPie = (new FoodItem(144, 8, FoodConstants::FOOD_SATURATION_LOW, false)) ->setIconName(L"pumpkinPie")->setDescriptionId(IDS_ITEM_PUMPKIN_PIE)->setUseDescriptionId(IDS_DESC_PUMPKIN_PIE);
483 Item::fireworks = (new FireworksItem(145)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_fireworks, Item::eMaterial_undefined)->setIconName(L"fireworks")->setDescriptionId(IDS_FIREWORKS)->setUseDescriptionId(IDS_DESC_FIREWORKS);
484 Item::fireworksCharge = (new FireworksChargeItem(146)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_fireworks, Item::eMaterial_undefined)->setIconName(L"fireworks_charge")->setDescriptionId(IDS_FIREWORKS_CHARGE)->setUseDescriptionId(IDS_DESC_FIREWORKS_CHARGE);
485 EnchantedBookItem::enchantedBook = (EnchantedBookItem *)(new EnchantedBookItem(147)) ->setMaxStackSize(1)->setIconName(L"enchantedBook")->setDescriptionId(IDS_ITEM_ENCHANTED_BOOK)->setUseDescriptionId(IDS_DESC_ENCHANTED_BOOK);
486 Item::comparator = (new TilePlanterItem(148, Tile::comparator_off)) ->setIconName(L"comparator")->setDescriptionId(IDS_ITEM_COMPARATOR)->setUseDescriptionId(IDS_DESC_COMPARATOR);
487 Item::netherbrick = (new Item(149)) ->setIconName(L"netherbrick")->setDescriptionId(IDS_ITEM_NETHERBRICK)->setUseDescriptionId(IDS_DESC_ITEM_NETHERBRICK);
488 Item::netherQuartz = (new Item(150)) ->setIconName(L"netherquartz")->setDescriptionId(IDS_ITEM_NETHER_QUARTZ)->setUseDescriptionId(IDS_DESC_NETHER_QUARTZ);
489 Item::minecart_tnt = (new MinecartItem(151, Minecart::TYPE_TNT)) ->setIconName(L"minecart_tnt")->setDescriptionId(IDS_ITEM_MINECART_TNT)->setUseDescriptionId(IDS_DESC_MINECART_TNT);
490 Item::minecart_hopper = (new MinecartItem(152, Minecart::TYPE_HOPPER)) ->setIconName(L"minecart_hopper")->setDescriptionId(IDS_ITEM_MINECART_HOPPER)->setUseDescriptionId(IDS_DESC_MINECART_HOPPER);
491
492 Item::horseArmorMetal = (new Item(161)) ->setIconName(L"iron_horse_armor")->setMaxStackSize(1)->setDescriptionId(IDS_ITEM_IRON_HORSE_ARMOR)->setUseDescriptionId(IDS_DESC_IRON_HORSE_ARMOR);
493 Item::horseArmorGold = (new Item(162)) ->setIconName(L"gold_horse_armor")->setMaxStackSize(1)->setDescriptionId(IDS_ITEM_GOLD_HORSE_ARMOR)->setUseDescriptionId(IDS_DESC_GOLD_HORSE_ARMOR);
494 Item::horseArmorDiamond = (new Item(163)) ->setIconName(L"diamond_horse_armor")->setMaxStackSize(1)->setDescriptionId(IDS_ITEM_DIAMOND_HORSE_ARMOR)->setUseDescriptionId(IDS_DESC_DIAMOND_HORSE_ARMOR);
495 Item::lead = (new LeashItem(164)) ->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_undefined)->setIconName(L"lead")->setDescriptionId(IDS_ITEM_LEAD)->setUseDescriptionId(IDS_DESC_LEAD);
496 Item::nameTag = (new NameTagItem(165)) ->setIconName(L"name_tag")->setDescriptionId(IDS_ITEM_NAME_TAG)->setUseDescriptionId(IDS_DESC_NAME_TAG);}
497
498
499// 4J Stu - We need to do this after the staticCtor AND after staticCtors for other class
500// eg Recipes
501void Item::staticInit()
502{
503 Stats::buildItemStats();
504}
505
506
507_Tier::Tier(int level, int uses, float speed, float damage, int enchantmentValue) :
508level( level ),
509 uses( uses ),
510 speed( speed ),
511 damage( damage ),
512 enchantmentValue( enchantmentValue )
513{
514}
515
516
517int _Tier::getUses() const
518{
519 return uses;
520}
521
522float _Tier::getSpeed() const
523{
524 return speed;
525}
526
527float _Tier::getAttackDamageBonus() const
528{
529 return damage;
530}
531
532int _Tier::getLevel() const
533{
534 return level;
535}
536
537int _Tier::getEnchantmentValue() const
538{
539 return enchantmentValue;
540}
541
542int _Tier::getTierItemId() const
543{
544 if (this == Tier::WOOD)
545 {
546 return Tile::wood_Id;
547 }
548 else if (this == Tier::STONE)
549 {
550 return Tile::cobblestone_Id;
551 }
552 else if (this == Tier::GOLD)
553 {
554 return Item::goldIngot_Id;
555 }
556 else if (this == Tier::IRON)
557 {
558 return Item::ironIngot_Id;
559 }
560 else if (this == Tier::DIAMOND)
561 {
562 return Item::diamond_Id;
563 }
564 return 0;
565}
566
567Item::Item(int id) : id( 256 + id )
568{
569 maxStackSize = Item::MAX_STACK_SIZE;
570 maxDamage = 0;
571 icon = NULL;
572 m_handEquipped = false;
573 m_isStackedByData = false;
574
575 craftingRemainingItem = NULL;
576 potionBrewingFormula = L"";
577
578 m_iMaterial=eMaterial_undefined;
579 m_iBaseItemType=eBaseItemType_undefined;
580 m_textureName = L"";
581
582 // TODO Init this string
583 //string descriptionId;
584
585 //this->id = 256 + id;
586 if (items[256 + id] != NULL)
587 {
588 app.DebugPrintf("CONFLICT @ %d" , id);
589 }
590
591 items[256 + id] = this;
592}
593
594// 4J-PB - adding so we can class different items together for the new crafting menu
595// so pickaxe_stone would get tagged with pickaxe and stone
596Item *Item::setBaseItemTypeAndMaterial(int iType,int iMaterial)
597{
598 this->m_iBaseItemType = iType;
599 this->m_iMaterial = iMaterial;
600 return this;
601}
602
603int Item::getBaseItemType()
604{
605 return this->m_iBaseItemType;
606}
607
608int Item::getMaterial()
609{
610 return this->m_iMaterial;
611}
612
613Item *Item::setIconName(const wstring &name)
614{
615 m_textureName = name;
616
617 return this;
618}
619
620wstring Item::getIconName()
621{
622 return m_textureName;
623}
624
625Item *Item::setMaxStackSize(int max)
626{
627 maxStackSize = max;
628 return this;
629}
630
631int Item::getIconType()
632{
633 return Icon::TYPE_ITEM;
634}
635
636Icon *Item::getIcon(int auxValue)
637{
638 return icon;
639}
640
641Icon *Item::getIcon(shared_ptr<ItemInstance> itemInstance)
642{
643 return getIcon(itemInstance->getAuxValue());
644}
645
646bool Item::useOn(shared_ptr<ItemInstance> itemInstance, shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly)
647{
648 return false;
649}
650
651float Item::getDestroySpeed(shared_ptr<ItemInstance> itemInstance, Tile *tile)
652{
653 return 1;
654}
655
656bool Item::TestUse(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
657{
658 return false;
659}
660
661shared_ptr<ItemInstance> Item::use(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
662{
663 return itemInstance;
664}
665
666shared_ptr<ItemInstance> Item::useTimeDepleted(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
667{
668 return itemInstance;
669}
670
671int Item::getMaxStackSize() const
672{
673 return maxStackSize;
674}
675
676int Item::getLevelDataForAuxValue(int auxValue)
677{
678 return 0;
679}
680
681bool Item::isStackedByData()
682{
683 return m_isStackedByData;
684}
685
686
687Item *Item::setStackedByData(bool isStackedByData)
688{
689 this->m_isStackedByData = isStackedByData;
690 return this;
691}
692
693
694int Item::getMaxDamage()
695{
696 return maxDamage;
697}
698
699
700Item *Item::setMaxDamage(int maxDamage)
701{
702 this->maxDamage = maxDamage;
703 return this;
704}
705
706
707bool Item::canBeDepleted()
708{
709 return maxDamage > 0 && !m_isStackedByData;
710}
711
712/**
713* Returns true when the item was used to deal more than default damage
714*
715* @param itemInstance
716* @param mob
717* @param attacker
718* @return
719*/
720bool Item::hurtEnemy(shared_ptr<ItemInstance> itemInstance, shared_ptr<LivingEntity> mob, shared_ptr<LivingEntity> attacker)
721{
722 return false;
723}
724
725/**
726* Returns true when the item was used to mine more efficiently
727*
728* @param itemInstance
729* @param tile
730* @param x
731* @param y
732* @param z
733* @param owner
734* @return
735*/
736bool Item::mineBlock(shared_ptr<ItemInstance> itemInstance, Level *level, int tile, int x, int y, int z, shared_ptr<LivingEntity> owner)
737{
738 return false;
739}
740
741int Item::getAttackDamage(shared_ptr<Entity> entity)
742{
743 return 1;
744}
745
746bool Item::canDestroySpecial(Tile *tile)
747{
748 return false;
749}
750
751bool Item::interactEnemy(shared_ptr<ItemInstance> itemInstance, shared_ptr<Player> player, shared_ptr<LivingEntity> mob)
752{
753 return false;
754}
755
756Item *Item::handEquipped()
757{
758 m_handEquipped = true;
759 return this;
760}
761
762bool Item::isHandEquipped()
763{
764 return m_handEquipped;
765}
766
767bool Item::isMirroredArt()
768{
769 return false;
770}
771
772Item *Item::setDescriptionId(unsigned int id)
773{
774 this->descriptionId = id;
775 return this;
776}
777
778LPCWSTR Item::getDescription()
779{
780 return app.GetString(getDescriptionId());
781 //return I18n::get(getDescriptionId());
782}
783
784LPCWSTR Item::getDescription(shared_ptr<ItemInstance> instance)
785{
786 return app.GetString(getDescriptionId(instance));
787 //return I18n::get(getDescriptionId(instance));
788}
789
790unsigned int Item::getDescriptionId(int iData /*= -1*/)
791{
792 return descriptionId;
793}
794
795unsigned int Item::getDescriptionId(shared_ptr<ItemInstance> instance)
796{
797 return descriptionId;
798}
799
800Item *Item::setUseDescriptionId(unsigned int id)
801{
802 this->useDescriptionId = id;
803 return this;
804}
805
806unsigned int Item::getUseDescriptionId()
807{
808 return useDescriptionId;
809}
810
811unsigned int Item::getUseDescriptionId(shared_ptr<ItemInstance> instance)
812{
813 return useDescriptionId;
814}
815
816Item *Item::setCraftingRemainingItem(Item *craftingRemainingItem)
817{
818 this->craftingRemainingItem = craftingRemainingItem;
819 return this;
820}
821
822bool Item::shouldMoveCraftingResultToInventory(shared_ptr<ItemInstance> instance)
823{
824 // Default is good for the vast majority of items
825 return true;
826}
827
828bool Item::shouldOverrideMultiplayerNBT()
829{
830 return true;
831}
832
833Item *Item::getCraftingRemainingItem()
834{
835 return craftingRemainingItem;
836}
837
838bool Item::hasCraftingRemainingItem()
839{
840 return craftingRemainingItem != NULL;
841}
842
843wstring Item::getName()
844{
845 return L"";//I18n::get(getDescriptionId() + L".name");
846}
847
848int Item::getColor(shared_ptr<ItemInstance> item, int spriteLayer)
849{
850 return 0xffffff;
851}
852
853void Item::inventoryTick(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Entity> owner, int slot, bool selected) {
854}
855
856void Item::onCraftedBy(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
857{
858}
859
860bool Item::isComplex()
861{
862 return false;
863}
864
865UseAnim Item::getUseAnimation(shared_ptr<ItemInstance> itemInstance)
866{
867 return UseAnim_none;
868}
869
870int Item::getUseDuration(shared_ptr<ItemInstance> itemInstance)
871{
872 return 0;
873}
874
875void Item::releaseUsing(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player, int durationLeft)
876{
877}
878
879Item *Item::setPotionBrewingFormula(const wstring &potionBrewingFormula)
880{
881 this->potionBrewingFormula = potionBrewingFormula;
882 return this;
883}
884
885wstring Item::getPotionBrewingFormula()
886{
887 return potionBrewingFormula;
888}
889
890bool Item::hasPotionBrewingFormula()
891{
892 return !potionBrewingFormula.empty();
893}
894
895void Item::appendHoverText(shared_ptr<ItemInstance> itemInstance, shared_ptr<Player> player, vector<HtmlString> *lines, bool advanced)
896{
897}
898
899wstring Item::getHoverName(shared_ptr<ItemInstance> itemInstance)
900{
901 //String elementName = ("" + Language.getInstance().getElementName(getDescription(itemInstance))).trim();
902 //return elementName;
903 return app.GetString(getDescriptionId(itemInstance));
904}
905
906bool Item::isFoil(shared_ptr<ItemInstance> itemInstance)
907{
908 if (itemInstance->isEnchanted()) return true;
909 return false;
910}
911
912const Rarity *Item::getRarity(shared_ptr<ItemInstance> itemInstance)
913{
914 if (itemInstance->isEnchanted()) return Rarity::rare;
915 return Rarity::common;
916}
917
918bool Item::isEnchantable(shared_ptr<ItemInstance> itemInstance)
919{
920 return getMaxStackSize() == 1 && canBeDepleted();
921}
922
923HitResult *Item::getPlayerPOVHitResult(Level *level, shared_ptr<Player> player, bool alsoPickLiquid)
924{
925 float a = 1;
926
927 float xRot = player->xRotO + (player->xRot - player->xRotO) * a;
928 float yRot = player->yRotO + (player->yRot - player->yRotO) * a;
929
930
931 double x = player->xo + (player->x - player->xo) * a;
932 double y = player->yo + (player->y - player->yo) * a + 1.62 - player->heightOffset;
933 double z = player->zo + (player->z - player->zo) * a;
934
935 Vec3 *from = Vec3::newTemp(x, y, z);
936
937 float yCos = (float) cos(-yRot * Mth::RAD_TO_GRAD - PI);
938 float ySin = (float) sin(-yRot * Mth::RAD_TO_GRAD - PI);
939 float xCos = (float) -cos(-xRot * Mth::RAD_TO_GRAD);
940 float xSin = (float) sin(-xRot * Mth::RAD_TO_GRAD);
941
942 float xa = ySin * xCos;
943 float ya = xSin;
944 float za = yCos * xCos;
945
946 double range = 5;
947 Vec3 *to = from->add(xa * range, ya * range, za * range);
948 return level->clip(from, to, alsoPickLiquid, !alsoPickLiquid);
949}
950
951int Item::getEnchantmentValue()
952{
953 return 0;
954}
955
956bool Item::hasMultipleSpriteLayers()
957{
958 return false;
959}
960
961Icon *Item::getLayerIcon(int auxValue, int spriteLayer)
962{
963 return getIcon(auxValue);
964}
965
966bool Item::mayBePlacedInAdventureMode()
967{
968 return true;
969}
970
971bool Item::isValidRepairItem(shared_ptr<ItemInstance> source, shared_ptr<ItemInstance> repairItem)
972{
973 return false;
974}
975
976void Item::registerIcons(IconRegister *iconRegister)
977{
978 icon = iconRegister->registerIcon(m_textureName);
979}
980
981attrAttrModMap *Item::getDefaultAttributeModifiers()
982{
983 return new attrAttrModMap();
984}
985
986
987/*
988 4J: These are necesary on the PS3.
989 (and 4 and Vita).
990*/
991#if (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
992const int Item::shovel_iron_Id ;
993const int Item::pickAxe_iron_Id ;
994const int Item::hatchet_iron_Id ;
995const int Item::flintAndSteel_Id ;
996const int Item::apple_Id ;
997const int Item::bow_Id ;
998const int Item::arrow_Id ;
999const int Item::coal_Id ;
1000const int Item::diamond_Id ;
1001const int Item::ironIngot_Id ;
1002const int Item::goldIngot_Id ;
1003const int Item::sword_iron_Id ;
1004const int Item::sword_wood_Id ;
1005const int Item::shovel_wood_Id ;
1006const int Item::pickAxe_wood_Id ;
1007const int Item::hatchet_wood_Id ;
1008const int Item::sword_stone_Id ;
1009const int Item::shovel_stone_Id ;
1010const int Item::pickAxe_stone_Id ;
1011const int Item::hatchet_stone_Id ;
1012const int Item::sword_diamond_Id ;
1013const int Item::shovel_diamond_Id ;
1014const int Item::pickAxe_diamond_Id ;
1015const int Item::hatchet_diamond_Id ;
1016const int Item::stick_Id ;
1017const int Item::bowl_Id ;
1018const int Item::mushroomStew_Id ;
1019const int Item::sword_gold_Id ;
1020const int Item::shovel_gold_Id ;
1021const int Item::pickAxe_gold_Id ;
1022const int Item::hatchet_gold_Id ;
1023const int Item::string_Id ;
1024const int Item::feather_Id ;
1025const int Item::gunpowder_Id ;
1026const int Item::hoe_wood_Id ;
1027const int Item::hoe_stone_Id ;
1028const int Item::hoe_iron_Id ;
1029const int Item::hoe_diamond_Id ;
1030const int Item::hoe_gold_Id ;
1031const int Item::seeds_wheat_Id ;
1032const int Item::wheat_Id ;
1033const int Item::bread_Id ;
1034const int Item::helmet_leather_Id ;
1035const int Item::chestplate_leather_Id ;
1036const int Item::leggings_leather_Id ;
1037const int Item::boots_leather_Id ;
1038const int Item::helmet_chain_Id ;
1039const int Item::chestplate_chain_Id ;
1040const int Item::leggings_chain_Id ;
1041const int Item::boots_chain_Id ;
1042const int Item::helmet_iron_Id ;
1043const int Item::chestplate_iron_Id ;
1044const int Item::leggings_iron_Id ;
1045const int Item::boots_iron_Id ;
1046const int Item::helmet_diamond_Id ;
1047const int Item::chestplate_diamond_Id;
1048const int Item::leggings_diamond_Id ;
1049const int Item::boots_diamond_Id ;
1050const int Item::helmet_gold_Id ;
1051const int Item::chestplate_gold_Id ;
1052const int Item::leggings_gold_Id ;
1053const int Item::boots_gold_Id ;
1054const int Item::flint_Id ;
1055const int Item::porkChop_raw_Id ;
1056const int Item::porkChop_cooked_Id ;
1057const int Item::painting_Id ;
1058const int Item::apple_gold_Id ;
1059const int Item::sign_Id ;
1060const int Item::door_wood_Id ;
1061const int Item::bucket_empty_Id ;
1062const int Item::bucket_water_Id ;
1063const int Item::bucket_lava_Id ;
1064const int Item::minecart_Id ;
1065const int Item::saddle_Id ;
1066const int Item::door_iron_Id ;
1067const int Item::redStone_Id ;
1068const int Item::snowBall_Id ;
1069const int Item::boat_Id ;
1070const int Item::leather_Id ;
1071const int Item::bucket_milk_Id ;
1072const int Item::brick_Id ;
1073const int Item::clay_Id ;
1074const int Item::reeds_Id ;
1075const int Item::paper_Id ;
1076const int Item::book_Id ;
1077const int Item::slimeBall_Id ;
1078const int Item::minecart_chest_Id ;
1079const int Item::minecart_furnace_Id ;
1080const int Item::egg_Id ;
1081const int Item::compass_Id ;
1082const int Item::fishingRod_Id ;
1083const int Item::clock_Id ;
1084const int Item::yellowDust_Id ;
1085const int Item::fish_raw_Id ;
1086const int Item::fish_cooked_Id ;
1087const int Item::dye_powder_Id ;
1088const int Item::bone_Id ;
1089const int Item::sugar_Id ;
1090const int Item::cake_Id ;
1091const int Item::bed_Id ;
1092const int Item::repeater_Id ;
1093const int Item::cookie_Id ;
1094const int Item::map_Id ;
1095const int Item::shears_Id ;
1096const int Item::melon_Id ;
1097const int Item::seeds_pumpkin_Id ;
1098const int Item::seeds_melon_Id ;
1099const int Item::beef_raw_Id ;
1100const int Item::beef_cooked_Id ;
1101const int Item::chicken_raw_Id ;
1102const int Item::chicken_cooked_Id ;
1103const int Item::rotten_flesh_Id ;
1104const int Item::enderPearl_Id ;
1105const int Item::blazeRod_Id ;
1106const int Item::ghastTear_Id ;
1107const int Item::goldNugget_Id ;
1108const int Item::netherwart_seeds_Id;
1109const int Item::potion_Id ;
1110const int Item::glassBottle_Id ;
1111const int Item::spiderEye_Id ;
1112const int Item::fermentedSpiderEye_Id;
1113const int Item::blazePowder_Id ;
1114const int Item::magmaCream_Id ;
1115const int Item::brewingStand_Id ;
1116const int Item::cauldron_Id ;
1117const int Item::eyeOfEnder_Id ;
1118const int Item::speckledMelon_Id ;
1119const int Item::spawnEgg_Id;
1120const int Item::expBottle_Id ;
1121const int Item::skull_Id ;
1122const int Item::record_01_Id ;
1123const int Item::record_02_Id ;
1124const int Item::record_03_Id ;
1125const int Item::record_04_Id ;
1126const int Item::record_05_Id ;
1127const int Item::record_06_Id ;
1128const int Item::record_07_Id ;
1129const int Item::record_09_Id ;
1130const int Item::record_10_Id ;
1131const int Item::record_11_Id ;
1132const int Item::record_12_Id ;
1133const int Item::record_08_Id ;
1134const int Item::fireball_Id ;
1135const int Item::itemFrame_Id ;
1136const int Item::netherbrick_Id ;
1137const int Item::emerald_Id ;
1138const int Item::flowerPot_Id ;
1139const int Item::carrots_Id ;
1140const int Item::potato_Id ;
1141const int Item::potatoBaked_Id ;
1142const int Item::potatoPoisonous_Id ;
1143const int Item::carrotGolden_Id ;
1144const int Item::carrotOnAStick_Id ;
1145const int Item::pumpkinPie_Id ;
1146const int Item::enchantedBook_Id ;
1147const int Item::netherQuartz_Id ;
1148#endif