the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "IUIScene_CreativeMenu.h"
3
4#include "..\..\Minecraft.h"
5#include "..\..\MultiplayerLocalPlayer.h"
6#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
7#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.h"
8#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
9#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
10#include "..\..\..\Minecraft.World\net.minecraft.world.item.enchantment.h"
11#include "..\..\..\Minecraft.World\net.minecraft.world.entity.h"
12#include "..\..\..\Minecraft.World\net.minecraft.world.entity.animal.h"
13#include "..\..\..\Minecraft.World\JavaMath.h"
14
15// 4J JEV - Images for each tab.
16IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = NULL;
17
18vector< shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount];
19
20#define ITEM(id) list->push_back( shared_ptr<ItemInstance>(new ItemInstance(id, 1, 0)) );
21#define ITEM_AUX(id, aux) list->push_back( shared_ptr<ItemInstance>(new ItemInstance(id, 1, aux)) );
22#define DEF(index) list = &categoryGroups[index];
23
24
25void IUIScene_CreativeMenu::staticCtor()
26{
27 vector< shared_ptr<ItemInstance> > *list;
28
29
30 // Building Blocks
31 DEF(eCreativeInventory_BuildingBlocks)
32 ITEM(Tile::stone_Id)
33 ITEM(Tile::grass_Id)
34 ITEM(Tile::dirt_Id)
35 ITEM(Tile::cobblestone_Id)
36 ITEM(Tile::sand_Id)
37 ITEM(Tile::sandStone_Id)
38 ITEM_AUX(Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE)
39 ITEM_AUX(Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS)
40 ITEM(Tile::coalBlock_Id)
41 ITEM(Tile::goldBlock_Id)
42 ITEM(Tile::ironBlock_Id)
43 ITEM(Tile::lapisBlock_Id)
44 ITEM(Tile::diamondBlock_Id)
45 ITEM(Tile::emeraldBlock_Id)
46 ITEM_AUX(Tile::quartzBlock_Id,QuartzBlockTile::TYPE_DEFAULT)
47 ITEM(Tile::coalOre_Id)
48 ITEM(Tile::lapisOre_Id)
49 ITEM(Tile::diamondOre_Id)
50 ITEM(Tile::redStoneOre_Id)
51 ITEM(Tile::ironOre_Id)
52 ITEM(Tile::goldOre_Id)
53 ITEM(Tile::emeraldOre_Id)
54 ITEM(Tile::netherQuartz_Id)
55 ITEM(Tile::unbreakable_Id)
56 ITEM_AUX(Tile::wood_Id,0)
57 ITEM_AUX(Tile::wood_Id,TreeTile::DARK_TRUNK)
58 ITEM_AUX(Tile::wood_Id,TreeTile::BIRCH_TRUNK)
59 ITEM_AUX(Tile::wood_Id,TreeTile::JUNGLE_TRUNK)
60 ITEM_AUX(Tile::treeTrunk_Id, 0)
61 ITEM_AUX(Tile::treeTrunk_Id, TreeTile::DARK_TRUNK)
62 ITEM_AUX(Tile::treeTrunk_Id, TreeTile::BIRCH_TRUNK)
63 ITEM_AUX(Tile::treeTrunk_Id, TreeTile::JUNGLE_TRUNK)
64 ITEM(Tile::gravel_Id)
65 ITEM(Tile::redBrick_Id)
66 ITEM(Tile::mossyCobblestone_Id)
67 ITEM(Tile::obsidian_Id)
68 ITEM(Tile::clay)
69 ITEM(Tile::ice_Id)
70 ITEM(Tile::snow_Id)
71 ITEM(Tile::netherRack_Id)
72 ITEM(Tile::soulsand_Id)
73 ITEM(Tile::glowstone_Id)
74 ITEM(Tile::fence_Id)
75 ITEM(Tile::netherFence_Id)
76 ITEM(Tile::ironFence_Id)
77 ITEM_AUX(Tile::cobbleWall_Id, WallTile::TYPE_NORMAL)
78 ITEM_AUX(Tile::cobbleWall_Id, WallTile::TYPE_MOSSY)
79 ITEM_AUX(Tile::stoneBrick_Id,SmoothStoneBrickTile::TYPE_DEFAULT)
80 ITEM_AUX(Tile::stoneBrick_Id,SmoothStoneBrickTile::TYPE_MOSSY)
81 ITEM_AUX(Tile::stoneBrick_Id,SmoothStoneBrickTile::TYPE_CRACKED)
82 ITEM_AUX(Tile::stoneBrick_Id,SmoothStoneBrickTile::TYPE_DETAIL)
83 ITEM_AUX(Tile::monsterStoneEgg_Id,StoneMonsterTile::HOST_ROCK)
84 ITEM_AUX(Tile::monsterStoneEgg_Id,StoneMonsterTile::HOST_COBBLE)
85 ITEM_AUX(Tile::monsterStoneEgg_Id,StoneMonsterTile::HOST_STONEBRICK)
86 ITEM(Tile::mycel_Id)
87 ITEM(Tile::netherBrick_Id)
88 ITEM(Tile::endStone_Id)
89 ITEM_AUX(Tile::quartzBlock_Id,QuartzBlockTile::TYPE_CHISELED)
90 ITEM_AUX(Tile::quartzBlock_Id,QuartzBlockTile::TYPE_LINES_Y)
91 ITEM(Tile::trapdoor_Id)
92 ITEM(Tile::fenceGate_Id)
93 ITEM(Item::door_wood_Id)
94 ITEM(Item::door_iron_Id)
95 ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::STONE_SLAB)
96 ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::SAND_SLAB)
97 // AP - changed oak slab to be wood because it wouldn't burn
98// ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::WOOD_SLAB)
99 ITEM_AUX(Tile::woodSlabHalf_Id,0)
100 ITEM_AUX(Tile::woodSlabHalf_Id,TreeTile::DARK_TRUNK)
101 ITEM_AUX(Tile::woodSlabHalf_Id,TreeTile::BIRCH_TRUNK)
102 ITEM_AUX(Tile::woodSlabHalf_Id,TreeTile::JUNGLE_TRUNK)
103 ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::COBBLESTONE_SLAB)
104 ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::BRICK_SLAB)
105 ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::SMOOTHBRICK_SLAB)
106 ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::NETHERBRICK_SLAB)
107 ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::QUARTZ_SLAB)
108 ITEM(Tile::stairs_wood_Id)
109 ITEM(Tile::stairs_birchwood_Id)
110 ITEM(Tile::stairs_sprucewood_Id)
111 ITEM(Tile::stairs_junglewood_Id)
112 ITEM(Tile::stairs_stone_Id)
113 ITEM(Tile::stairs_bricks_Id)
114 ITEM(Tile::stairs_stoneBrick_Id)
115 ITEM(Tile::stairs_netherBricks_Id)
116 ITEM(Tile::stairs_sandstone_Id)
117 ITEM(Tile::stairs_quartz_Id)
118
119 ITEM(Tile::clayHardened_Id)
120 ITEM_AUX(Tile::clayHardened_colored_Id,14) // Red
121 ITEM_AUX(Tile::clayHardened_colored_Id,1) // Orange
122 ITEM_AUX(Tile::clayHardened_colored_Id,4) // Yellow
123 ITEM_AUX(Tile::clayHardened_colored_Id,5) // Lime
124 ITEM_AUX(Tile::clayHardened_colored_Id,3) // Light Blue
125 ITEM_AUX(Tile::clayHardened_colored_Id,9) // Cyan
126 ITEM_AUX(Tile::clayHardened_colored_Id,11) // Blue
127 ITEM_AUX(Tile::clayHardened_colored_Id,10) // Purple
128 ITEM_AUX(Tile::clayHardened_colored_Id,2) // Magenta
129 ITEM_AUX(Tile::clayHardened_colored_Id,6) // Pink
130 ITEM_AUX(Tile::clayHardened_colored_Id,0) // White
131 ITEM_AUX(Tile::clayHardened_colored_Id,8) // Light Gray
132 ITEM_AUX(Tile::clayHardened_colored_Id,7) // Gray
133 ITEM_AUX(Tile::clayHardened_colored_Id,15) // Black
134 ITEM_AUX(Tile::clayHardened_colored_Id,13) // Green
135 ITEM_AUX(Tile::clayHardened_colored_Id,12) // Brown
136
137 // Decoration
138 DEF(eCreativeInventory_Decoration)
139 ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_SKELETON)
140 ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_WITHER)
141 ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_ZOMBIE)
142 ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_CHAR)
143 ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_CREEPER)
144 ITEM(Tile::sponge_Id)
145 ITEM(Tile::melon_Id)
146 ITEM(Tile::pumpkin_Id)
147 ITEM(Tile::litPumpkin_Id)
148 ITEM_AUX(Tile::sapling_Id, Sapling::TYPE_DEFAULT)
149 ITEM_AUX(Tile::sapling_Id, Sapling::TYPE_EVERGREEN)
150 ITEM_AUX(Tile::sapling_Id, Sapling::TYPE_BIRCH)
151 ITEM_AUX(Tile::sapling_Id, Sapling::TYPE_JUNGLE)
152 ITEM_AUX(Tile::leaves_Id, LeafTile::NORMAL_LEAF)
153 ITEM_AUX(Tile::leaves_Id, LeafTile::EVERGREEN_LEAF)
154 ITEM_AUX(Tile::leaves_Id, LeafTile::BIRCH_LEAF)
155 ITEM_AUX(Tile::leaves_Id, LeafTile::JUNGLE_LEAF)
156 ITEM(Tile::vine)
157 ITEM(Tile::waterLily_Id)
158 ITEM(Tile::torch_Id)
159 ITEM_AUX(Tile::tallgrass_Id, TallGrass::DEAD_SHRUB)
160 ITEM_AUX(Tile::tallgrass_Id, TallGrass::TALL_GRASS)
161 ITEM_AUX(Tile::tallgrass_Id, TallGrass::FERN)
162 ITEM(Tile::deadBush_Id)
163 ITEM(Tile::flower_Id)
164 ITEM(Tile::rose_Id)
165 ITEM(Tile::mushroom_brown_Id)
166 ITEM(Tile::mushroom_red_Id)
167 ITEM(Tile::cactus_Id)
168 ITEM(Tile::topSnow_Id)
169 // 4J-PB - Already got sugar cane in Materials ITEM_11(Tile::reeds_Id)
170 ITEM(Tile::web_Id)
171 ITEM(Tile::thinGlass_Id)
172 ITEM(Tile::glass_Id)
173 ITEM(Item::painting_Id)
174 ITEM(Item::itemFrame_Id)
175 ITEM(Item::sign_Id)
176 ITEM(Tile::bookshelf_Id)
177 ITEM(Item::flowerPot_Id)
178 ITEM(Tile::hayBlock_Id)
179 ITEM_AUX(Tile::wool_Id,14) // Red
180 ITEM_AUX(Tile::wool_Id,1) // Orange
181 ITEM_AUX(Tile::wool_Id,4) // Yellow
182 ITEM_AUX(Tile::wool_Id,5) // Lime
183 ITEM_AUX(Tile::wool_Id,3) // Light Blue
184 ITEM_AUX(Tile::wool_Id,9) // Cyan
185 ITEM_AUX(Tile::wool_Id,11) // Blue
186 ITEM_AUX(Tile::wool_Id,10) // Purple
187 ITEM_AUX(Tile::wool_Id,2) // Magenta
188 ITEM_AUX(Tile::wool_Id,6) // Pink
189 ITEM_AUX(Tile::wool_Id,0) // White
190 ITEM_AUX(Tile::wool_Id,8) // Light Gray
191 ITEM_AUX(Tile::wool_Id,7) // Gray
192 ITEM_AUX(Tile::wool_Id,15) // Black
193 ITEM_AUX(Tile::wool_Id,13) // Green
194 ITEM_AUX(Tile::wool_Id,12) // Brown
195
196 ITEM_AUX(Tile::woolCarpet_Id,14) // Red
197 ITEM_AUX(Tile::woolCarpet_Id,1) // Orange
198 ITEM_AUX(Tile::woolCarpet_Id,4) // Yellow
199 ITEM_AUX(Tile::woolCarpet_Id,5) // Lime
200 ITEM_AUX(Tile::woolCarpet_Id,3) // Light Blue
201 ITEM_AUX(Tile::woolCarpet_Id,9) // Cyan
202 ITEM_AUX(Tile::woolCarpet_Id,11) // Blue
203 ITEM_AUX(Tile::woolCarpet_Id,10) // Purple
204 ITEM_AUX(Tile::woolCarpet_Id,2) // Magenta
205 ITEM_AUX(Tile::woolCarpet_Id,6) // Pink
206 ITEM_AUX(Tile::woolCarpet_Id,0) // White
207 ITEM_AUX(Tile::woolCarpet_Id,8) // Light Gray
208 ITEM_AUX(Tile::woolCarpet_Id,7) // Gray
209 ITEM_AUX(Tile::woolCarpet_Id,15) // Black
210 ITEM_AUX(Tile::woolCarpet_Id,13) // Green
211 ITEM_AUX(Tile::woolCarpet_Id,12) // Brown
212
213#if 0
214 ITEM_AUX(Tile::stained_glass_Id,14) // Red
215 ITEM_AUX(Tile::stained_glass_Id,1) // Orange
216 ITEM_AUX(Tile::stained_glass_Id,4) // Yellow
217 ITEM_AUX(Tile::stained_glass_Id,5) // Lime
218 ITEM_AUX(Tile::stained_glass_Id,3) // Light Blue
219 ITEM_AUX(Tile::stained_glass_Id,9) // Cyan
220 ITEM_AUX(Tile::stained_glass_Id,11) // Blue
221 ITEM_AUX(Tile::stained_glass_Id,10) // Purple
222 ITEM_AUX(Tile::stained_glass_Id,2) // Magenta
223 ITEM_AUX(Tile::stained_glass_Id,6) // Pink
224 ITEM_AUX(Tile::stained_glass_Id,0) // White
225 ITEM_AUX(Tile::stained_glass_Id,8) // Light Gray
226 ITEM_AUX(Tile::stained_glass_Id,7) // Gray
227 ITEM_AUX(Tile::stained_glass_Id,15) // Black
228 ITEM_AUX(Tile::stained_glass_Id,13) // Green
229 ITEM_AUX(Tile::stained_glass_Id,12) // Brown
230
231 ITEM_AUX(Tile::stained_glass_pane_Id,14) // Red
232 ITEM_AUX(Tile::stained_glass_pane_Id,1) // Orange
233 ITEM_AUX(Tile::stained_glass_pane_Id,4) // Yellow
234 ITEM_AUX(Tile::stained_glass_pane_Id,5) // Lime
235 ITEM_AUX(Tile::stained_glass_pane_Id,3) // Light Blue
236 ITEM_AUX(Tile::stained_glass_pane_Id,9) // Cyan
237 ITEM_AUX(Tile::stained_glass_pane_Id,11) // Blue
238 ITEM_AUX(Tile::stained_glass_pane_Id,10) // Purple
239 ITEM_AUX(Tile::stained_glass_pane_Id,2) // Magenta
240 ITEM_AUX(Tile::stained_glass_pane_Id,6) // Pink
241 ITEM_AUX(Tile::stained_glass_pane_Id,0) // White
242 ITEM_AUX(Tile::stained_glass_pane_Id,8) // Light Gray
243 ITEM_AUX(Tile::stained_glass_pane_Id,7) // Gray
244 ITEM_AUX(Tile::stained_glass_pane_Id,15) // Black
245 ITEM_AUX(Tile::stained_glass_pane_Id,13) // Green
246 ITEM_AUX(Tile::stained_glass_pane_Id,12) // Brown
247#endif
248
249#ifndef _CONTENT_PACKAGE
250 DEF(eCreativeInventory_ArtToolsDecorations)
251 if(app.DebugSettingsOn())
252 {
253 for(unsigned int i = 0; i < Painting::LAST_VALUE; ++i)
254 {
255 ITEM_AUX(Item::painting_Id, i + 1)
256 }
257
258 BuildFirework(list, FireworksItem::TYPE_BIG, DyePowderItem::PURPLE, 1, false, false);
259
260 BuildFirework(list, FireworksItem::TYPE_SMALL, DyePowderItem::RED, 1, false, false);
261 BuildFirework(list, FireworksItem::TYPE_SMALL, DyePowderItem::RED, 2, false, false);
262 BuildFirework(list, FireworksItem::TYPE_SMALL, DyePowderItem::RED, 3, false, false);
263
264 BuildFirework(list, FireworksItem::TYPE_BURST, DyePowderItem::GREEN, 1, false, true);
265 BuildFirework(list, FireworksItem::TYPE_CREEPER, DyePowderItem::BLUE, 1, true, false);
266 BuildFirework(list, FireworksItem::TYPE_STAR, DyePowderItem::YELLOW, 1, false, false);
267 BuildFirework(list, FireworksItem::TYPE_BIG, DyePowderItem::WHITE, 1, true, true);
268
269 ITEM_AUX(Tile::stained_glass_Id,14) // Red
270 ITEM_AUX(Tile::stained_glass_Id,1) // Orange
271 ITEM_AUX(Tile::stained_glass_Id,4) // Yellow
272 ITEM_AUX(Tile::stained_glass_Id,5) // Lime
273 ITEM_AUX(Tile::stained_glass_Id,3) // Light Blue
274 ITEM_AUX(Tile::stained_glass_Id,9) // Cyan
275 ITEM_AUX(Tile::stained_glass_Id,11) // Blue
276 ITEM_AUX(Tile::stained_glass_Id,10) // Purple
277 ITEM_AUX(Tile::stained_glass_Id,2) // Magenta
278 ITEM_AUX(Tile::stained_glass_Id,6) // Pink
279 ITEM_AUX(Tile::stained_glass_Id,0) // White
280 ITEM_AUX(Tile::stained_glass_Id,8) // Light Gray
281 ITEM_AUX(Tile::stained_glass_Id,7) // Gray
282 ITEM_AUX(Tile::stained_glass_Id,15) // Black
283 ITEM_AUX(Tile::stained_glass_Id,13) // Green
284 ITEM_AUX(Tile::stained_glass_Id,12) // Brown
285
286 ITEM_AUX(Tile::stained_glass_pane_Id,14) // Red
287 ITEM_AUX(Tile::stained_glass_pane_Id,1) // Orange
288 ITEM_AUX(Tile::stained_glass_pane_Id,4) // Yellow
289 ITEM_AUX(Tile::stained_glass_pane_Id,5) // Lime
290 ITEM_AUX(Tile::stained_glass_pane_Id,3) // Light Blue
291 ITEM_AUX(Tile::stained_glass_pane_Id,9) // Cyan
292 ITEM_AUX(Tile::stained_glass_pane_Id,11) // Blue
293 ITEM_AUX(Tile::stained_glass_pane_Id,10) // Purple
294 ITEM_AUX(Tile::stained_glass_pane_Id,2) // Magenta
295 ITEM_AUX(Tile::stained_glass_pane_Id,6) // Pink
296 ITEM_AUX(Tile::stained_glass_pane_Id,0) // White
297 ITEM_AUX(Tile::stained_glass_pane_Id,8) // Light Gray
298 ITEM_AUX(Tile::stained_glass_pane_Id,7) // Gray
299 ITEM_AUX(Tile::stained_glass_pane_Id,15) // Black
300 ITEM_AUX(Tile::stained_glass_pane_Id,13) // Green
301 ITEM_AUX(Tile::stained_glass_pane_Id,12) // Brown
302 }
303#endif
304
305 // Redstone
306 DEF(eCreativeInventory_Redstone)
307 ITEM(Tile::dispenser_Id)
308 ITEM(Tile::noteblock_Id)
309 ITEM(Tile::pistonBase_Id)
310 ITEM(Tile::pistonStickyBase_Id)
311 ITEM(Tile::tnt_Id)
312 ITEM(Tile::lever_Id)
313 ITEM(Tile::button_stone_Id)
314 ITEM(Tile::button_wood_Id)
315 ITEM(Tile::pressurePlate_stone_Id)
316 ITEM(Tile::pressurePlate_wood_Id)
317 ITEM(Item::redStone_Id)
318 ITEM(Tile::redstoneBlock_Id)
319 ITEM(Tile::redstoneTorch_on_Id)
320 ITEM(Item::repeater_Id)
321 ITEM(Tile::redstoneLight_Id)
322 ITEM(Tile::tripWireSource_Id)
323 ITEM(Tile::daylightDetector_Id)
324 ITEM(Tile::dropper_Id)
325 ITEM(Tile::hopper_Id)
326 ITEM(Item::comparator_Id)
327 ITEM(Tile::chest_trap_Id)
328 ITEM(Tile::weightedPlate_heavy_Id)
329 ITEM(Tile::weightedPlate_light_Id)
330
331 // Transport
332 DEF(eCreativeInventory_Transport)
333 ITEM(Tile::rail_Id)
334 ITEM(Tile::goldenRail_Id)
335 ITEM(Tile::detectorRail_Id)
336 ITEM(Tile::activatorRail_Id)
337 ITEM(Tile::ladder_Id)
338 ITEM(Item::minecart_Id)
339 ITEM(Item::minecart_chest_Id)
340 ITEM(Item::minecart_furnace_Id)
341 ITEM(Item::minecart_hopper_Id)
342 ITEM(Item::minecart_tnt_Id)
343 ITEM(Item::saddle_Id)
344 ITEM(Item::boat_Id)
345
346 // Miscellaneous
347 DEF(eCreativeInventory_Misc)
348 ITEM(Tile::chest_Id)
349 ITEM(Tile::enderChest_Id)
350 ITEM(Tile::workBench_Id)
351 ITEM(Tile::furnace_Id)
352 ITEM(Item::brewingStand_Id)
353 ITEM(Tile::enchantTable_Id)
354 ITEM(Tile::beacon_Id)
355 ITEM(Tile::endPortalFrameTile_Id)
356 ITEM(Tile::jukebox_Id)
357 ITEM(Tile::anvil_Id);
358 ITEM(Item::bed_Id)
359 ITEM(Item::bucket_empty_Id)
360 ITEM(Item::bucket_lava_Id)
361 ITEM(Item::bucket_water_Id)
362 ITEM(Item::bucket_milk_Id)
363 ITEM(Item::cauldron_Id)
364 ITEM(Item::snowBall_Id)
365 ITEM(Item::paper_Id)
366 ITEM(Item::book_Id)
367 ITEM(Item::enderPearl_Id)
368 ITEM(Item::eyeOfEnder_Id)
369 ITEM(Item::nameTag_Id)
370 ITEM(Item::netherStar_Id)
371 ITEM_AUX(Item::spawnEgg_Id, 50); // Creeper
372 ITEM_AUX(Item::spawnEgg_Id, 51); // Skeleton
373 ITEM_AUX(Item::spawnEgg_Id, 52); // Spider
374 ITEM_AUX(Item::spawnEgg_Id, 54); // Zombie
375 ITEM_AUX(Item::spawnEgg_Id, 55); // Slime
376 ITEM_AUX(Item::spawnEgg_Id, 56); // Ghast
377 ITEM_AUX(Item::spawnEgg_Id, 57); // Zombie Pigman
378 ITEM_AUX(Item::spawnEgg_Id, 58); // Enderman
379 ITEM_AUX(Item::spawnEgg_Id, 59); // Cave Spider
380 ITEM_AUX(Item::spawnEgg_Id, 60); // Silverfish
381 ITEM_AUX(Item::spawnEgg_Id, 61); // Blaze
382 ITEM_AUX(Item::spawnEgg_Id, 62); // Magma Cube
383 ITEM_AUX(Item::spawnEgg_Id, 65); // Bat
384 ITEM_AUX(Item::spawnEgg_Id, 66); // Witch
385 ITEM_AUX(Item::spawnEgg_Id, 90); // Pig
386 ITEM_AUX(Item::spawnEgg_Id, 91); // Sheep
387 ITEM_AUX(Item::spawnEgg_Id, 92); // Cow
388 ITEM_AUX(Item::spawnEgg_Id, 93); // Chicken
389 ITEM_AUX(Item::spawnEgg_Id, 94); // Squid
390 ITEM_AUX(Item::spawnEgg_Id, 95); // Wolf
391 ITEM_AUX(Item::spawnEgg_Id, 96); // Mooshroom
392 ITEM_AUX(Item::spawnEgg_Id, 98); // Ozelot
393 ITEM_AUX(Item::spawnEgg_Id, 100); // Horse
394 ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_DONKEY + 1) << 12) ); // Donkey
395 ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_MULE + 1) << 12)); // Mule
396 ITEM_AUX(Item::spawnEgg_Id, 120); // Villager
397 ITEM(Item::record_01_Id)
398 ITEM(Item::record_02_Id)
399 ITEM(Item::record_03_Id)
400 ITEM(Item::record_04_Id)
401 ITEM(Item::record_05_Id)
402 ITEM(Item::record_06_Id)
403 ITEM(Item::record_07_Id)
404 ITEM(Item::record_08_Id)
405 ITEM(Item::record_09_Id)
406 ITEM(Item::record_10_Id)
407 ITEM(Item::record_11_Id)
408 ITEM(Item::record_12_Id)
409
410 BuildFirework(list, FireworksItem::TYPE_SMALL, DyePowderItem::LIGHT_BLUE, 1, true, false);
411 BuildFirework(list, FireworksItem::TYPE_CREEPER, DyePowderItem::GREEN, 2, false, false);
412 BuildFirework(list, FireworksItem::TYPE_MAX, DyePowderItem::RED, 2, false, false, DyePowderItem::ORANGE);
413 BuildFirework(list, FireworksItem::TYPE_BURST, DyePowderItem::MAGENTA, 3, true, false, DyePowderItem::BLUE);
414 BuildFirework(list, FireworksItem::TYPE_STAR, DyePowderItem::YELLOW, 2, false, true, DyePowderItem::ORANGE);
415
416#ifndef _CONTENT_PACKAGE
417 DEF(eCreativeInventory_ArtToolsMisc)
418 if(app.DebugSettingsOn())
419 {
420 ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_SKELETON + 1) << 12)); // Skeleton
421 ITEM_AUX(Item::spawnEgg_Id, 100 | ((EntityHorse::TYPE_UNDEAD + 1) << 12)); // Zombie
422 ITEM_AUX(Item::spawnEgg_Id, 98 | ((Ocelot::TYPE_BLACK + 1) << 12));
423 ITEM_AUX(Item::spawnEgg_Id, 98 | ((Ocelot::TYPE_RED + 1) << 12));
424 ITEM_AUX(Item::spawnEgg_Id, 98 | ((Ocelot::TYPE_SIAMESE + 1) << 12));
425 ITEM_AUX(Item::spawnEgg_Id, 52 | (2 << 12)); // Spider-Jockey
426 ITEM_AUX(Item::spawnEgg_Id, 63); // Enderdragon
427 }
428#endif
429
430 // Food
431 DEF(eCreativeInventory_Food)
432 ITEM(Item::apple_Id)
433 ITEM(Item::apple_gold_Id)
434 ITEM_AUX(Item::apple_gold_Id,1) // Enchanted
435 ITEM(Item::melon_Id)
436 ITEM(Item::mushroomStew_Id)
437 ITEM(Item::bread_Id)
438 ITEM(Item::cake_Id)
439 ITEM(Item::cookie_Id)
440 ITEM(Item::fish_cooked_Id)
441 ITEM(Item::fish_raw_Id)
442 ITEM(Item::porkChop_cooked_Id)
443 ITEM(Item::porkChop_raw_Id)
444 ITEM(Item::beef_cooked_Id)
445 ITEM(Item::beef_raw_Id)
446 ITEM(Item::chicken_raw_Id)
447 ITEM(Item::chicken_cooked_Id)
448 ITEM(Item::rotten_flesh_Id)
449 ITEM(Item::spiderEye_Id)
450 ITEM(Item::potato_Id)
451 ITEM(Item::potatoBaked_Id)
452 ITEM(Item::potatoPoisonous_Id)
453 ITEM(Item::carrots_Id)
454 ITEM(Item::carrotGolden_Id)
455 ITEM(Item::pumpkinPie_Id)
456
457 // Tools, Armour and Weapons (Complete)
458 DEF(eCreativeInventory_ToolsArmourWeapons)
459 ITEM(Item::compass_Id)
460 ITEM(Item::helmet_leather_Id)
461 ITEM(Item::chestplate_leather_Id)
462 ITEM(Item::leggings_leather_Id)
463 ITEM(Item::boots_leather_Id)
464 ITEM(Item::sword_wood_Id)
465 ITEM(Item::shovel_wood_Id)
466 ITEM(Item::pickAxe_wood_Id)
467 ITEM(Item::hatchet_wood_Id)
468 ITEM(Item::hoe_wood_Id)
469
470 ITEM(Item::emptyMap_Id)
471 ITEM(Item::helmet_chain_Id)
472 ITEM(Item::chestplate_chain_Id)
473 ITEM(Item::leggings_chain_Id)
474 ITEM(Item::boots_chain_Id)
475 ITEM(Item::sword_stone_Id)
476 ITEM(Item::shovel_stone_Id)
477 ITEM(Item::pickAxe_stone_Id)
478 ITEM(Item::hatchet_stone_Id)
479 ITEM(Item::hoe_stone_Id)
480
481 ITEM(Item::bow_Id)
482 ITEM(Item::helmet_iron_Id)
483 ITEM(Item::chestplate_iron_Id)
484 ITEM(Item::leggings_iron_Id)
485 ITEM(Item::boots_iron_Id)
486 ITEM(Item::sword_iron_Id)
487 ITEM(Item::shovel_iron_Id)
488 ITEM(Item::pickAxe_iron_Id)
489 ITEM(Item::hatchet_iron_Id)
490 ITEM(Item::hoe_iron_Id)
491
492 ITEM(Item::arrow_Id)
493 ITEM(Item::helmet_gold_Id)
494 ITEM(Item::chestplate_gold_Id)
495 ITEM(Item::leggings_gold_Id)
496 ITEM(Item::boots_gold_Id)
497 ITEM(Item::sword_gold_Id)
498 ITEM(Item::shovel_gold_Id)
499 ITEM(Item::pickAxe_gold_Id)
500 ITEM(Item::hatchet_gold_Id)
501 ITEM(Item::hoe_gold_Id)
502
503 ITEM(Item::flintAndSteel_Id)
504 ITEM(Item::helmet_diamond_Id)
505 ITEM(Item::chestplate_diamond_Id)
506 ITEM(Item::leggings_diamond_Id)
507 ITEM(Item::boots_diamond_Id)
508 ITEM(Item::sword_diamond_Id)
509 ITEM(Item::shovel_diamond_Id)
510 ITEM(Item::pickAxe_diamond_Id)
511 ITEM(Item::hatchet_diamond_Id)
512 ITEM(Item::hoe_diamond_Id)
513
514 ITEM(Item::fireball_Id)
515 ITEM(Item::clock_Id)
516 ITEM(Item::shears_Id)
517 ITEM(Item::fishingRod_Id)
518 ITEM(Item::carrotOnAStick_Id)
519 ITEM(Item::lead_Id)
520 ITEM(Item::horseArmorDiamond_Id)
521 ITEM(Item::horseArmorGold_Id)
522 ITEM(Item::horseArmorMetal_Id)
523
524 for(unsigned int i = 0; i < Enchantment::enchantments.length; ++i)
525 {
526 Enchantment *enchantment = Enchantment::enchantments[i];
527 if (enchantment == NULL || enchantment->category == NULL) continue;
528 list->push_back(Item::enchantedBook->createForEnchantment(new EnchantmentInstance(enchantment, enchantment->getMaxLevel())));
529 }
530
531#ifndef _CONTENT_PACKAGE
532 if(app.DebugSettingsOn())
533 {
534 shared_ptr<ItemInstance> debugSword = shared_ptr<ItemInstance>(new ItemInstance(Item::sword_diamond_Id, 1, 0));
535 debugSword->enchant( Enchantment::damageBonus, 50 );
536 debugSword->setHoverName(L"Sword of Debug");
537 list->push_back(debugSword);
538 }
539#endif
540
541 // Materials
542 DEF(eCreativeInventory_Materials)
543 ITEM(Item::coal_Id)
544 ITEM_AUX(Item::coal_Id,1)
545 ITEM(Item::diamond_Id)
546 ITEM(Item::emerald_Id)
547 ITEM(Item::ironIngot_Id)
548 ITEM(Item::goldIngot_Id)
549 ITEM(Item::netherQuartz_Id)
550 ITEM(Item::brick_Id)
551 ITEM(Item::netherbrick_Id)
552 ITEM(Item::stick_Id)
553 ITEM(Item::bowl_Id)
554 ITEM(Item::bone_Id)
555 ITEM(Item::string_Id)
556 ITEM(Item::feather_Id)
557 ITEM(Item::flint_Id)
558 ITEM(Item::leather_Id)
559 ITEM(Item::gunpowder_Id)
560 ITEM(Item::clay_Id)
561 ITEM(Item::yellowDust_Id)
562 ITEM(Item::seeds_wheat_Id)
563 ITEM(Item::seeds_melon_Id)
564 ITEM(Item::seeds_pumpkin_Id)
565 ITEM(Item::wheat_Id)
566 ITEM(Item::reeds_Id)
567 ITEM(Item::egg_Id)
568 ITEM(Item::sugar_Id)
569 ITEM(Item::slimeBall_Id)
570 ITEM(Item::blazeRod_Id)
571 ITEM(Item::goldNugget_Id)
572 ITEM(Item::netherwart_seeds_Id)
573 ITEM_AUX(Item::dye_powder_Id,1) // Red
574 ITEM_AUX(Item::dye_powder_Id,14) // Orange
575 ITEM_AUX(Item::dye_powder_Id,11) // Yellow
576 ITEM_AUX(Item::dye_powder_Id,10) // Lime
577 ITEM_AUX(Item::dye_powder_Id,12) // Light Blue
578 ITEM_AUX(Item::dye_powder_Id,6) // Cyan
579 ITEM_AUX(Item::dye_powder_Id,4) // Blue
580 ITEM_AUX(Item::dye_powder_Id,5) // Purple
581 ITEM_AUX(Item::dye_powder_Id,13) // Magenta
582 ITEM_AUX(Item::dye_powder_Id,9) // Pink
583 ITEM_AUX(Item::dye_powder_Id,15) // Bone Meal
584 ITEM_AUX(Item::dye_powder_Id,7) // Light gray
585 ITEM_AUX(Item::dye_powder_Id,8) // Gray
586 ITEM_AUX(Item::dye_powder_Id,0) // black (ink sac)
587 ITEM_AUX(Item::dye_powder_Id,2) // Green
588 ITEM_AUX(Item::dye_powder_Id,3) // Brown
589
590 // Brewing (TODO)
591 DEF(eCreativeInventory_Brewing)
592 ITEM(Item::expBottle_Id)
593
594 // 4J Stu - Anything else added here also needs to be added to the key handler below
595 ITEM(Item::ghastTear_Id)
596 ITEM(Item::fermentedSpiderEye_Id)
597 ITEM(Item::blazePowder_Id)
598 ITEM(Item::magmaCream_Id)
599 ITEM(Item::speckledMelon_Id)
600 ITEM(Item::glassBottle_Id)
601 ITEM_AUX(Item::potion_Id,0) // Water bottle
602 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_TYPE_AWKWARD)) // Awkward Potion
603
604
605 DEF(eCreativeInventory_Potions_Basic)
606 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_REGENERATION))
607 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SPEED))
608 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_FIRE_RESISTANCE))
609 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_POISON))
610 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTHEALTH))
611 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS))
612 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_STRENGTH))
613 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS))
614 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTDAMAGE))
615 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_REGENERATION))
616 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_SPEED))
617 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_FIRE_RESISTANCE))
618 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_POISON))
619 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INSTANTHEALTH))
620 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_WEAKNESS))
621 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_STRENGTH))
622 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_SLOWNESS))
623 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INSTANTDAMAGE))
624
625 DEF(eCreativeInventory_Potions_Level2)
626 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_REGENERATION))
627 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_SPEED))
628 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_FIRE_RESISTANCE))
629 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_POISON))
630 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH))
631 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_NIGHTVISION))
632 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INVISIBILITY))
633
634 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS))
635 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_STRENGTH))
636 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS))
637 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE))
638 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_REGENERATION))
639 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_SPEED))
640 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_FIRE_RESISTANCE))
641 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_POISON))
642 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTHEALTH))
643 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_NIGHTVISION))
644 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INVISIBILITY))
645 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_WEAKNESS))
646 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_STRENGTH))
647 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_SLOWNESS))
648 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTDAMAGE))
649
650 DEF(eCreativeInventory_Potions_Extended)
651 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_REGENERATION))
652 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SPEED))
653 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE))
654 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_POISON))
655 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH))
656 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion.
657 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion.
658 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS))
659 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_STRENGTH))
660 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS))
661 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE))
662 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_REGENERATION))
663 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SPEED))
664 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_FIRE_RESISTANCE))
665 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_POISON))
666 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTHEALTH))
667 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion.
668 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion.
669 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_WEAKNESS))
670 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_STRENGTH))
671 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SLOWNESS))
672 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTDAMAGE))
673
674 DEF(eCreativeInventory_Potions_Level2_Extended)
675 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_REGENERATION))
676 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_SPEED))
677 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE))
678 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_POISON))
679 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH))
680 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_NIGHTVISION))
681 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_INVISIBILITY))
682 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion.
683 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion.
684 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS))
685 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_STRENGTH))
686 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS))
687 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE))
688 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_REGENERATION))
689 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_SPEED))
690 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_FIRE_RESISTANCE))
691 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_POISON))
692 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTHEALTH))
693 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_NIGHTVISION))
694 //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_INVISIBILITY))
695 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion.
696 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion.
697 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_WEAKNESS))
698 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_STRENGTH))
699 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SLOWNESS))
700 ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTDAMAGE))
701
702
703 specs = new TabSpec*[eCreativeInventoryTab_COUNT];
704
705 // Top Row
706 ECreative_Inventory_Groups blocksGroup[] = {eCreativeInventory_BuildingBlocks};
707 specs[eCreativeInventoryTab_BuildingBlocks] = new TabSpec(L"Structures", IDS_GROUPNAME_BUILDING_BLOCKS, 1, blocksGroup);
708
709#ifndef _CONTENT_PACKAGE
710 ECreative_Inventory_Groups decorationsGroup[] = {eCreativeInventory_Decoration};
711 ECreative_Inventory_Groups debugDecorationsGroup[] = {eCreativeInventory_ArtToolsDecorations};
712 specs[eCreativeInventoryTab_Decorations] = new TabSpec(L"Decoration", IDS_GROUPNAME_DECORATIONS, 1, decorationsGroup, 0, NULL, 1, debugDecorationsGroup);
713#else
714 ECreative_Inventory_Groups decorationsGroup[] = {eCreativeInventory_Decoration};
715 specs[eCreativeInventoryTab_Decorations] = new TabSpec(L"Decoration", IDS_GROUPNAME_DECORATIONS, 1, decorationsGroup);
716#endif
717
718 ECreative_Inventory_Groups redAndTranGroup[] = {eCreativeInventory_Transport, eCreativeInventory_Redstone};
719 specs[eCreativeInventoryTab_RedstoneAndTransport] = new TabSpec(L"RedstoneAndTransport", IDS_GROUPNAME_REDSTONE_AND_TRANSPORT, 2, redAndTranGroup);
720
721 ECreative_Inventory_Groups materialsGroup[] = {eCreativeInventory_Materials};
722 specs[eCreativeInventoryTab_Materials] = new TabSpec(L"Materials", IDS_GROUPNAME_MATERIALS, 1, materialsGroup);
723
724 ECreative_Inventory_Groups foodGroup[] = {eCreativeInventory_Food};
725 specs[eCreativeInventoryTab_Food] = new TabSpec(L"Food", IDS_GROUPNAME_FOOD, 1, foodGroup);
726
727 ECreative_Inventory_Groups toolsGroup[] = {eCreativeInventory_ToolsArmourWeapons};
728 specs[eCreativeInventoryTab_ToolsWeaponsArmor] = new TabSpec(L"Tools", IDS_GROUPNAME_TOOLS_WEAPONS_ARMOR, 1, toolsGroup);
729
730 ECreative_Inventory_Groups brewingGroup[] = {eCreativeInventory_Brewing, eCreativeInventory_Potions_Level2_Extended, eCreativeInventory_Potions_Extended, eCreativeInventory_Potions_Level2, eCreativeInventory_Potions_Basic};
731
732 // Just use the text LT - the graphic doesn't fit in splitscreen either
733 // In 480p there's not enough room for the LT button, so use text instead
734 //if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
735 {
736 specs[eCreativeInventoryTab_Brewing] = new TabSpec(L"Brewing", IDS_GROUPNAME_POTIONS_480, 5, brewingGroup);
737 }
738 // else
739 // {
740 // specs[eCreativeInventoryTab_Brewing] = new TabSpec(L"icon_brewing.png", IDS_GROUPNAME_POTIONS, 1, brewingGroup, 4, potionsGroup);
741 // }
742
743#ifndef _CONTENT_PACKAGE
744 ECreative_Inventory_Groups miscGroup[] = {eCreativeInventory_Misc};
745 ECreative_Inventory_Groups debugMiscGroup[] = {eCreativeInventory_ArtToolsMisc};
746 specs[eCreativeInventoryTab_Misc] = new TabSpec(L"Misc", IDS_GROUPNAME_MISCELLANEOUS, 1, miscGroup, 0, NULL, 1, debugMiscGroup);
747#else
748 ECreative_Inventory_Groups miscGroup[] = {eCreativeInventory_Misc};
749 specs[eCreativeInventoryTab_Misc] = new TabSpec(L"Misc", IDS_GROUPNAME_MISCELLANEOUS, 1, miscGroup);
750#endif
751}
752
753IUIScene_CreativeMenu::IUIScene_CreativeMenu()
754{
755 m_bCarryingCreativeItem = false;
756 m_creativeSlotX = m_creativeSlotY = m_inventorySlotX = m_inventorySlotY = 0;
757
758 // 4J JEV - Settup Tabs
759 for (int i = 0; i < eCreativeInventoryTab_COUNT; i++)
760 {
761 m_tabDynamicPos[i] = 0;
762 m_tabPage[i] = 0;
763 }
764}
765
766/* 4J JEV - Switches between tabs.
767*/
768void IUIScene_CreativeMenu::switchTab(ECreativeInventoryTabs tab)
769{
770 // Could just be changing page on the current tab
771 if(tab != m_curTab) updateTabHighlightAndText(tab);
772
773 m_curTab = tab;
774
775 updateScrollCurrentPage(m_tabPage[m_curTab] + 1, specs[m_curTab]->getPageCount());
776
777 specs[tab]->populateMenu(itemPickerMenu,m_tabDynamicPos[m_curTab], m_tabPage[m_curTab]);
778}
779
780void IUIScene_CreativeMenu::ScrollBar(UIVec2D pointerPos)
781{
782 UIVec2D pos;
783 UIVec2D size;
784 GetItemScreenData(eSectionInventoryCreativeSlider, 0, &pos, &size);
785 float fPosition = ((float)pointerPos.y - pos.y) / size.y;
786
787 // clamp
788 if(fPosition > 1)
789 fPosition = 1.0f;
790 else if(fPosition < 0)
791 fPosition = 0.0f;
792
793 // calculate page position according to page count
794 int iCurrentPage = Math::round(fPosition * (specs[m_curTab]->getPageCount() - 1));
795
796 // set tab page
797 m_tabPage[m_curTab] = iCurrentPage;
798
799 // update tab
800 switchTab(m_curTab);
801}
802
803// 4J JEV - Tab Spec Struct
804
805IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups, int debugGroupsCount /*= 0*/, ECreative_Inventory_Groups *debugGroups /*= NULL*/)
806 : m_icon(icon), m_descriptionId(descriptionId), m_staticGroupsCount(staticGroupsCount), m_dynamicGroupsCount(dynamicGroupsCount), m_debugGroupsCount(debugGroupsCount)
807{
808
809 m_pages = 0;
810 m_staticGroupsA = NULL;
811
812 unsigned int dynamicItems = 0;
813 m_staticItems = 0;
814
815 if(staticGroupsCount > 0)
816 {
817 m_staticGroupsA = new ECreative_Inventory_Groups[staticGroupsCount];
818 for(int i = 0; i < staticGroupsCount; ++i)
819 {
820 m_staticGroupsA[i] = staticGroups[i];
821 m_staticItems += categoryGroups[m_staticGroupsA[i]].size();
822 }
823 }
824
825 m_debugGroupsA = NULL;
826 m_debugItems = 0;
827 if(debugGroupsCount > 0)
828 {
829 m_debugGroupsA = new ECreative_Inventory_Groups[debugGroupsCount];
830 for(int i = 0; i < debugGroupsCount; ++i)
831 {
832 m_debugGroupsA[i] = debugGroups[i];
833 m_debugItems += categoryGroups[m_debugGroupsA[i]].size();
834 }
835 }
836
837 m_dynamicGroupsA = NULL;
838 if(dynamicGroupsCount > 0 && dynamicGroups != NULL)
839 {
840 m_dynamicGroupsA = new ECreative_Inventory_Groups[dynamicGroupsCount];
841 for(int i = 0; i < dynamicGroupsCount; ++i)
842 {
843 m_dynamicGroupsA[i] = dynamicGroups[i];
844 dynamicItems += categoryGroups[m_dynamicGroupsA[i]].size();
845 }
846 }
847
848 m_staticPerPage = columns;
849 const int totalRows = (m_staticItems + columns - 1) / columns;
850 m_pages = std::max<int>(1, totalRows - 5 + 1);
851}
852
853IUIScene_CreativeMenu::TabSpec::~TabSpec()
854{
855 if(m_staticGroupsA != NULL) delete [] m_staticGroupsA;
856 if(m_dynamicGroupsA != NULL) delete [] m_dynamicGroupsA;
857 if(m_debugGroupsA != NULL) delete [] m_debugGroupsA;
858}
859
860void IUIScene_CreativeMenu::TabSpec::populateMenu(AbstractContainerMenu *menu, int dynamicIndex, unsigned int page)
861{
862 int lastSlotIndex = 0;
863
864 // Fill the dynamic group
865 if(m_dynamicGroupsCount > 0 && m_dynamicGroupsA != NULL)
866 {
867 for(AUTO_VAR(it, categoryGroups[m_dynamicGroupsA[dynamicIndex]].rbegin()); it != categoryGroups[m_dynamicGroupsA[dynamicIndex]].rend() && lastSlotIndex < MAX_SIZE; ++it)
868 {
869 Slot *slot = menu->getSlot(++lastSlotIndex);
870 slot->set( *it );
871 }
872 }
873
874 // Fill from the static groups
875 unsigned int startIndex = page * m_staticPerPage;
876
877 // Work out the first group with an item the want to display, and which item in that group
878 unsigned int currentIndex = 0;
879 unsigned int currentGroup = 0;
880 unsigned int currentItem = 0;
881 bool displayStatic = false;
882 for(; currentGroup < m_staticGroupsCount; ++currentGroup)
883 {
884 int size = categoryGroups[m_staticGroupsA[currentGroup]].size();
885 if( currentIndex + size < startIndex)
886 {
887 currentIndex += size;
888 continue;
889 }
890 displayStatic = true;
891 currentItem = size - ((currentIndex + size) - startIndex);
892 break;
893 }
894
895 int lastStaticPageCount = currentIndex;
896 while(lastStaticPageCount > m_staticPerPage) lastStaticPageCount -= m_staticPerPage;
897
898 if(displayStatic)
899 {
900 for(; lastSlotIndex < MAX_SIZE;)
901 {
902 Slot *slot = menu->getSlot(lastSlotIndex++);
903 slot->set(categoryGroups[m_staticGroupsA[currentGroup]][currentItem]);
904
905 ++currentItem;
906 if(currentItem >= categoryGroups[m_staticGroupsA[currentGroup]].size())
907 {
908 currentItem = 0;
909 ++currentGroup;
910 if(currentGroup >= m_staticGroupsCount)
911 {
912 break;
913 }
914 }
915 }
916 }
917
918#ifndef _CONTENT_PACKAGE
919 if(app.DebugArtToolsOn())
920 {
921 if(m_debugGroupsCount > 0)
922 {
923 startIndex = 0;
924 if(lastStaticPageCount != 0)
925 {
926 startIndex = m_staticPerPage - lastStaticPageCount;
927 }
928 currentIndex = 0;
929 currentGroup = 0;
930 currentItem = 0;
931 bool showDebug = false;
932 for(; currentGroup < m_debugGroupsCount; ++currentGroup)
933 {
934 int size = categoryGroups[m_debugGroupsA[currentGroup]].size();
935 if( currentIndex + size < startIndex)
936 {
937 currentIndex += size;
938 continue;
939 }
940 currentItem = size - ((currentIndex + size) - startIndex);
941 break;
942 }
943
944 for(; lastSlotIndex < MAX_SIZE;)
945 {
946 Slot *slot = menu->getSlot(lastSlotIndex++);
947 slot->set(categoryGroups[m_debugGroupsA[currentGroup]][currentItem]);
948
949 ++currentItem;
950 if(currentItem >= categoryGroups[m_debugGroupsA[currentGroup]].size())
951 {
952 currentItem = 0;
953 ++currentGroup;
954 if(currentGroup >= m_debugGroupsCount)
955 {
956 break;
957 }
958 }
959 }
960 }
961 }
962#endif
963
964 for(; lastSlotIndex < MAX_SIZE; ++lastSlotIndex)
965 {
966 Slot *slot = menu->getSlot(lastSlotIndex);
967 slot->remove(1);
968 }
969}
970
971unsigned int IUIScene_CreativeMenu::TabSpec::getPageCount()
972{
973#ifndef _CONTENT_PACKAGE
974 if(app.DebugArtToolsOn())
975 {
976 return (int)ceil((float)(m_staticItems + m_debugItems) / m_staticPerPage);
977 }
978 else
979#endif
980 {
981 return m_pages;
982 }
983}
984
985
986// 4J JEV - Item Picker Menu
987IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( shared_ptr<SimpleContainer> smp, shared_ptr<Inventory> inv ) : AbstractContainerMenu()
988{
989 inventory = inv;
990 creativeContainer = smp;
991
992 //int startLength = slots->size();
993
994 Slot *slot = NULL;
995 for (int i = 0; i < TabSpec::MAX_SIZE; i++)
996 {
997 // 4J JEV - These values get set by addSlot anyway.
998 slot = new Slot( creativeContainer, i, -1, -1);
999
1000 ItemPickerMenu::addSlot( slot );
1001 }
1002
1003 for (int i = 0; i < 9; i++)
1004 {
1005 slot = new Slot( inventory, i, -1, -1 );
1006 ItemPickerMenu::addSlot( slot );
1007 }
1008
1009 // 4J Stu - Give the creative menu a unique container id
1010 containerId = CONTAINER_ID_CREATIVE;
1011}
1012
1013bool IUIScene_CreativeMenu::ItemPickerMenu::stillValid(shared_ptr<Player> player)
1014{
1015 return true;
1016}
1017
1018bool IUIScene_CreativeMenu::ItemPickerMenu::isOverrideResultClick(int slotNum, int buttonNum)
1019{
1020 return slotNum >= 0 && slotNum < 9 && buttonNum == 0;
1021}
1022
1023IUIScene_AbstractContainerMenu::ESceneSection IUIScene_CreativeMenu::GetSectionAndSlotInDirection( ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY )
1024{
1025 ESceneSection newSection = eSection;
1026
1027 // Find the new section if there is one
1028 switch( eSection )
1029 {
1030 case eSectionInventoryCreativeSelector:
1031 if (eTapDirection == eTapStateDown || eTapDirection == eTapStateUp)
1032 {
1033 newSection = eSectionInventoryCreativeUsing;
1034 }
1035 break;
1036 case eSectionInventoryCreativeUsing:
1037 if (eTapDirection == eTapStateDown || eTapDirection == eTapStateUp)
1038 {
1039 newSection = eSectionInventoryCreativeSelector;
1040 }
1041 break;
1042 case eSectionInventoryCreativeTab_0:
1043 case eSectionInventoryCreativeTab_1:
1044 case eSectionInventoryCreativeTab_2:
1045 case eSectionInventoryCreativeTab_3:
1046 case eSectionInventoryCreativeTab_4:
1047 case eSectionInventoryCreativeTab_5:
1048 case eSectionInventoryCreativeTab_6:
1049 case eSectionInventoryCreativeTab_7:
1050 case eSectionInventoryCreativeSlider:
1051 /* do nothing */
1052 break;
1053 default:
1054 assert( false );
1055 break;
1056 }
1057
1058 updateSlotPosition(eSection, newSection, eTapDirection, piTargetX, piTargetY, 0);
1059
1060 return newSection;
1061}
1062
1063bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL quickKeyHeld)
1064{
1065 // 4J Added - Make pressing the X button clear the hotbar
1066 if(buttonNum == 1)
1067 {
1068 Minecraft *pMinecraft = Minecraft::GetInstance();
1069 for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
1070 {
1071 shared_ptr<ItemInstance> newItem = m_menu->getSlot(i)->getItem();
1072
1073 if(newItem != NULL)
1074 {
1075 m_menu->getSlot(i)->set(nullptr);
1076 // call this function to synchronize multiplayer item bar
1077 pMinecraft->localgameModes[iPad]->handleCreativeModeItemAdd(nullptr, i - (int)m_menu->slots.size() + 9 + InventoryMenu::USE_ROW_SLOT_START);
1078 }
1079 }
1080 return true;
1081 }
1082 return false;
1083}
1084
1085void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld)
1086{
1087 // Drop items.
1088 Minecraft *pMinecraft = Minecraft::GetInstance();
1089
1090 shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[iPad]->inventory;
1091 if (playerInventory->getCarried() != NULL)
1092 {
1093 if (buttonNum == 0)
1094 {
1095 pMinecraft->localgameModes[iPad]->handleCreativeModeItemDrop(playerInventory->getCarried());
1096 playerInventory->setCarried(nullptr);
1097 }
1098 if (buttonNum == 1)
1099 {
1100 shared_ptr<ItemInstance> removedItem = playerInventory->getCarried()->remove(1);
1101 pMinecraft->localgameModes[iPad]->handleCreativeModeItemDrop(removedItem);
1102 if (playerInventory->getCarried()->count == 0) playerInventory->setCarried(nullptr);
1103 }
1104 }
1105
1106 //pMinecraft->localgameModes[m_iPad]->handleInventoryMouseClick(menu->containerId, AbstractContainerMenu::CLICKED_OUTSIDE, buttonNum, quickKeyHeld?true:false, pMinecraft->localplayers[m_iPad] );
1107}
1108
1109void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction)
1110{
1111 int dir = 1;
1112 switch(iAction)
1113 {
1114 case ACTION_MENU_LEFT_SCROLL:
1115 dir = -1;
1116 // Fall through intentional
1117 case ACTION_MENU_RIGHT_SCROLL:
1118 {
1119 ECreativeInventoryTabs tab = (ECreativeInventoryTabs)(m_curTab + dir);
1120 if (tab < 0) tab = (ECreativeInventoryTabs)(eCreativeInventoryTab_COUNT - 1);
1121 if (tab >= eCreativeInventoryTab_COUNT) tab = eCreativeInventoryTab_BuildingBlocks;
1122 switchTab(tab);
1123 ui.PlayUISFX(eSFX_Focus);
1124 }
1125 break;
1126 case ACTION_MENU_PAGEUP:
1127 // change the potion strength
1128 {
1129 ++m_tabDynamicPos[m_curTab];
1130 if(m_tabDynamicPos[m_curTab] >= specs[m_curTab]->m_dynamicGroupsCount) m_tabDynamicPos[m_curTab] = 0;
1131 switchTab(m_curTab);
1132 }
1133 break;
1134 case ACTION_MENU_OTHER_STICK_DOWN:
1135 ++m_tabPage[m_curTab];
1136 if(m_tabPage[m_curTab] >= specs[m_curTab]->getPageCount())
1137 {
1138 m_tabPage[m_curTab] = specs[m_curTab]->getPageCount() - 1;
1139 }
1140 else
1141 {
1142 switchTab(m_curTab);
1143 }
1144 break;
1145 case ACTION_MENU_OTHER_STICK_UP:
1146 --m_tabPage[m_curTab];
1147 if(m_tabPage[m_curTab] < 0)
1148 {
1149 m_tabPage[m_curTab] = 0;
1150 }
1151 else
1152 {
1153 switchTab(m_curTab);
1154 }
1155 break;
1156 }
1157}
1158
1159void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld)
1160{
1161 int currentIndex = getCurrentIndex(eSection);
1162
1163 Minecraft *pMinecraft = Minecraft::GetInstance();
1164
1165 bool instantPlace = false;
1166 if (eSection == eSectionInventoryCreativeSelector)
1167 {
1168 if (buttonNum == 0)
1169 {
1170
1171 shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
1172 shared_ptr<ItemInstance> carried = playerInventory->getCarried();
1173 shared_ptr<ItemInstance> clicked = m_menu->getSlot(currentIndex)->getItem();
1174 if (clicked != NULL)
1175 {
1176 playerInventory->setCarried(ItemInstance::clone(clicked));
1177 carried = playerInventory->getCarried();
1178 if (quickKeyHeld == TRUE)
1179 {
1180 carried->count = carried->getMaxStackSize();
1181 }
1182 m_creativeSlotX = m_iCurrSlotX;
1183 m_creativeSlotY = m_iCurrSlotY;
1184 m_eCurrSection = eSectionInventoryCreativeUsing;
1185 m_eCurrTapState = eTapStateJump;
1186
1187 instantPlace = getEmptyInventorySlot(carried, m_inventorySlotX);
1188 m_iCurrSlotX = m_inventorySlotX;
1189 m_iCurrSlotY = m_inventorySlotY;
1190
1191 m_bCarryingCreativeItem = true;
1192 }
1193 }
1194 }
1195 if(instantPlace || eSection == eSectionInventoryCreativeUsing)
1196 {
1197 if(instantPlace)
1198 {
1199 setSectionSelectedSlot(eSectionInventoryCreativeUsing,m_iCurrSlotX,m_iCurrSlotY);
1200 currentIndex = getCurrentIndex(eSectionInventoryCreativeUsing);
1201 buttonNum = 0;
1202 quickKeyHeld = FALSE;
1203 }
1204 m_menu->clicked(currentIndex, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, pMinecraft->localplayers[getPad()]);
1205 shared_ptr<ItemInstance> newItem = m_menu->getSlot(currentIndex)->getItem();
1206 // call this function to synchronize multiplayer item bar
1207 pMinecraft->localgameModes[getPad()]->handleCreativeModeItemAdd(newItem, currentIndex - (int)m_menu->slots.size() + 9 + InventoryMenu::USE_ROW_SLOT_START);
1208
1209 if(m_bCarryingCreativeItem)
1210 {
1211 m_inventorySlotX = m_iCurrSlotX;
1212 m_inventorySlotY = m_iCurrSlotY;
1213 m_eCurrSection = eSectionInventoryCreativeSelector;
1214 m_eCurrTapState = eTapStateJump;
1215 m_iCurrSlotX = m_creativeSlotX;
1216 m_iCurrSlotY = m_creativeSlotY;
1217
1218 shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
1219 playerInventory->setCarried(nullptr);
1220 m_bCarryingCreativeItem = false;
1221 }
1222 }
1223}
1224
1225bool IUIScene_CreativeMenu::IsSectionSlotList( ESceneSection eSection )
1226{
1227 switch( eSection )
1228 {
1229 case eSectionInventoryCreativeUsing:
1230 case eSectionInventoryCreativeSelector:
1231 return true;
1232 }
1233 return false;
1234}
1235
1236bool IUIScene_CreativeMenu::CanHaveFocus( ESceneSection eSection )
1237{
1238 switch( eSection )
1239 {
1240 case eSectionInventoryCreativeUsing:
1241 case eSectionInventoryCreativeSelector:
1242 return true;
1243 }
1244 return false;
1245}
1246
1247bool IUIScene_CreativeMenu::getEmptyInventorySlot(shared_ptr<ItemInstance> item, int &slotX)
1248{
1249 bool sameItemFound = false;
1250 bool emptySlotFound = false;
1251 // Jump to the slot with this item already on it, if we can stack more
1252 for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
1253 {
1254 shared_ptr<ItemInstance> slotItem = m_menu->getSlot(i)->getItem();
1255 if( slotItem != NULL && slotItem->sameItemWithTags(item) && (slotItem->GetCount() + item->GetCount() <= item->getMaxStackSize() ))
1256 {
1257 sameItemFound = true;
1258 slotX = i - TabSpec::MAX_SIZE;
1259 break;
1260 }
1261 }
1262
1263 if(!sameItemFound)
1264 {
1265 // Find an empty slot
1266 for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
1267 {
1268 if( m_menu->getSlot(i)->getItem() == NULL )
1269 {
1270 slotX = i - TabSpec::MAX_SIZE;
1271 emptySlotFound = true;
1272 break;
1273 }
1274 }
1275 }
1276 return sameItemFound || emptySlotFound;
1277}
1278
1279int IUIScene_CreativeMenu::getSectionStartOffset(ESceneSection eSection)
1280{
1281 int offset = 0;
1282 switch( eSection )
1283 {
1284 case eSectionInventoryCreativeSelector:
1285 offset = 0;
1286 break;
1287 case eSectionInventoryCreativeUsing:
1288 offset = TabSpec::MAX_SIZE;
1289 break;
1290 default:
1291 assert( false );
1292 break;
1293 }
1294 return offset;
1295}
1296
1297bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
1298 EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT, EToolTipItem &buttonBack)
1299{
1300 bool _override = false;
1301
1302 if(sectionUnderPointer == eSectionInventoryCreativeSelector)
1303 {
1304 if(bSlotHasItem)
1305 {
1306 buttonA = eToolTipPickUpGeneric;
1307
1308 if(itemUnderPointer->isStackable())
1309 {
1310 buttonY = eToolTipPickUpAll;
1311 }
1312 else
1313 {
1314 buttonY = eToolTipNone; //eToolTipPickUpGeneric;
1315 }
1316 }
1317 }
1318 else if(sectionUnderPointer == eSectionInventoryCreativeUsing)
1319 {
1320 buttonY = eToolTipNone;
1321 }
1322 buttonX = eToolTipClearQuickSelect;
1323 _override = true;
1324
1325 return _override;
1326}
1327
1328void IUIScene_CreativeMenu::BuildFirework(vector<shared_ptr<ItemInstance> > *list, byte type, int color, int sulphur, bool flicker, bool trail, int fadeColor/*= -1*/)
1329{
1330 /////////////////////////////////
1331 // Create firecharge
1332 /////////////////////////////////
1333
1334
1335 CompoundTag *expTag = new CompoundTag(FireworksItem::TAG_EXPLOSION);
1336
1337 vector<int> colors;
1338
1339 colors.push_back(DyePowderItem::COLOR_RGB[color]);
1340
1341 // glowstone dust gives flickering
1342 if (flicker) expTag->putBoolean(FireworksItem::TAG_E_FLICKER, true);
1343
1344 // diamonds give trails
1345 if (trail) expTag->putBoolean(FireworksItem::TAG_E_TRAIL, true);
1346
1347 intArray colorArray(colors.size());
1348 for (int i = 0; i < colorArray.length; i++)
1349 {
1350 colorArray[i] = colors.at(i);
1351 }
1352 expTag->putIntArray(FireworksItem::TAG_E_COLORS, colorArray);
1353 // delete colorArray.data;
1354
1355 expTag->putByte(FireworksItem::TAG_E_TYPE, type);
1356
1357 if (fadeColor != -1)
1358 {
1359 ////////////////////////////////////
1360 // Apply fade colors to firecharge
1361 ////////////////////////////////////
1362
1363 vector<int> colors;
1364 colors.push_back(DyePowderItem::COLOR_RGB[fadeColor]);
1365
1366 intArray colorArray(colors.size());
1367 for (int i = 0; i < colorArray.length; i++)
1368 {
1369 colorArray[i] = colors.at(i);
1370 }
1371 expTag->putIntArray(FireworksItem::TAG_E_FADECOLORS, colorArray);
1372 }
1373
1374 /////////////////////////////////
1375 // Create fireworks
1376 /////////////////////////////////
1377
1378 shared_ptr<ItemInstance> firework;
1379
1380 {
1381 firework = shared_ptr<ItemInstance>( new ItemInstance(Item::fireworks) );
1382 CompoundTag *itemTag = new CompoundTag();
1383 CompoundTag *fireTag = new CompoundTag(FireworksItem::TAG_FIREWORKS);
1384 ListTag<CompoundTag> *expTags = new ListTag<CompoundTag>(FireworksItem::TAG_EXPLOSIONS);
1385
1386 expTags->add(expTag);
1387
1388 fireTag->put(FireworksItem::TAG_EXPLOSIONS, expTags);
1389 fireTag->putByte(FireworksItem::TAG_FLIGHT, (byte) sulphur);
1390
1391 itemTag->put(FireworksItem::TAG_FIREWORKS, fireTag);
1392
1393 firework->setTag(itemTag);
1394 }
1395
1396 list->push_back(firework);
1397}