From 4561b2c22f755cd91009f2d90efa15671db6a15a Mon Sep 17 00:00:00 2001 From: "luksor111@gmail.com" Date: Sat, 29 Dec 2012 11:49:00 +0000 Subject: Cauldrons and Brewing Stands are now placeable Cauldrons can be filled with water and used to fill bottles git-svn-id: http://mc-server.googlecode.com/svn/trunk@1116 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Items/ItemBrewingStand.h | 25 +++++++++++++++++++++++++ source/Items/ItemCauldron.h | 25 +++++++++++++++++++++++++ source/Items/ItemHandler.cpp | 4 ++++ source/Items/ItemPickaxe.h | 1 + 4 files changed, 55 insertions(+) create mode 100644 source/Items/ItemBrewingStand.h create mode 100644 source/Items/ItemCauldron.h (limited to 'source/Items') diff --git a/source/Items/ItemBrewingStand.h b/source/Items/ItemBrewingStand.h new file mode 100644 index 000000000..a4fe6bcbe --- /dev/null +++ b/source/Items/ItemBrewingStand.h @@ -0,0 +1,25 @@ + +#pragma once + +#include "ItemHandler.h" + +class cItemBrewingStandHandler : public cItemHandler +{ +public: + cItemBrewingStandHandler(int a_ItemType) + : cItemHandler(a_ItemType) + { + + } + + virtual bool IsPlaceable() override + { + return true; + } + + virtual BLOCKTYPE GetBlockType() override + { + return E_BLOCK_BREWING_STAND; + } + +}; \ No newline at end of file diff --git a/source/Items/ItemCauldron.h b/source/Items/ItemCauldron.h new file mode 100644 index 000000000..96ddf6c05 --- /dev/null +++ b/source/Items/ItemCauldron.h @@ -0,0 +1,25 @@ + +#pragma once + +#include "ItemHandler.h" + +class cItemCauldronHandler : public cItemHandler +{ +public: + cItemCauldronHandler(int a_ItemType) + : cItemHandler(a_ItemType) + { + + } + + virtual bool IsPlaceable() override + { + return true; + } + + virtual BLOCKTYPE GetBlockType() override + { + return E_BLOCK_CAULDRON; + } + +}; \ No newline at end of file diff --git a/source/Items/ItemHandler.cpp b/source/Items/ItemHandler.cpp index 7a6b82eaa..6426ce212 100644 --- a/source/Items/ItemHandler.cpp +++ b/source/Items/ItemHandler.cpp @@ -29,6 +29,8 @@ #include "ItemBed.h" #include "ItemSpawnEgg.h" #include "ItemFlowerPot.h" +#include "ItemBrewingStand.h" +#include "ItemCauldron.h" #include "../Blocks/BlockHandler.h" @@ -70,6 +72,8 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) // Single item per handler, alphabetically sorted: case E_ITEM_BED: return new cItemBedHandler(a_ItemType); + case E_ITEM_BREWING_STAND: return new cItemBrewingStandHandler(a_ItemType); + case E_ITEM_CAULDRON: return new cItemCauldronHandler(a_ItemType); case E_ITEM_DYE: return new cItemDyeHandler(a_ItemType); case E_ITEM_FLINT_AND_STEEL: return new cItemLighterHandler(a_ItemType); case E_ITEM_FLOWER_POT: return new cItemFlowerPotHandler(a_ItemType); diff --git a/source/Items/ItemPickaxe.h b/source/Items/ItemPickaxe.h index 4f513d2bc..26d0d5ade 100644 --- a/source/Items/ItemPickaxe.h +++ b/source/Items/ItemPickaxe.h @@ -68,6 +68,7 @@ public: case E_BLOCK_COBBLESTONE_STAIRS: case E_BLOCK_STONE_BRICK_STAIRS: case E_BLOCK_NETHER_BRICK_STAIRS: + case E_BLOCK_CAULDRON: return PickaxeLevel() >= 1; } return false; -- cgit v1.2.3