2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
#include "Item.h"
|
2026-03-03 03:04:10 +08:00
|
|
|
#include "DefaultDispenseItemBehavior.h"
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
class MinecartItem : public Item
|
2026-03-01 12:16:08 +08:00
|
|
|
{
|
2026-03-03 03:04:10 +08:00
|
|
|
private:
|
|
|
|
|
class MinecartDispenseBehavior : public DefaultDispenseItemBehavior
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
DefaultDispenseItemBehavior defaultDispenseItemBehavior;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual shared_ptr<ItemInstance> execute(BlockSource *source, shared_ptr<ItemInstance> dispensed, eOUTCOME &outcome);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void playSound(BlockSource *source);
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-01 12:16:08 +08:00
|
|
|
public:
|
|
|
|
|
int type;
|
|
|
|
|
|
|
|
|
|
MinecartItem(int id, int type);
|
|
|
|
|
|
2026-03-02 17:37:16 +07:00
|
|
|
virtual bool useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false);
|
2026-03-01 12:16:08 +08:00
|
|
|
};
|