aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ShapedRecipy.cpp
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-16 21:44:26 -0500
committerGitHub <noreply@github.com>2026-03-16 21:44:26 -0500
commitce739f6045ec72127491286ea3f3f21e537c1b55 (patch)
treef33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.World/ShapedRecipy.cpp
parent255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff)
parent5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/ShapedRecipy.cpp')
-rw-r--r--Minecraft.World/ShapedRecipy.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/ShapedRecipy.cpp b/Minecraft.World/ShapedRecipy.cpp
index 15ccca2d..7a0e85b0 100644
--- a/Minecraft.World/ShapedRecipy.cpp
+++ b/Minecraft.World/ShapedRecipy.cpp
@@ -52,18 +52,18 @@ bool ShapedRecipy::matches(shared_ptr<CraftingContainer> craftSlots, int xOffs,
for (int y = 0; y < 3; y++) {
int xs = x - xOffs;
int ys = y - yOffs;
- ItemInstance *expected = NULL;
+ ItemInstance *expected = nullptr;
if (xs >= 0 && ys >= 0 && xs < width && ys < height)
{
if (xFlip) expected = recipeItems[(width - xs - 1) + ys * width];
else expected = recipeItems[xs + ys * width];
}
shared_ptr<ItemInstance> item = craftSlots->getItem(x, y);
- if (item == NULL && expected == NULL)
+ if (item == nullptr && expected == nullptr)
{
continue;
}
- if ((item == NULL && expected != NULL) || (item != NULL && expected == NULL))
+ if ((item == nullptr && expected != nullptr) || (item != nullptr && expected == nullptr))
{
return false;
}
@@ -84,15 +84,15 @@ shared_ptr<ItemInstance> ShapedRecipy::assemble(shared_ptr<CraftingContainer> cr
{
shared_ptr<ItemInstance> result = getResultItem()->copy();
- if (_keepTag && craftSlots != NULL)
+ if (_keepTag && craftSlots != nullptr)
{
for (int i = 0; i < craftSlots->getContainerSize(); i++)
{
shared_ptr<ItemInstance> item = craftSlots->getItem(i);
- if (item != NULL && item->hasTag())
+ if (item != nullptr && item->hasTag())
{
- result->setTag((CompoundTag *) item->tag->copy());
+ result->setTag(static_cast<CompoundTag *>(item->tag->copy()));
}
}
}
@@ -106,7 +106,7 @@ int ShapedRecipy::size()
}
// 4J-PB
-bool ShapedRecipy::requires(int iRecipe)
+bool ShapedRecipy::reqs(int iRecipe)
{
app.DebugPrintf("ShapedRecipy %d\n",iRecipe);
int iCount=0;
@@ -117,7 +117,7 @@ bool ShapedRecipy::requires(int iRecipe)
if (x < width && y < height)
{
ItemInstance *expected = recipeItems[x+y*width];
- if (expected!=NULL)
+ if (expected!=nullptr)
{
//printf("\tIngredient %d is %d\n",iCount++,expected->id);
}
@@ -130,7 +130,7 @@ bool ShapedRecipy::requires(int iRecipe)
return false;
}
-void ShapedRecipy::requires(INGREDIENTS_REQUIRED *pIngReq)
+void ShapedRecipy::reqs(INGREDIENTS_REQUIRED *pIngReq)
{
//printf("ShapedRecipy %d\n",iRecipe);
@@ -159,7 +159,7 @@ void ShapedRecipy::requires(INGREDIENTS_REQUIRED *pIngReq)
{
ItemInstance *expected = recipeItems[x+y*width];
- if (expected!=NULL)
+ if (expected!=nullptr)
{
int iAuxVal = expected->getAuxValue();
TempIngReq.uiGridA[x+y*3]=expected->id | iAuxVal<<24;