chore: format Minecraft.World

This commit is contained in:
Tropical
2026-03-13 17:06:56 -05:00
parent bd6284025d
commit 33d0737d1d
1511 changed files with 108661 additions and 115521 deletions
+28 -33
View File
@@ -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;
}