From 4dfa414a56938388420885775e403c7ef0afdb76 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Tue, 27 Oct 2020 18:32:43 -0400 Subject: [PATCH] Fixed the ARC Serialization --- build.gradle | 2 +- src/generated/resources/.cache/cache | 3 ++- .../recipes/altar/reinforcedslate.json | 2 +- .../recipes/soulforge/reagent_air.json | 17 +++++++++++++++++ .../java/WayofTime/bloodmagic/BloodMagic.java | 2 +- .../recipe/serializer/ARCRecipeSerializer.java | 15 +++++---------- 6 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 src/generated/resources/data/bloodmagic/recipes/soulforge/reagent_air.json diff --git a/build.gradle b/build.gradle index cf634db2..0efa9fd7 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '1.16.3-3.0-2' +version = '1.16.3-3.0-3' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'BloodMagic' diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 64f2dcbc..5c45ea61 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -190,7 +190,7 @@ d79a96eb3eed597f1c18a8983764a6362a24748c data/bloodmagic/recipes/altar/dusk_tool 37913b1babf9b8159332db09b114c919b1b49473 data/bloodmagic/recipes/altar/fire_tool.json 9aeb0d2d33d839eedb2d9bbdaf76fc73e0b39941 data/bloodmagic/recipes/altar/imbuedslate.json 2643d1516f6dae79128fdc8c48c4cfe23453f171 data/bloodmagic/recipes/altar/magicianbloodorb.json -f38355165034ce314a9f0344ebc3a6cad22c76c8 data/bloodmagic/recipes/altar/reinforcedslate.json +30d84c946ad9235f6e59f1046edbe8d44acc799e data/bloodmagic/recipes/altar/reinforcedslate.json 584d01dff4d64bb88bd3783751a29723700f1728 data/bloodmagic/recipes/altar/slate.json 926d4a0e165c87a15a609744d832d2f5f04a40d0 data/bloodmagic/recipes/altar/water_tool.json 7551501cf361667ec7454c307b9d2368536fbed6 data/bloodmagic/recipes/altar/weakbloodorb.json @@ -225,6 +225,7 @@ f4763a58a8f471ec1aaa997cbd36eac8c7d51a12 data/bloodmagic/recipes/soulforge/arcan 8b64af8453c60b6b1ae55bd0dd1a68fe95e8ba19 data/bloodmagic/recipes/soulforge/commontartaricgem.json d46b61779b3c8382862d4e66c3909a1241ecca18 data/bloodmagic/recipes/soulforge/lessertartaricgem.json d6e06747c75fc06e708a15358911f1c63eee86b1 data/bloodmagic/recipes/soulforge/pettytartaricgem.json +42f6af3a4c723c6a6b2a6e1d680a875e15664e4f data/bloodmagic/recipes/soulforge/reagent_air.json 6b59a7e95e596997b7bbb894b6fbaf5015b213b5 data/bloodmagic/recipes/soulforge/reagent_fastminer.json ae3a6a760e9f793d5a62e2f0f6c45219b0017816 data/bloodmagic/recipes/soulforge/reagent_growth.json 1c391181ea77f5ed01f7226e0782b3b45162ab3c data/bloodmagic/recipes/soulforge/reagent_lava.json diff --git a/src/generated/resources/data/bloodmagic/recipes/altar/reinforcedslate.json b/src/generated/resources/data/bloodmagic/recipes/altar/reinforcedslate.json index 9e16f279..52a37c81 100644 --- a/src/generated/resources/data/bloodmagic/recipes/altar/reinforcedslate.json +++ b/src/generated/resources/data/bloodmagic/recipes/altar/reinforcedslate.json @@ -6,7 +6,7 @@ "output": { "item": "bloodmagic:reinforcedslate" }, - "upgradeLevel": 2, + "upgradeLevel": 1, "altarSyphon": 2000, "consumptionRate": 5, "drainRate": 5 diff --git a/src/generated/resources/data/bloodmagic/recipes/soulforge/reagent_air.json b/src/generated/resources/data/bloodmagic/recipes/soulforge/reagent_air.json new file mode 100644 index 00000000..59453b27 --- /dev/null +++ b/src/generated/resources/data/bloodmagic/recipes/soulforge/reagent_air.json @@ -0,0 +1,17 @@ +{ + "type": "bloodmagic:soulforge", + "input0": { + "item": "minecraft:ghast_tear" + }, + "input1": { + "tag": "forge:feathers" + }, + "input2": { + "tag": "forge:feathers" + }, + "output": { + "item": "bloodmagic:reagentair" + }, + "minimumDrain": 128.0, + "drain": 20.0 +} \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/BloodMagic.java b/src/main/java/WayofTime/bloodmagic/BloodMagic.java index 491329e2..3466744f 100644 --- a/src/main/java/WayofTime/bloodmagic/BloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/BloodMagic.java @@ -66,7 +66,7 @@ public class BloodMagic { public static final String MODID = "bloodmagic"; // Directly reference a log4j logger. - private static final Logger LOGGER = LogManager.getLogger(); + public static final Logger LOGGER = LogManager.getLogger(); private static Gson GSON = null; diff --git a/src/main/java/wayoftime/bloodmagic/common/recipe/serializer/ARCRecipeSerializer.java b/src/main/java/wayoftime/bloodmagic/common/recipe/serializer/ARCRecipeSerializer.java index b42ab927..9ec58585 100644 --- a/src/main/java/wayoftime/bloodmagic/common/recipe/serializer/ARCRecipeSerializer.java +++ b/src/main/java/wayoftime/bloodmagic/common/recipe/serializer/ARCRecipeSerializer.java @@ -11,6 +11,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipeSerializer; import net.minecraft.item.crafting.Ingredient; @@ -19,6 +20,7 @@ import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.registries.ForgeRegistryEntry; +import wayoftime.bloodmagic.BloodMagic; import wayoftime.bloodmagic.api.SerializerHelper; import wayoftime.bloodmagic.api.event.recipes.FluidStackIngredient; import wayoftime.bloodmagic.api.impl.recipe.RecipeARC; @@ -110,15 +112,8 @@ public class ARCRecipeSerializer extends ForgeRegistry addedItems.add(Pair.of(stack, chance)); } - buffer.writeInt(addedItems.size()); - for (Pair pair : addedItems) - { - buffer.writeItemStack(pair.getLeft()); - buffer.writeDouble(pair.getValue()); - } - FluidStackIngredient inputFluid = null; - FluidStack outputFluid = null; + FluidStack outputFluid = new FluidStack(Fluids.EMPTY, 1000); if (buffer.readBoolean()) { @@ -133,7 +128,7 @@ public class ARCRecipeSerializer extends ForgeRegistry return this.factory.create(recipeId, inputIng, toolIng, inputFluid, output, addedItems, outputFluid); } catch (Exception e) { -// Mekanism.logger.error("Error reading electrolysis recipe from packet.", e); + BloodMagic.LOGGER.error("Error reading ARC recipe from packet.", e); throw e; } } @@ -146,7 +141,7 @@ public class ARCRecipeSerializer extends ForgeRegistry recipe.write(buffer); } catch (Exception e) { -// Mekanism.logger.error("Error writing electrolysis recipe to packet.", e); + BloodMagic.LOGGER.error("Error writing ARC recipe to packet.", e); throw e; } }