1
0
Workbench, Chest and Furnace are usable again

git-svn-id: http://mc-server.googlecode.com/svn/trunk@755 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
lapayo94@gmail.com 2012-08-19 10:44:19 +00:00
parent e5bef782fc
commit f6ae6002c3
10 changed files with 30 additions and 12 deletions

View File

@ -222,7 +222,12 @@ void cBlockHandler::OnNeighborChanged(cWorld *a_World, int a_X, int a_Y, int a_Z
}
void cBlockHandler::OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
void cBlockHandler::OnDigging(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
{
}
void cBlockHandler::OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
{
}

View File

@ -18,7 +18,8 @@ public:
virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z);
virtual void OnNeighborChanged(cWorld *a_World, int a_X, int a_Y, int a_Z);
static void NeighborChanged(cWorld *a_World, int a_X, int a_Y, int a_Z);
virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
virtual void OnDigging(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
virtual void OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
virtual int GetTickRate();

View File

@ -38,7 +38,12 @@ void cBlockDoorHandler::OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z)
}
}
void cBlockDoorHandler::OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
void cBlockDoorHandler::OnDigging(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
{
cDoors::ChangeDoor(a_World, a_X, a_Y, a_Z);
}
void cBlockDoorHandler::OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
{
cDoors::ChangeDoor(a_World, a_X, a_Y, a_Z);
}

View File

@ -8,7 +8,8 @@ public:
cBlockDoorHandler(BLOCKTYPE a_BlockID);
virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir) override;
virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override;
virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
virtual void OnDigging(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
virtual void OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
virtual char GetDropCount() override;
virtual bool IsUseable() override
{

View File

@ -15,7 +15,7 @@ public:
{
}
virtual void OnClick(cWorld * a_World, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) override
virtual void OnUse(cWorld * a_World, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
a_World->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ);
}

View File

@ -10,7 +10,7 @@ public:
{
}
virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
virtual void OnDigging(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
{
a_World->DigBlock(a_X, a_Y, a_Z);
}

View File

@ -22,11 +22,16 @@ void cBlockRedstoneRepeaterHandler::OnDestroyed(cWorld *a_World, int a_X, int a_
Redstone.ChangeRedstone(a_X, a_Y, a_Z, false);
}
void cBlockRedstoneRepeaterHandler::OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
void cBlockRedstoneRepeaterHandler::OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
{
a_World->FastSetBlock(a_X, a_Y, a_Z, m_BlockID, ((a_World->GetBlockMeta(a_X, a_Y, a_Z) + 0x04) & 0x0f));
}
void cBlockRedstoneRepeaterHandler::OnDigging(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
{
OnUse(a_World, a_Player, a_X, a_Y, a_Z);
}
void cBlockRedstoneRepeaterHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cRedstone::RepeaterRotationToMetaData(a_Player->GetRotation()));

View File

@ -9,7 +9,8 @@ public:
virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir) override;
virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override;
virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
virtual void OnDigging(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
virtual void OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{

View File

@ -11,7 +11,7 @@ public:
{
}
virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
virtual void OnUse(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
{
cWindow* Window = new cCraftingWindow(0, true);
a_Player->OpenWindow(Window);

View File

@ -878,7 +878,7 @@ void cClientHandle::HandleBlockDig(int a_BlockX, int a_BlockY, int a_BlockZ, cha
else
{
cBlockHandler * Handler = cBlockHandler::GetBlockHandler(OldBlock);
Handler->OnClick(World, m_Player, a_BlockX, a_BlockY, a_BlockZ);
Handler->OnDigging(World, m_Player, a_BlockX, a_BlockY, a_BlockZ);
ItemHandler->OnDiggingBlock(World, m_Player, &Equipped, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
@ -892,7 +892,7 @@ void cClientHandle::HandleBlockDig(int a_BlockX, int a_BlockY, int a_BlockZ, cha
Handler = cBlockHandler::GetBlockHandler(World->GetBlock(pX, pY, pZ));
if (Handler->IsClickedThrough())
{
Handler->OnClick(World, m_Player, pX, pY, pZ);
Handler->OnDigging(World, m_Player, pX, pY, pZ);
}
}
}
@ -940,7 +940,7 @@ void cClientHandle::HandleBlockPlace(int a_BlockX, int a_BlockY, int a_BlockZ, c
cBlockHandler *Handler = cBlockHandler::GetBlockHandler(World->GetBlock(a_BlockX, a_BlockY, a_BlockZ));
if (Handler->IsUseable())
{
Handler->OnClick(World, m_Player, a_BlockX, a_BlockY, a_BlockZ);
Handler->OnUse(World, m_Player, a_BlockX, a_BlockY, a_BlockZ);
}
else
{