1
0

Grass path: Drop dirt when broken

This commit is contained in:
Ryan Fox 2021-12-13 23:32:32 -08:00
parent f860084092
commit 0dd8e7d20d
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
3 changed files with 33 additions and 1 deletions

View 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);
}
} ;

View File

@ -47,6 +47,7 @@
#include "BlockGlazedTerracotta.h"
#include "BlockGlowstone.h"
#include "BlockGrass.h"
#include "BlockGrassPath.h"
#include "BlockGravel.h"
#include "BlockHopper.h"
#include "BlockHugeMushroom.h"
@ -287,7 +288,7 @@ namespace
constexpr cDefaultBlockHandler BlockGoldBlockHandler (E_BLOCK_GOLD_BLOCK);
constexpr cDefaultOreHandler BlockGoldOreHandler (E_BLOCK_GOLD_ORE);
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 cBlockGlazedTerracottaHandler BlockGrayGlazedTerracottaHandler (E_BLOCK_GRAY_GLAZED_TERRACOTTA);
constexpr cDefaultBlockHandler BlockGrayShulkerBoxHandler (E_BLOCK_GRAY_SHULKER_BOX);

View File

@ -49,6 +49,7 @@ target_sources(
BlockGlazedTerracotta.h
BlockGlowstone.h
BlockGrass.h
BlockGrassPath.h
BlockGravel.h
BlockHandler.h
BlockHopper.h