Grass path: Drop dirt when broken
This commit is contained in:
parent
f860084092
commit
0dd8e7d20d
30
src/Blocks/BlockGrassPath.h
Normal file
30
src/Blocks/BlockGrassPath.h
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "BlockHandler.h"
|
||||||
|
#include "../FastRandom.h"
|
||||||
|
#include "../Root.h"
|
||||||
|
#include "../Bindings/PluginManager.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class cBlockGrassPathHandler final :
|
||||||
|
public cBlockHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
using cBlockHandler::cBlockHandler;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem * const a_Tool) const override
|
||||||
|
{
|
||||||
|
if (!ToolHasSilkTouch(a_Tool))
|
||||||
|
{
|
||||||
|
return cItem(E_BLOCK_DIRT, 1, 0);
|
||||||
|
}
|
||||||
|
return cItem(E_BLOCK_GRASS_PATH, 1, 0);
|
||||||
|
}
|
||||||
|
} ;
|
@ -47,6 +47,7 @@
|
|||||||
#include "BlockGlazedTerracotta.h"
|
#include "BlockGlazedTerracotta.h"
|
||||||
#include "BlockGlowstone.h"
|
#include "BlockGlowstone.h"
|
||||||
#include "BlockGrass.h"
|
#include "BlockGrass.h"
|
||||||
|
#include "BlockGrassPath.h"
|
||||||
#include "BlockGravel.h"
|
#include "BlockGravel.h"
|
||||||
#include "BlockHopper.h"
|
#include "BlockHopper.h"
|
||||||
#include "BlockHugeMushroom.h"
|
#include "BlockHugeMushroom.h"
|
||||||
@ -287,7 +288,7 @@ namespace
|
|||||||
constexpr cDefaultBlockHandler BlockGoldBlockHandler (E_BLOCK_GOLD_BLOCK);
|
constexpr cDefaultBlockHandler BlockGoldBlockHandler (E_BLOCK_GOLD_BLOCK);
|
||||||
constexpr cDefaultOreHandler BlockGoldOreHandler (E_BLOCK_GOLD_ORE);
|
constexpr cDefaultOreHandler BlockGoldOreHandler (E_BLOCK_GOLD_ORE);
|
||||||
constexpr cBlockGrassHandler BlockGrassHandler (E_BLOCK_GRASS);
|
constexpr cBlockGrassHandler BlockGrassHandler (E_BLOCK_GRASS);
|
||||||
constexpr cDefaultBlockHandler BlockGrassPathHandler (E_BLOCK_GRASS_PATH);
|
constexpr cBlockGrassPathHandler BlockGrassPathHandler (E_BLOCK_GRASS_PATH);
|
||||||
constexpr cBlockGravelHandler BlockGravelHandler (E_BLOCK_GRAVEL);
|
constexpr cBlockGravelHandler BlockGravelHandler (E_BLOCK_GRAVEL);
|
||||||
constexpr cBlockGlazedTerracottaHandler BlockGrayGlazedTerracottaHandler (E_BLOCK_GRAY_GLAZED_TERRACOTTA);
|
constexpr cBlockGlazedTerracottaHandler BlockGrayGlazedTerracottaHandler (E_BLOCK_GRAY_GLAZED_TERRACOTTA);
|
||||||
constexpr cDefaultBlockHandler BlockGrayShulkerBoxHandler (E_BLOCK_GRAY_SHULKER_BOX);
|
constexpr cDefaultBlockHandler BlockGrayShulkerBoxHandler (E_BLOCK_GRAY_SHULKER_BOX);
|
||||||
|
@ -49,6 +49,7 @@ target_sources(
|
|||||||
BlockGlazedTerracotta.h
|
BlockGlazedTerracotta.h
|
||||||
BlockGlowstone.h
|
BlockGlowstone.h
|
||||||
BlockGrass.h
|
BlockGrass.h
|
||||||
|
BlockGrassPath.h
|
||||||
BlockGravel.h
|
BlockGravel.h
|
||||||
BlockHandler.h
|
BlockHandler.h
|
||||||
BlockHopper.h
|
BlockHopper.h
|
||||||
|
Loading…
Reference in New Issue
Block a user