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`
This commit is contained in:
void_17
2026-03-03 06:14:34 +07:00
parent 41ded31af8
commit 13c8bafad5
48 changed files with 176 additions and 217 deletions

View File

@@ -101,7 +101,7 @@ shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(shared_ptr<Player> pla
else if (slotIndex >= INV_SLOT_START && slotIndex < INV_SLOT_END)
{
// 4J-PB - if the item is an ingredient, quickmove it into the ingredient slot
if( (Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherwart_seeds_Id) ) &&
if( (Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherwart_seeds_Id) ) &&
(!IngredientSlot->hasItem() || (stack->id==IngredientSlot->getItem()->id) ) )
{
if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false))
@@ -125,7 +125,7 @@ shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(shared_ptr<Player> pla
else if (slotIndex >= USE_ROW_SLOT_START && slotIndex < USE_ROW_SLOT_END)
{
// 4J-PB - if the item is an ingredient, quickmove it into the ingredient slot
if((Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherwart_seeds_Id)) &&
if((Item::items[stack->id]->hasPotionBrewingFormula() || (stack->id == Item::netherwart_seeds_Id)) &&
(!IngredientSlot->hasItem() || (stack->id==IngredientSlot->getItem()->id) ))
{
if(!moveItemStackTo(stack, INGREDIENT_SLOT, INGREDIENT_SLOT+1, false))
@@ -140,7 +140,7 @@ shared_ptr<ItemInstance> BrewingStandMenu::quickMoveStack(shared_ptr<Player> pla
{
return nullptr;
}
}
}
else if (!moveItemStackTo(stack, INV_SLOT_START, INV_SLOT_END, false))
{
return nullptr;
@@ -183,7 +183,7 @@ bool BrewingStandMenu::PotionSlot::mayPlace(shared_ptr<ItemInstance> item)
return mayPlaceItem(item);
}
int BrewingStandMenu::PotionSlot::getMaxStackSize()
int BrewingStandMenu::PotionSlot::getMaxStackSize() const
{
return 1;
}
@@ -231,7 +231,7 @@ bool BrewingStandMenu::IngredientsSlot::mayCombine(shared_ptr<ItemInstance> seco
return false;
}
int BrewingStandMenu::IngredientsSlot::getMaxStackSize()
int BrewingStandMenu::IngredientsSlot::getMaxStackSize() const
{
return 64;
}