fork
Configure Feed
Select the types of activity you want to include in your feed.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
fork
Configure Feed
Select the types of activity you want to include in your feed.
1#pragma once
2// #include "Material.h"
3// #include "Vec3.h"
4// #include "Definitions.h"
5// #include "SoundTypes.h"
6// using namespace std;
7#include "Icon_SPU.h"
8#include "Material_SPU.h"
9#include <stddef.h>
10
11class ChunkRebuildData;
12class GrassTile_SPU;
13class LeafTile;
14class TallGrass;
15class DeadBushTile;
16class FireTile;
17class PortalTile;
18class MycelTile;
19class PistonExtensionTile;
20class PistonMovingPiece;
21class StoneTile;
22class stoneBrick;
23class Bush;
24class StairTile;
25class LiquidTile;
26class PistonBaseTile;
27class ChestTile;
28class RedStoneDustTile;
29class RepeaterTile;
30class CauldronTile;
31class TripWireSourceTile;
32class Random;
33class HitResult;
34class Level;
35
36class Player;
37class LevelSource;
38class Mob;
39class TileEntity;
40class HalfSlabTile;
41class IconRegister;
42
43class TileData_SPU
44{
45public:
46
47 class Bitfield256
48 {
49 unsigned int m_data[8];
50
51 void setBit(unsigned char i){ m_data[i>>5] |= (1<<(i%32)); }
52 void clearBit(unsigned char i) { m_data[i>>5] &= ~(1<<(i%32)); }
53 public:
54 bool operator[](unsigned char i) { return (m_data[i>>5] & 1<<(i%32)) != 0; }
55 void set(unsigned char i, bool val){ (val) ? setBit(i) : clearBit(i); }
56 };
57 Bitfield256 mipmapEnable;
58 Bitfield256 solid;
59 Bitfield256 transculent;
60 Bitfield256 _sendTileData;
61 Bitfield256 propagate;
62 Bitfield256 signalSource;
63 Bitfield256 cubeShaped;
64
65
66 char lightBlock[256];
67 char lightEmission[256];
68 char materialIDs[256];
69 Material_SPU materials[Material_SPU::num_Ids];
70
71 float xx0[256];
72 float yy0[256];
73 float zz0[256];
74 float xx1[256];
75 float yy1[256];
76 float zz1[256];
77
78 int iconTexWidth;
79 int iconTexHeight;
80 Icon_SPU iconData[256];
81
82
83 Icon_SPU grass_iconTop;
84 Icon_SPU grass_iconSnowSide;
85 Icon_SPU grass_iconSideOverlay;
86
87 Icon_SPU ironFence_EdgeTexture;
88 Icon_SPU thinGlass_EdgeTexture;
89
90 Icon_SPU farmTile_Wet;
91 Icon_SPU farmTile_Dry;
92
93 Icon_SPU doorTile_Icons[8];
94
95 Icon_SPU tallGrass_Icons[3];
96
97 Icon_SPU sandStone_icons[3];
98 Icon_SPU sandStone_iconTop;
99 Icon_SPU sandStone_iconBottom;
100
101 Icon_SPU woodTile_icons[4];
102
103 Icon_SPU treeTile_icons[4];
104 Icon_SPU treeTile_iconTop;
105
106 Icon_SPU leafTile_icons[2][4];
107 bool leafTile_allowSame;
108 int leafTile_fancyTextureSet;
109
110 Icon_SPU cropTile_icons[8];
111
112 Icon_SPU furnaceTile_iconTop;
113 Icon_SPU furnaceTile_iconFront;
114 Icon_SPU furnaceTile_iconFront_lit;
115
116 Icon_SPU liquidTile_iconWaterStill;
117 Icon_SPU liquidTile_iconWaterFlow;
118 Icon_SPU liquidTile_iconLavaStill;
119 Icon_SPU liquidTile_iconLavaFlow;
120
121 Icon_SPU fireTile_icons[2];
122 Icon_SPU sapling_icons[4];
123
124 bool glassTile_allowSame;
125 bool iceTile_allowSame;
126
127 Icon_SPU dispenserTile_iconTop;
128 Icon_SPU dispenserTile_iconFront;
129 Icon_SPU dispenserTile_iconFrontVertical;
130
131 Icon_SPU railTile_iconTurn;
132 Icon_SPU railTile_iconTurnGolden;
133
134 Icon_SPU detectorRailTile_icons[2];
135
136 Icon_SPU tntTile_iconBottom;
137 Icon_SPU tntTile_iconTop;
138
139 Icon_SPU workBench_iconTop;
140 Icon_SPU workBench_iconFront;
141
142 Icon_SPU cactusTile_iconTop;
143 Icon_SPU cactusTile_iconBottom;
144
145 Icon_SPU recordPlayer_iconTop;
146
147 Icon_SPU pumpkinTile_iconTop;
148 Icon_SPU pumpkinTile_iconFace;
149 Icon_SPU pumpkinTile_iconFaceLit;
150
151 Icon_SPU cakeTile_iconTop;
152 Icon_SPU cakeTile_iconBottom;
153 Icon_SPU cakeTile_iconInner;
154
155 Icon_SPU smoothStoneBrick_icons[4];
156
157 Icon_SPU hugeMushroom_icons[2];
158 Icon_SPU hugeMushroom_iconStem;
159 Icon_SPU hugeMushroom_iconInside;
160
161 Icon_SPU melonTile_iconTop;
162
163 Icon_SPU stemTile_iconAngled;
164
165 Icon_SPU mycelTile_iconTop;
166 Icon_SPU mycelTile_iconSnowSide;
167
168 Icon_SPU netherStalk_icons[3];
169
170 Icon_SPU enchantmentTable_iconTop;
171 Icon_SPU enchantmentTable_iconBottom;
172
173 Icon_SPU brewingStand_iconBase;
174
175 Icon_SPU redStoneDust_iconCross;
176 Icon_SPU redStoneDust_iconLine;
177 Icon_SPU redStoneDust_iconCrossOver;
178 Icon_SPU redStoneDust_iconLineOver;
179
180 Icon_SPU clothTile_icons[16];
181
182 Icon_SPU stoneSlab_iconSide;
183
184 Icon_SPU carrot_icons[4];
185 Icon_SPU potato_icons[4];
186 Icon_SPU anvil_icons[3];
187
188
189 Icon_SPU quartzBlock_icons[5];
190 Icon_SPU quartzBlock_iconChiseledTop;
191 Icon_SPU quartzBlock_iconLinesTop;
192 Icon_SPU quartzBlock_iconTop;
193 Icon_SPU quartzBlock_iconBottom;
194
195
196 int anvilPart; // normally part of the AnvilTile class
197
198 unsigned int stemTile_minColour;
199 unsigned int stemTile_maxColour;
200 unsigned int waterLily_colour;
201
202 unsigned int foliageColor_evergreenColor;
203 unsigned int foliageColor_birchColor;
204
205
206protected:
207// float destroySpeed;
208// float explosionResistance;
209// bool isInventoryItem;
210// bool collectStatistics;
211// int m_iMaterial;
212// int m_iBaseItemType;
213
214
215public:
216// const SoundType *soundType;
217//
218// float gravity;
219// Material *material;
220// float friction;
221
222private:
223// unsigned int descriptionId;
224// unsigned int useDescriptionId; // 4J Added
225//
226// wstring m_textureName;
227
228protected:
229// Icon *icon;
230
231public:
232
233 int getRenderShape();
234
235 void setShape(float x0, float y0, float z0, float x1, float y1, float z1);
236 float getBrightness(ChunkRebuildData *level, int x, int y, int z);
237 int getLightColor(ChunkRebuildData *level, int x, int y, int z); // 4J - brought forward from 1.8.2
238 bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face);
239
240public:
241 Icon_SPU *getTexture(ChunkRebuildData *level, int x, int y, int z, int face);
242 Icon_SPU *getTexture(int face, int data);
243 Icon_SPU *getTexture(int face);
244 public:
245 void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
246 double getShapeX0();
247 double getShapeX1();
248 double getShapeY0();
249 double getShapeY1();
250 double getShapeZ0();
251 double getShapeZ1();
252// int getColor(int auxData);
253 int getColor(ChunkRebuildData *level, int x, int y, int z);
254 float getShadeBrightness(ChunkRebuildData *level, int x, int y, int z); // 4J - brought forward from 1.8.2
255 bool hasMaterialLiquid() { return false; } // material->isLiquid()
256};
257
258class Tile_SPU
259{
260public:
261 static const int SHAPE_INVISIBLE = -1;
262 static const int SHAPE_BLOCK = 0;
263 static const int SHAPE_CROSS_TEXTURE = 1;
264 static const int SHAPE_TORCH = 2;
265 static const int SHAPE_FIRE = 3;
266 static const int SHAPE_WATER = 4;
267 static const int SHAPE_RED_DUST = 5;
268 static const int SHAPE_ROWS = 6;
269 static const int SHAPE_DOOR = 7;
270 static const int SHAPE_LADDER = 8;
271 static const int SHAPE_RAIL = 9;
272 static const int SHAPE_STAIRS = 10;
273 static const int SHAPE_FENCE = 11;
274 static const int SHAPE_LEVER = 12;
275 static const int SHAPE_CACTUS = 13;
276 static const int SHAPE_BED = 14;
277 static const int SHAPE_DIODE = 15;
278 static const int SHAPE_PISTON_BASE = 16;
279 static const int SHAPE_PISTON_EXTENSION = 17;
280 static const int SHAPE_IRON_FENCE = 18;
281 static const int SHAPE_STEM = 19;
282 static const int SHAPE_VINE = 20;
283 static const int SHAPE_FENCE_GATE = 21;
284 static const int SHAPE_ENTITYTILE_ANIMATED = 22;
285 static const int SHAPE_LILYPAD = 23;
286 static const int SHAPE_CAULDRON = 24;
287 static const int SHAPE_BREWING_STAND = 25;
288 static const int SHAPE_PORTAL_FRAME = 26;
289 static const int SHAPE_EGG = 27;
290 static const int SHAPE_COCOA = 28;
291 static const int SHAPE_TRIPWIRE_SOURCE = 29;
292 static const int SHAPE_TRIPWIRE = 30;
293 static const int SHAPE_TREE = 31;
294 static const int SHAPE_WALL = 32;
295 static const int SHAPE_FLOWER_POT = 33;
296 static const int SHAPE_BEACON = 34;
297 static const int SHAPE_ANVIL = 35;
298 static const int SHAPE_QUARTZ = 39;
299
300 // 4J - this array of simple constants made so the compiler can optimise references to Ids that were previous of the form Tile_SPU::<whatever>->id, and are now simply Tile_SPU::whatever_Id
301 static const int rock_Id = 1;
302 static const int grass_Id = 2;
303 static const int dirt_Id = 3;
304 static const int stoneBrick_Id = 4;
305 static const int wood_Id = 5;
306 static const int sapling_Id = 6;
307 static const int unbreakable_Id = 7;
308 static const int water_Id = 8;
309 static const int calmWater_Id = 9;
310 static const int lava_Id = 10;
311 static const int calmLava_Id = 11;
312 static const int sand_Id = 12;
313 static const int gravel_Id = 13;
314 static const int goldOre_Id = 14;
315 static const int ironOre_Id = 15;
316 static const int coalOre_Id = 16;
317 static const int treeTrunk_Id = 17;
318 static const int leaves_Id = 18;
319 static const int sponge_Id = 19;
320 static const int glass_Id = 20;
321 static const int lapisOre_Id = 21;
322 static const int lapisBlock_Id = 22;
323 static const int dispenser_Id = 23;
324 static const int sandStone_Id = 24;
325 static const int musicBlock_Id = 25;
326 static const int bed_Id = 26;
327 static const int goldenRail_Id = 27;
328 static const int detectorRail_Id = 28;
329 static const int pistonStickyBase_Id = 29;
330 static const int web_Id = 30;
331 static const int tallgrass_Id = 31;
332 static const int deadBush_Id = 32;
333 static const int pistonBase_Id = 33;
334 static const int pistonExtensionPiece_Id = 34;
335 static const int cloth_Id = 35;
336 static const int pistonMovingPiece_Id = 36;
337 static const int flower_Id = 37;
338 static const int rose_Id = 38;
339 static const int mushroom1_Id = 39;
340 static const int mushroom2_Id = 40;
341 static const int goldBlock_Id = 41;
342 static const int ironBlock_Id = 42;
343 static const int stoneSlab_Id = 43;
344 static const int stoneSlabHalf_Id = 44;
345 static const int redBrick_Id = 45;
346 static const int tnt_Id = 46;
347 static const int bookshelf_Id = 47;
348 static const int mossStone_Id = 48;
349 static const int obsidian_Id = 49;
350 static const int torch_Id = 50;
351 static const int fire_Id = 51;
352 static const int mobSpawner_Id = 52;
353 static const int stairs_wood_Id = 53;
354 static const int chest_Id = 54;
355 static const int redStoneDust_Id = 55;
356 static const int diamondOre_Id = 56;
357 static const int diamondBlock_Id = 57;
358 static const int workBench_Id = 58;
359 static const int crops_Id = 59;
360 static const int farmland_Id = 60;
361 static const int furnace_Id = 61;
362 static const int furnace_lit_Id = 62;
363 static const int sign_Id = 63;
364 static const int door_wood_Id = 64;
365 static const int ladder_Id = 65;
366 static const int rail_Id = 66;
367 static const int stairs_stone_Id = 67;
368 static const int wallSign_Id = 68;
369 static const int lever_Id = 69;
370 static const int pressurePlate_stone_Id = 70;
371 static const int door_iron_Id = 71;
372 static const int pressurePlate_wood_Id = 72;
373 static const int redStoneOre_Id = 73;
374 static const int redStoneOre_lit_Id = 74;
375 static const int notGate_off_Id = 75;
376 static const int notGate_on_Id = 76;
377 static const int button_stone_Id = 77;
378 static const int topSnow_Id = 78;
379 static const int ice_Id = 79;
380 static const int snow_Id = 80;
381 static const int cactus_Id = 81;
382 static const int clay_Id = 82;
383 static const int reeds_Id = 83;
384 static const int recordPlayer_Id = 84;
385 static const int fence_Id = 85;
386 static const int pumpkin_Id = 86;
387 static const int hellRock_Id = 87;
388 static const int hellSand_Id = 88;
389 static const int lightGem_Id = 89;
390 static const int portalTile_Id = 90;
391 static const int litPumpkin_Id = 91;
392 static const int cake_Id = 92;
393 static const int diode_off_Id = 93;
394 static const int diode_on_Id = 94;
395 static const int aprilFoolsJoke_Id = 95;
396 static const int trapdoor_Id = 96;
397
398 static const int monsterStoneEgg_Id = 97;
399 static const int stoneBrickSmooth_Id = 98;
400 static const int hugeMushroom1_Id = 99;
401 static const int hugeMushroom2_Id = 100;
402 static const int ironFence_Id = 101;
403 static const int thinGlass_Id = 102;
404 static const int melon_Id = 103;
405 static const int pumpkinStem_Id = 104;
406 static const int melonStem_Id = 105;
407 static const int vine_Id = 106;
408 static const int fenceGate_Id = 107;
409 static const int stairs_bricks_Id = 108;
410 static const int stairs_stoneBrickSmooth_Id = 109;
411
412 static const int mycel_Id = 110;
413 static const int waterLily_Id = 111;
414 static const int netherBrick_Id = 112;
415 static const int netherFence_Id = 113;
416 static const int stairs_netherBricks_Id = 114;
417 static const int netherStalk_Id = 115;
418 static const int enchantTable_Id = 116;
419 static const int brewingStand_Id = 117;
420 static const int cauldron_Id = 118;
421 static const int endPortalTile_Id = 119;
422 static const int endPortalFrameTile_Id = 120;
423 static const int whiteStone_Id = 121;
424 static const int dragonEgg_Id = 122;
425 static const int redstoneLight_Id = 123;
426 static const int redstoneLight_lit_Id = 124;
427
428
429 static const int woodSlab_Id = 125;
430 static const int woodSlabHalf_Id = 126;
431 static const int cocoa_Id = 127;
432 static const int stairs_sandstone_Id = 128;
433 static const int stairs_sprucewood_Id = 134;
434 static const int stairs_birchwood_Id = 135;
435 static const int stairs_junglewood_Id = 136;
436 static const int emeraldOre_Id = 129;
437 static const int enderChest_Id = 130;
438 static const int tripWireSource_Id = 131;
439 static const int tripWire_Id = 132;
440 static const int emeraldBlock_Id = 133;
441
442 static const int cobbleWall_Id = 139;
443 static const int flowerPot_Id = 140;
444 static const int carrots_Id = 141;
445 static const int potatoes_Id = 142;
446 static const int anvil_Id = 145;
447 static const int button_wood_Id = 143;
448 static const int skull_Id = 144;
449 static const int netherQuartz_Id = 153;
450 static const int quartzBlock_Id = 155;
451 static const int stairs_quartz_Id = 156;
452 static const int woolCarpet_Id = 171;
453
454 static Tile_SPU m_tiles[256];
455
456 Tile_SPU() { id = -1;}
457 Tile_SPU(int tileID) { id = tileID; }
458 virtual ~Tile_SPU() {}
459
460 double getShapeX0() { return ms_pTileData->xx0[id]; }
461 double getShapeX1() { return ms_pTileData->xx1[id]; }
462 double getShapeY0() { return ms_pTileData->yy0[id]; }
463 double getShapeY1() { return ms_pTileData->yy1[id]; }
464 double getShapeZ0() { return ms_pTileData->zz0[id]; }
465 double getShapeZ1() { return ms_pTileData->zz1[id]; }
466 Material_SPU* getMaterial();
467
468 virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
469 virtual void updateDefaultShape();
470 virtual void setShape(float x0, float y0, float z0, float x1, float y1, float z1);
471 virtual float getBrightness(ChunkRebuildData *level, int x, int y, int z);
472 virtual int getLightColor(ChunkRebuildData *level, int x, int y, int z); // 4J - brought forward from 1.8.2
473 virtual bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face);
474 virtual int getRenderShape();
475 virtual int getColor(ChunkRebuildData *level, int x, int y, int z);
476 virtual float getShadeBrightness(ChunkRebuildData *level, int x, int y, int z); // 4J - brought forward from 1.8.2
477 virtual bool isSolidRender(bool isServerLevel = false);
478 virtual bool isSolidFace(ChunkRebuildData *level, int x, int y, int z, int face);
479 virtual int getRenderLayer();
480 virtual Icon_SPU *getTexture(ChunkRebuildData *level, int x, int y, int z, int face);
481 virtual Icon_SPU *getTexture(int face, int data);
482 virtual Icon_SPU *getTexture(int face);
483
484 bool isSignalSource() { return ms_pTileData->signalSource[id]; }
485 bool isCubeShaped() { return ms_pTileData->cubeShaped[id]; }
486
487 Icon_SPU* icon() { return &ms_pTileData->iconData[id]; }
488
489
490 int id;
491 static TileData_SPU* ms_pTileData;
492
493 static void initTilePointers();
494 static Tile_SPU* createFromID(int tileID);
495
496};
497
498class TileRef_SPU
499{
500 // because of the way this ref stuff works, we need all the tile classes to be of the same size,
501 // so make sure no data is added to child classes.
502 Tile_SPU* m_pTile;
503public:
504 TileRef_SPU(int tileID) { m_pTile = Tile_SPU::createFromID(tileID); }
505 virtual ~TileRef_SPU() { }
506 Tile_SPU* operator->() const { return m_pTile; }
507 Tile_SPU* getPtr() { return m_pTile; }
508};
509
510//class stoneBrick : public Tile {};