use of com.minecolonies.api.util.constant.NbtTagConstants.TAG_DISABLED_RECIPES in project minecolonies by Minecolonies.
the class AbstractCraftingBuildingModule method serializeNBT.
@Override
public void serializeNBT(@NotNull final CompoundNBT compound) {
final CompoundNBT moduleCompound = new CompoundNBT();
@NotNull final ListNBT recipesTagList = recipes.stream().map(iToken -> StandardFactoryController.getInstance().serialize(iToken)).collect(NBTUtils.toListNBT());
moduleCompound.put(TAG_RECIPES, recipesTagList);
@NotNull final ListNBT disabledRecipesTag = new ListNBT();
for (@NotNull final IToken<?> recipe : disabledRecipes) {
if (disabledRecipes.contains(recipe)) {
disabledRecipesTag.add(StandardFactoryController.getInstance().serialize(recipe));
}
}
moduleCompound.put(TAG_DISABLED_RECIPES, disabledRecipesTag);
compound.put(getId(), moduleCompound);
}
use of com.minecolonies.api.util.constant.NbtTagConstants.TAG_DISABLED_RECIPES in project minecolonies by ldtteam.
the class AbstractCraftingBuildingModule method serializeNBT.
@Override
public void serializeNBT(@NotNull final CompoundNBT compound) {
final CompoundNBT moduleCompound = new CompoundNBT();
@NotNull final ListNBT recipesTagList = recipes.stream().map(iToken -> StandardFactoryController.getInstance().serialize(iToken)).collect(NBTUtils.toListNBT());
moduleCompound.put(TAG_RECIPES, recipesTagList);
@NotNull final ListNBT disabledRecipesTag = new ListNBT();
for (@NotNull final IToken<?> recipe : disabledRecipes) {
if (disabledRecipes.contains(recipe)) {
disabledRecipesTag.add(StandardFactoryController.getInstance().serialize(recipe));
}
}
moduleCompound.put(TAG_DISABLED_RECIPES, disabledRecipesTag);
compound.put(getId(), moduleCompound);
}
Aggregations