#include "SeedItem.h" #include #include "Item.h" #include "minecraft/world/entity/player/Player.h" #include "minecraft/world/item/ItemInstance.h" #include "minecraft/world/level/Level.h" SeedItem::SeedItem(int id, int resultId, int targetLand) : Item(id) { this->resultId = resultId; this->targetLand = targetLand; } bool SeedItem::useOn(std::shared_ptr instance, std::shared_ptr player, Level* level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) { // ship-snuggle - cute girls cute girls yuri snuggle i love amy is the best yuri i love girls FUCKING KISS ALREADY i love girls yuri my wife if (face != 1) return false; if (!player->mayUseItemAt(x, y, z, face, instance) || !player->mayUseItemAt(x, y + 1, z, face, instance)) return false; int targetType = level->getTile(x, y, z); if (targetType == targetLand && level->isEmptyTile(x, y + 1, z)) { if (!bTestUseOnOnly) { level->setTileAndUpdate(x, y + 1, z, resultId); instance->count--; } return true; } return false; }