Skip to content

Commit

Permalink
empty ingredient
Browse files Browse the repository at this point in the history
  • Loading branch information
MehVahdJukaar committed Dec 8, 2024
1 parent 1d3cf38 commit 0263bcb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
improved recipe conversion code. added a new ingredient type to delay converting ingredients with tags since they are not ready when conversion happens
fixed new recipe type being considered empty all the time on forge
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.common.crafting.AbstractIngredient;
import net.minecraftforge.common.crafting.CraftingHelper;
import net.minecraftforge.common.crafting.DifferenceIngredient;
import net.minecraftforge.common.crafting.IIngredientSerializer;

import java.util.ArrayList;
Expand Down Expand Up @@ -83,6 +82,11 @@ protected void invalidate() {
this.items = null;
}

@Override
public boolean isEmpty() {
return this.inner.isEmpty();
}

@Override
public IIngredientSerializer<BlockTypeSwapIngredientImpl<?>> getSerializer() {
return SERIALIZER;
Expand All @@ -95,6 +99,7 @@ public BlockTypeSwapIngredientImpl<?> parse(FriendlyByteBuf arg) {
var reg = BlockSetInternal.getByName(arg.readUtf());
var from = reg.getFromNBT(arg.readUtf());
var to = reg.getFromNBT(arg.readUtf());

var ing = Ingredient.fromNetwork(arg);
return new BlockTypeSwapIngredientImpl<>(ing, from, to, (BlockTypeRegistry) reg);
}
Expand Down
4 changes: 2 additions & 2 deletions forge/update.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/selene",
"promos": {
"1.19.2-latest": "1.20-2.13.35",
"1.19.2-recommended": "1.20-2.13.35"
"1.19.2-latest": "1.20-2.13.36",
"1.19.2-recommended": "1.20-2.13.36"
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version = 1.20.1
enabled_platforms = fabric,forge

mod_id = moonlight
mod_version = 1.20-2.13.35
mod_version = 1.20-2.13.36
maven_group = net.mehvahdjukaar
project_id = 499980

Expand Down

0 comments on commit 0263bcb

Please sign in to comment.