Skip to content

Commit

Permalink
Fix remapping to mojmap projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Mar 3, 2025
1 parent 66ade2b commit 73ab55c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@
import net.minecraft.world.World;

public record DryingRecipe(
String group,
String dryingGroup,
CookingRecipeCategory category,
Ingredient input,
ItemStack output,
float experience,
float cookTime
) implements Recipe<DryingRecipe.Input> {
public static final MapCodec<DryingRecipe> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.STRING.optionalFieldOf("group", "").forGetter(DryingRecipe::group),
Codec.STRING.optionalFieldOf("group", "").forGetter(DryingRecipe::dryingGroup),
CookingRecipeCategory.CODEC.fieldOf("category").orElse(CookingRecipeCategory.MISC).forGetter(DryingRecipe::category),
Ingredient.ALLOW_EMPTY_CODEC.fieldOf("ingredient").forGetter(DryingRecipe::input),
ItemStack.VALIDATED_CODEC.fieldOf("result").forGetter(DryingRecipe::output),
Codec.FLOAT.optionalFieldOf("experience", 0F).forGetter(DryingRecipe::experience),
Codec.FLOAT.optionalFieldOf("cookingTime", 1F).forGetter(DryingRecipe::cookTime)
).apply(instance, DryingRecipe::new));
public static final PacketCodec<RegistryByteBuf, DryingRecipe> PACKET_CODEC = PacketCodec.tuple(
PacketCodecs.STRING, DryingRecipe::group,
PacketCodecs.STRING, DryingRecipe::dryingGroup,
RecipeUtils.COOKING_RECIPE_CATEGORY_PACKET_CODEC, DryingRecipe::category,
Ingredient.PACKET_CODEC, DryingRecipe::input,
ItemStack.PACKET_CODEC, DryingRecipe::output,
Expand All @@ -56,7 +56,7 @@ public RecipeType<?> getType() {

@Override
public String getGroup() {
return group;
return dryingGroup;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
* Used by the mash table to produce a particular fluid from items dropped in.
*/
public record MashingRecipe (
String group,
String mashingGroup,
CraftingRecipeCategory category,
ItemFluids baseFluid,
ItemFluids result,
Ingredients ingredients,
int stewTime) implements Recipe<MashingRecipe.Input> {
public static final MapCodec<MashingRecipe> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.STRING.optionalFieldOf("group", "").forGetter(MashingRecipe::group),
Codec.STRING.optionalFieldOf("group", "").forGetter(MashingRecipe::mashingGroup),
CraftingRecipeCategory.CODEC.optionalFieldOf("category", CraftingRecipeCategory.MISC).forGetter(MashingRecipe::category),
ItemFluids.CODEC.fieldOf("base_fluid").forGetter(MashingRecipe::baseFluid),
ItemFluids.CODEC.fieldOf("result").forGetter(MashingRecipe::result),
Ingredients.CODEC.fieldOf("ingredients").forGetter(MashingRecipe::ingredients),
Codec.INT.optionalFieldOf("stew_time", 0).forGetter(MashingRecipe::stewTime)
).apply(instance, MashingRecipe::new));
public static final PacketCodec<RegistryByteBuf, MashingRecipe> PACKET_CODEC = PacketCodec.tuple(
PacketCodecs.STRING, MashingRecipe::group,
PacketCodecs.STRING, MashingRecipe::mashingGroup,
RecipeUtils.CRAFTING_RECIPE_CATEGORY_PACKET_CODEC, MashingRecipe::category,
ItemFluids.PACKET_CODEC, MashingRecipe::baseFluid,
ItemFluids.PACKET_CODEC, MashingRecipe::result,
Expand All @@ -67,7 +67,7 @@ public RecipeSerializer<?> getSerializer() {

@Override
public String getGroup() {
return group;
return mashingGroup;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
* Used by the bunsen burner to produce the correct fluid type for ingredients dropped into it
*/
public record ReducingRecipe (
String group,
String reducingGroup,
CraftingRecipeCategory category,
Result result,
Ingredients ingredients,
int stewTime) implements BunsenBurnerRecipe {
public static final MapCodec<ReducingRecipe> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codec.STRING.optionalFieldOf("group", "").forGetter(ReducingRecipe::group),
Codec.STRING.optionalFieldOf("group", "").forGetter(ReducingRecipe::reducingGroup),
CraftingRecipeCategory.CODEC.optionalFieldOf("category", CraftingRecipeCategory.MISC).forGetter(ReducingRecipe::category),
Result.CODEC.fieldOf("result").forGetter(ReducingRecipe::result),
Ingredients.CODEC.fieldOf("ingredients").forGetter(ReducingRecipe::ingredients),
Codec.INT.optionalFieldOf("stew_time", 0).forGetter(ReducingRecipe::stewTime)
).apply(instance, ReducingRecipe::new));
public static final PacketCodec<RegistryByteBuf, ReducingRecipe> PACKET_CODEC = PacketCodec.tuple(
PacketCodecs.STRING, ReducingRecipe::group,
PacketCodecs.STRING, ReducingRecipe::reducingGroup,
RecipeUtils.CRAFTING_RECIPE_CATEGORY_PACKET_CODEC, ReducingRecipe::category,
Result.PACKET_CODEC, ReducingRecipe::result,
Ingredients.PACKET_CODEC, ReducingRecipe::ingredients,
Expand All @@ -58,7 +58,7 @@ public RecipeSerializer<?> getSerializer() {

@Override
public String getGroup() {
return group;
return reducingGroup;
}

@Override
Expand Down

0 comments on commit 73ab55c

Please sign in to comment.