mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-28 03:01:00 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -5,43 +5,38 @@
|
||||
#include "../Headers/net.minecraft.world.item.h"
|
||||
#include "CarrotOnAStickItem.h"
|
||||
|
||||
CarrotOnAStickItem::CarrotOnAStickItem(int id) : Item(id)
|
||||
{
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(25);
|
||||
CarrotOnAStickItem::CarrotOnAStickItem(int id) : Item(id) {
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(25);
|
||||
}
|
||||
|
||||
bool CarrotOnAStickItem::isHandEquipped()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CarrotOnAStickItem::isHandEquipped() { return true; }
|
||||
|
||||
bool CarrotOnAStickItem::isMirroredArt()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CarrotOnAStickItem::isMirroredArt() { return true; }
|
||||
|
||||
std::shared_ptr<ItemInstance> CarrotOnAStickItem::use(std::shared_ptr<ItemInstance> itemInstance, Level *level, std::shared_ptr<Player> player)
|
||||
{
|
||||
if (player->isRiding())
|
||||
{
|
||||
std::shared_ptr<Pig> pig = std::dynamic_pointer_cast<Pig>(player->riding);
|
||||
if(pig)
|
||||
{
|
||||
if (pig->getControlGoal()->canBoost() && itemInstance->getMaxDamage() - itemInstance->getAuxValue() >= 7)
|
||||
{
|
||||
pig->getControlGoal()->boost();
|
||||
itemInstance->hurt(7, player);
|
||||
std::shared_ptr<ItemInstance> CarrotOnAStickItem::use(
|
||||
std::shared_ptr<ItemInstance> itemInstance, Level* level,
|
||||
std::shared_ptr<Player> player) {
|
||||
if (player->isRiding()) {
|
||||
std::shared_ptr<Pig> pig =
|
||||
std::dynamic_pointer_cast<Pig>(player->riding);
|
||||
if (pig) {
|
||||
if (pig->getControlGoal()->canBoost() &&
|
||||
itemInstance->getMaxDamage() - itemInstance->getAuxValue() >=
|
||||
7) {
|
||||
pig->getControlGoal()->boost();
|
||||
itemInstance->hurt(7, player);
|
||||
|
||||
if (itemInstance->count == 0)
|
||||
{
|
||||
std::shared_ptr<ItemInstance> replacement = std::shared_ptr<ItemInstance>(new ItemInstance(Item::fishingRod));
|
||||
replacement->setTag(itemInstance->tag);
|
||||
return replacement;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemInstance->count == 0) {
|
||||
std::shared_ptr<ItemInstance> replacement =
|
||||
std::shared_ptr<ItemInstance>(
|
||||
new ItemInstance(Item::fishingRod));
|
||||
replacement->setTag(itemInstance->tag);
|
||||
return replacement;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return itemInstance;
|
||||
return itemInstance;
|
||||
}
|
||||
Reference in New Issue
Block a user