Fixed drops for: Stone, Mycelium, Redstone Torch.
Fixed item usage for Jukeboxes and Spawn eggs in survival. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1064 0a769ca7-a7f5-676a-18bf-c427514a06d6master
parent
95a94c3db8
commit
eed6f9bb7b
|
@ -1854,6 +1854,10 @@
|
|||
RelativePath="..\source\blocks\BlockMushroom.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Blocks\BlockMycelium.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\blocks\BlockNote.h"
|
||||
>
|
||||
|
|
|
@ -246,8 +246,8 @@ enum ENUM_ITEM_ID
|
|||
E_ITEM_WOODEN_PRESSURE_PLATE = 72,
|
||||
E_ITEM_REDSTONE_ORE = 73,
|
||||
E_ITEM_REDSTONE_ORE_GLOWING = 74,
|
||||
E_ITEM_REDSTONE_TORCH_ON = 75,
|
||||
E_ITEM_REDSTONE_TORCH_OFF = 76,
|
||||
E_ITEM_REDSTONE_TORCH_OFF = 75,
|
||||
E_ITEM_REDSTONE_TORCH_ON = 76,
|
||||
E_ITEM_STONE_BUTTON = 77,
|
||||
E_ITEM_SNOW = 78,
|
||||
E_ITEM_ICE = 79,
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "BlockNote.h"
|
||||
#include "BlockBed.h"
|
||||
#include "BlockFarmland.h"
|
||||
#include "BlockMycelium.h"
|
||||
|
||||
|
||||
|
||||
|
@ -117,6 +118,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
|
|||
case E_BLOCK_LOG: return new cBlockWoodHandler (a_BlockType);
|
||||
case E_BLOCK_MELON: return new cBlockMelonHandler (a_BlockType);
|
||||
case E_BLOCK_MELON_STEM: return new cBlockStemsHandler (a_BlockType);
|
||||
case E_BLOCK_MYCELIUM: return new cBlockMyceliumHandler (a_BlockType);
|
||||
case E_BLOCK_NETHER_BRICK_STAIRS: return new cBlockStairsHandler (a_BlockType);
|
||||
case E_BLOCK_NOTE_BLOCK: return new cBlockNoteHandler (a_BlockType);
|
||||
case E_BLOCK_PISTON: return new cBlockPistonHandler (a_BlockType);
|
||||
|
@ -132,6 +134,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
|
|||
case E_BLOCK_RED_MUSHROOM: return new cBlockMushroomHandler (a_BlockType);
|
||||
case E_BLOCK_RED_ROSE: return new cBlockFlowerHandler (a_BlockType);
|
||||
case E_BLOCK_SAND: return new cBlockSandHandler (a_BlockType);
|
||||
case E_ITEM_SANDSTONE_STAIRS: return new cBlockStairsHandler (a_BlockType);
|
||||
case E_BLOCK_SAPLING: return new cBlockSaplingHandler (a_BlockType);
|
||||
case E_BLOCK_SIGN_POST: return new cBlockSignHandler (a_BlockType);
|
||||
case E_BLOCK_SNOW: return new cBlockSnowHandler (a_BlockType);
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "BlockHandler.h"
|
||||
#include "../MersenneTwister.h"
|
||||
#include "../World.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class cBlockMyceliumHandler :
|
||||
public cBlockHandler
|
||||
{
|
||||
public:
|
||||
cBlockMyceliumHandler(BLOCKTYPE a_BlockType)
|
||||
: cBlockHandler(a_BlockType)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||
{
|
||||
a_Pickups.push_back(cItem(E_BLOCK_DIRT, 1, 0));
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||
{
|
||||
a_Pickups.push_back(cItem(E_BLOCK_STONE, 1, 0));
|
||||
a_Pickups.push_back(cItem(E_BLOCK_COBBLESTONE, 1, 0));
|
||||
}
|
||||
} ;
|
||||
|
||||
|
|
|
@ -35,8 +35,11 @@ public:
|
|||
|
||||
if (a_World->SpawnMob(a_BlockX + 0.5, a_BlockY, a_BlockZ + 0.5, a_Item->m_ItemDamage) >= 0)
|
||||
{
|
||||
// The mob was spawned, "use" the item:
|
||||
a_Player->UseEquippedItem();
|
||||
if(a_Player->GetGameMode() != 1)
|
||||
{
|
||||
// The mob was spawned, "use" the item:
|
||||
a_Player->GetInventory().RemoveItem(a_Player->GetInventory().GetEquippedItem());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ void cJukeboxEntity::UsedBy( cPlayer * a_Player )
|
|||
if (HeldItem.m_ItemType >= 2256 && HeldItem.m_ItemType <= 2267)
|
||||
{
|
||||
m_Record = HeldItem.m_ItemType;
|
||||
a_Player->UseEquippedItem();
|
||||
a_Player->GetInventory().RemoveItem(a_Player->GetInventory().GetEquippedItem());
|
||||
PlayRecord();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue