From 9dc0e3c2335fa6aacd0974b161bd96772639bf52 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 29 Jul 2012 12:07:22 +0000 Subject: Fixed warnings in item handlers - items' damage value is a short, but block meta is only a NIBBLETYPE. Also slight cleanup. git-svn-id: http://mc-server.googlecode.com/svn/trunk@704 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/items/ItemLeaves.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'source/items/ItemLeaves.h') diff --git a/source/items/ItemLeaves.h b/source/items/ItemLeaves.h index bc1519806..01b090a2f 100644 --- a/source/items/ItemLeaves.h +++ b/source/items/ItemLeaves.h @@ -1,17 +1,27 @@ + #pragma once #include "Item.h" -class cItemLeavesHandler : public cItemHandler + + + +class cItemLeavesHandler : + public cItemHandler { public: cItemLeavesHandler(int a_ItemID) : cItemHandler(a_ItemID) { } - virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override + + virtual NIBBLETYPE GetBlockMeta(short a_ItemDamage) override { - return a_ItemMeta | 0x4; //0x4 bit set means this is a player places leave + return (NIBBLETYPE)(a_ItemDamage & 0x0f) | 0x4; //0x4 bit set means this is a player-placed leaves block, not to be decayed } -}; \ No newline at end of file +} ; + + + + -- cgit v1.2.3