Skip to content

Commit

Permalink
Fix Recipes Crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamguxiang committed Jan 14, 2023
1 parent 6ff1466 commit a8b27c2
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions LiteLoader/include/llapi/mc/Recipes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "RecipeIngredient.hpp"
#include "Item.hpp"
#include "Block.hpp"
#include "HashedString.hpp"

#undef BEFORE_EXTRA

Expand All @@ -25,23 +26,47 @@ class Recipes {
#define AFTER_EXTRA
// Add Member There
public:
public:
struct FurnaceRecipeKey {
public:
int mID;
HashedString mTag;

public:
inline FurnaceRecipeKey(int aux, HashedString tag) : mID(aux), mTag(tag) {}
};

class Type {
Item const* item;
Block const* block;
RecipeIngredient ingredient;
char label;
public:
inline Type(string const& name, char label, int aux, unsigned short count) :ingredient(name, aux, count), label(label) {
item = ingredient.descriptor.getItem();
block = ingredient.descriptor.getBlock();
const Item* mItem;
const Block* mBlock;
RecipeIngredient mIngredient;
char mLabel;

public:
class Type& operator=(class Type const&) = default;

inline Type(string const& name, char label, int aux, unsigned short count)
: mIngredient(name, aux, count), mLabel(label) {
mItem = mIngredient.getItem();
mBlock = mIngredient.getBlock();
}
};

struct NormalizedRectangularRecipeResults {
public:
int mWidth;
int mHeight;
std::string mNormalizedResult;
std::string mWarning;

NormalizedRectangularRecipeResults() = delete;
NormalizedRectangularRecipeResults(NormalizedRectangularRecipeResults const&) = delete;
NormalizedRectangularRecipeResults(NormalizedRectangularRecipeResults const&&) = delete;
};



#undef AFTER_EXTRA
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_RECIPES
public:
Expand Down

0 comments on commit a8b27c2

Please sign in to comment.