the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3class Minecraft;
4class Level;
5class Player;
6class ItemInstance;
7class Entity;
8
9class Tutorial;
10
11class GameMode
12{
13protected:
14 Minecraft *minecraft;
15public:
16 bool instaBuild;
17
18 GameMode(Minecraft *minecraft);
19 virtual ~GameMode() {}
20
21 virtual void initLevel(Level *level) ;
22 virtual void startDestroyBlock(int x, int y, int z, int face) = 0;
23 virtual bool destroyBlock(int x, int y, int z, int face);
24 virtual void continueDestroyBlock(int x, int y, int z, int face) = 0;
25 virtual void stopDestroyBlock() = 0;
26 virtual void render(float a);
27 virtual float getPickRange() = 0;
28 virtual void initPlayer(shared_ptr<Player> player);
29 virtual void tick();
30 virtual bool canHurtPlayer() = 0;
31 virtual void adjustPlayer(shared_ptr<Player> player);
32 virtual bool useItem(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
33 virtual bool useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, bool bTestUseOnOnly=false, bool *pbUsedItem = NULL) = 0;
34
35 virtual shared_ptr<Player> createPlayer(Level *level);
36 virtual bool interact(shared_ptr<Player> player, shared_ptr<Entity> entity);
37 virtual void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
38 virtual shared_ptr<ItemInstance> handleInventoryMouseClick(int containerId, int slotNum, int buttonNum, bool quickKeyHeld, shared_ptr<Player> player);
39 virtual void handleCloseInventory(int containerId, shared_ptr<Player> player);
40 virtual void handleInventoryButtonClick(int containerId, int buttonId);
41
42 virtual bool isCutScene();
43 virtual void releaseUsingItem(shared_ptr<Player> player);
44 virtual bool hasExperience();
45 virtual bool hasMissTime();
46 virtual bool hasInfiniteItems();
47 virtual bool hasFarPickRange();
48 virtual void handleCreativeModeItemAdd(shared_ptr<ItemInstance> clicked, int i);
49 virtual void handleCreativeModeItemDrop(shared_ptr<ItemInstance> clicked);
50
51 // 4J Stu - Added so we can send packets for this in the network game
52 virtual bool handleCraftItem(int recipe, shared_ptr<Player> player);
53 virtual void handleDebugOptions(unsigned int uiVal, shared_ptr<Player> player);
54
55 // 4J Stu - Added for tutorial checks
56 virtual bool isInputAllowed(int mapping) { return true; }
57 virtual bool isTutorial() { return false; }
58 virtual Tutorial *getTutorial() { return NULL; }
59};