From 13c8bafad57bd081a3e87eb7e67a3a0d98734706 Mon Sep 17 00:00:00 2001 From: void_17 Date: Tue, 3 Mar 2026 06:14:34 +0700 Subject: Minor fixes 1. Improve const correctness in a few places (such as `Container::getMaxStackSize()` -> `Container::getMaxStackSize() const`) 2. Use C++11 varargs for `I18n::get`, `Entity::newDoubleList` and `Language::getElement` --- Minecraft.World/BrewingStandTileEntity.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Minecraft.World/BrewingStandTileEntity.cpp') diff --git a/Minecraft.World/BrewingStandTileEntity.cpp b/Minecraft.World/BrewingStandTileEntity.cpp index 00170d7b..5bc6fd27 100644 --- a/Minecraft.World/BrewingStandTileEntity.cpp +++ b/Minecraft.World/BrewingStandTileEntity.cpp @@ -10,7 +10,7 @@ int slotsForUp [] = { BrewingStandTileEntity::INGREDIENT_SLOT }; int slotsForOtherFaces [] = { 0, 1, 2 }; -intArray BrewingStandTileEntity::SLOTS_FOR_UP = intArray(slotsForUp, 1); +intArray BrewingStandTileEntity::SLOTS_FOR_UP = intArray(slotsForUp, 1); intArray BrewingStandTileEntity::SLOTS_FOR_OTHER_FACES = intArray(slotsForOtherFaces, 3); BrewingStandTileEntity::BrewingStandTileEntity() @@ -156,7 +156,7 @@ bool BrewingStandTileEntity::isBrewable() } else { - if (!Item::items[ingredient->id]->hasPotionBrewingFormula() && ingredient->id != Item::bucket_water_Id && ingredient->id != Item::netherwart_seeds_Id) + if (!Item::items[ingredient->id]->hasPotionBrewingFormula() && ingredient->id != Item::bucket_water_Id && ingredient->id != Item::netherwart_seeds_Id) { return false; } @@ -327,7 +327,7 @@ void BrewingStandTileEntity::save(CompoundTag *base) for (int i = 0; i < items.length; i++) { - if (items[i] != NULL) + if (items[i] != NULL) { CompoundTag *tag = new CompoundTag(); tag->putByte(L"Slot", (byte) i); @@ -356,7 +356,7 @@ shared_ptr BrewingStandTileEntity::removeItem(unsigned int slot, i if (slot >= 0 && slot < items.length && items[slot] != NULL) { - if (items[slot]->count <= count) + if (items[slot]->count <= count) { shared_ptr item = items[slot]; items[slot] = nullptr; @@ -364,8 +364,8 @@ shared_ptr BrewingStandTileEntity::removeItem(unsigned int slot, i // 4J Stu - Fix for duplication glitch if(item->count <= 0) return nullptr; return item; - } - else + } + else { shared_ptr i = items[slot]->remove(count); if (items[slot]->count == 0) items[slot] = nullptr; @@ -397,7 +397,7 @@ void BrewingStandTileEntity::setItem(unsigned int slot, shared_ptr } } -int BrewingStandTileEntity::getMaxStackSize() +int BrewingStandTileEntity::getMaxStackSize() const { // this value is not used for the potion slots return 64; -- cgit v1.2.3