Skip to content

Commit

Permalink
fixed some issues with the serializer and crafttweaker compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Jan 20, 2025
1 parent e3bdb52 commit 2fe2495
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

@ZenRegister
@ZenCodeType.Name("mods.antimatter.Machines")
public class RecipeManager implements IRecipeManager<Recipe> {
public class RecipeManager implements IRecipeManager<IRecipe> {

@Override
public RecipeType<Recipe> getRecipeType() {
public RecipeType<IRecipe> getRecipeType() {
return Recipe.RECIPE_TYPE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void init() {

}

public static final RecipeType<Recipe> RECIPE_TYPE = RecipeType.register("antimatter_machine");
public static final RecipeType<IRecipe> RECIPE_TYPE = RecipeType.register("antimatter_machine");

public Recipe(@NotNull List<Ingredient> stacksInput, ItemStack[] stacksOutput, @NotNull List<FluidIngredient> fluidsInput, FluidHolder[] fluidsOutput, int duration, long power, int special, int amps) {
this.itemsInput = ImmutableList.copyOf(stacksInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.util.Set;
import java.util.stream.Collectors;

public class AntimatterRecipeSerializer extends BaseRecipeSerializer<Recipe> implements IAntimatterRecipeSerializer<Recipe> {
public class AntimatterRecipeSerializer extends BaseRecipeSerializer<IRecipe> implements IAntimatterRecipeSerializer<IRecipe> {

public static final AntimatterRecipeSerializer INSTANCE = new AntimatterRecipeSerializer();

Expand All @@ -51,7 +51,7 @@ public static void init() {
}

@Override
public RecipeType<Recipe> getRecipeType() {
public RecipeType<IRecipe> getRecipeType() {
return Recipe.RECIPE_TYPE;
}

Expand Down Expand Up @@ -237,8 +237,8 @@ public Recipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) {
}

@Override
public void toNetwork(FriendlyByteBuf buffer, Recipe recipe) {
buffer.writeUtf(recipe.mapId);
public void toNetwork(FriendlyByteBuf buffer, IRecipe recipe) {
buffer.writeUtf(recipe.getMapId());
buffer.writeInt(!recipe.hasInputItems() ? 0 : recipe.getInputItems().size());
if (recipe.hasInputItems()) {
recipe.getInputItems().forEach(t -> RecipeUtil.INSTANCE.write(buffer, t));
Expand Down

0 comments on commit 2fe2495

Please sign in to comment.