2013-07-29 11:13:03 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ItemHandler.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-01 23:31:10 +00:00
|
|
|
class cItemLeavesHandler final :
|
2013-07-29 11:13:03 +00:00
|
|
|
public cItemHandler
|
|
|
|
{
|
2020-04-13 16:38:06 +00:00
|
|
|
using Super = cItemHandler;
|
2016-02-05 21:45:45 +00:00
|
|
|
|
2013-07-29 11:13:03 +00:00
|
|
|
public:
|
2020-04-13 16:38:06 +00:00
|
|
|
|
2021-12-01 23:31:10 +00:00
|
|
|
using Super::Super;
|
2013-07-29 11:13:03 +00:00
|
|
|
|
2020-04-21 20:19:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-01 23:31:10 +00:00
|
|
|
virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
|
2013-07-29 11:13:03 +00:00
|
|
|
{
|
2021-05-05 13:25:10 +00:00
|
|
|
return a_Player.PlaceBlock(
|
|
|
|
a_PlacePosition,
|
|
|
|
static_cast<BLOCKTYPE>(m_ItemType),
|
|
|
|
static_cast<NIBBLETYPE>(a_HeldItem.m_ItemDamage | 0x4) // 0x4 bit set means this is a player-placed leaves block, not to be decayed.
|
2013-07-29 11:13:03 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|