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

View File

@@ -15,53 +15,42 @@
const std::wstring FishingRodItem::TEXTURE_EMPTY = L"fishingRod_empty";
FishingRodItem::FishingRodItem(int id) : Item(id)
{
setMaxDamage(64);
setMaxStackSize(1);
emptyIcon = NULL;
FishingRodItem::FishingRodItem(int id) : Item(id) {
setMaxDamage(64);
setMaxStackSize(1);
emptyIcon = NULL;
}
bool FishingRodItem::isHandEquipped()
{
return true;
bool FishingRodItem::isHandEquipped() { return true; }
bool FishingRodItem::isMirroredArt() { return true; }
std::shared_ptr<ItemInstance> FishingRodItem::use(
std::shared_ptr<ItemInstance> instance, Level* level,
std::shared_ptr<Player> player) {
if (player->fishing != NULL) {
int dmg = player->fishing->retrieve();
instance->hurt(dmg, player);
player->swing();
} else {
level->playSound(player, eSoundType_RANDOM_BOW, 0.5f,
0.4f / (random->nextFloat() * 0.4f + 0.8f));
if (!level->isClientSide) {
// 4J Stu - Move the player->fishing out of the ctor as we cannot
// reference 'this'
std::shared_ptr<FishingHook> hook =
std::shared_ptr<FishingHook>(new FishingHook(level, player));
player->fishing = hook;
level->addEntity(std::shared_ptr<FishingHook>(hook));
}
player->swing();
}
return instance;
}
bool FishingRodItem::isMirroredArt()
{
return true;
void FishingRodItem::registerIcons(IconRegister* iconRegister) {
Item::registerIcons(iconRegister);
emptyIcon = iconRegister->registerIcon(TEXTURE_EMPTY);
}
std::shared_ptr<ItemInstance> FishingRodItem::use(std::shared_ptr<ItemInstance> instance, Level *level, std::shared_ptr<Player> player)
{
if (player->fishing != NULL)
{
int dmg = player->fishing->retrieve();
instance->hurt(dmg, player);
player->swing();
}
else
{
level->playSound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f));
if (!level->isClientSide)
{
// 4J Stu - Move the player->fishing out of the ctor as we cannot reference 'this'
std::shared_ptr<FishingHook> hook = std::shared_ptr<FishingHook>( new FishingHook(level, player) );
player->fishing = hook;
level->addEntity( std::shared_ptr<FishingHook>( hook ) );
}
player->swing();
}
return instance;
}
void FishingRodItem::registerIcons(IconRegister *iconRegister)
{
Item::registerIcons(iconRegister);
emptyIcon = iconRegister->registerIcon(TEXTURE_EMPTY);
}
Icon *FishingRodItem::getEmptyIcon()
{
return emptyIcon;
}
Icon* FishingRodItem::getEmptyIcon() { return emptyIcon; }