From 119bff351450ea16ffda550b6e0f67379b29f708 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:37:16 +0700 Subject: Revert "shared_ptr -> std::shared_ptr" This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5. --- Minecraft.World/ShapelessRecipy.cpp | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'Minecraft.World/ShapelessRecipy.cpp') diff --git a/Minecraft.World/ShapelessRecipy.cpp b/Minecraft.World/ShapelessRecipy.cpp index 46a58524..67ed0381 100644 --- a/Minecraft.World/ShapelessRecipy.cpp +++ b/Minecraft.World/ShapelessRecipy.cpp @@ -1,7 +1,7 @@ // package net.minecraft.world.item.crafting; -// +// // import java.util.*; -// +// // import net.minecraft.world.inventory.CraftingContainer; // import net.minecraft.world.item.ItemInstance; #include "stdafx.h" @@ -19,27 +19,27 @@ ShapelessRecipy::ShapelessRecipy(ItemInstance *result, vector *i { } -const int ShapelessRecipy::getGroup() -{ +const int ShapelessRecipy::getGroup() +{ return group; } -const ItemInstance *ShapelessRecipy::getResultItem() +const ItemInstance *ShapelessRecipy::getResultItem() { return result; } -bool ShapelessRecipy::matches(std::shared_ptr craftSlots, Level *level) +bool ShapelessRecipy::matches(shared_ptr craftSlots, Level *level) { vector tempList = *ingredients; - - for (int y = 0; y < 3; y++) + + for (int y = 0; y < 3; y++) { - for (int x = 0; x < 3; x++) + for (int x = 0; x < 3; x++) { - std::shared_ptr item = craftSlots->getItem(x, y); + shared_ptr item = craftSlots->getItem(x, y); - if (item != NULL) + if (item != NULL) { bool found = false; @@ -47,7 +47,7 @@ bool ShapelessRecipy::matches(std::shared_ptr craftSlots, Lev for (AUTO_VAR(cit, ingredients->begin()); cit != citEnd; ++cit) { ItemInstance *ingredient = *cit; - if (item->id == ingredient->id && (ingredient->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == ingredient->getAuxValue())) + if (item->id == ingredient->id && (ingredient->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == ingredient->getAuxValue())) { found = true; AUTO_VAR( it, find(tempList.begin(), tempList.end(), ingredient ) ); @@ -56,7 +56,7 @@ bool ShapelessRecipy::matches(std::shared_ptr craftSlots, Lev } } - if (!found) + if (!found) { return false; } @@ -67,18 +67,18 @@ bool ShapelessRecipy::matches(std::shared_ptr craftSlots, Lev return tempList.empty(); } -std::shared_ptr ShapelessRecipy::assemble(std::shared_ptr craftSlots) +shared_ptr ShapelessRecipy::assemble(shared_ptr craftSlots) { return result->copy(); } -int ShapelessRecipy::size() +int ShapelessRecipy::size() { return (int)ingredients->size(); } // 4J-PB -bool ShapelessRecipy::requires(int iRecipe) +bool ShapelessRecipy::requires(int iRecipe) { vector *tempList = new vector; @@ -91,7 +91,7 @@ bool ShapelessRecipy::requires(int iRecipe) for (vector::iterator ingredient = ingredients->begin(); ingredient != citEnd; ingredient++) { //printf("\tIngredient %d is %d\n",iCount++,(*ingredient)->id); - //if (item->id == (*ingredient)->id && ((*ingredient)->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == (*ingredient)->getAuxValue())) + //if (item->id == (*ingredient)->id && ((*ingredient)->getAuxValue() == Recipes::ANY_AUX_VALUE || item->getAuxValue() == (*ingredient)->getAuxValue())) tempList->erase(ingredient); } @@ -99,7 +99,7 @@ bool ShapelessRecipy::requires(int iRecipe) return false; } -void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) +void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) { int iCount=0; bool bFound; @@ -125,8 +125,8 @@ void ShapelessRecipy::requires(INGREDIENTS_REQUIRED *pIngReq) { ItemInstance *expected = *ingredient; - if (expected!=NULL) - { + if (expected!=NULL) + { int iAuxVal = (*ingredient)->getAuxValue(); TempIngReq.uiGridA[iCount++]=expected->id | iAuxVal<<24; // 4J-PB - put the ingredients in boxes 1,2,4,5 so we can see them in a 2x2 crafting screen -- cgit v1.2.3