Fixed the ARC Serialization

This commit is contained in:
WayofTime 2020-10-27 18:32:43 -04:00
parent bacaf114fb
commit 4dfa414a56
6 changed files with 27 additions and 14 deletions

View file

@ -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'

View file

@ -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

View file

@ -6,7 +6,7 @@
"output": {
"item": "bloodmagic:reinforcedslate"
},
"upgradeLevel": 2,
"upgradeLevel": 1,
"altarSyphon": 2000,
"consumptionRate": 5,
"drainRate": 5

View file

@ -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
}

View file

@ -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;

View file

@ -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<RECIPE extends RecipeARC> extends ForgeRegistry
addedItems.add(Pair.of(stack, chance));
}
buffer.writeInt(addedItems.size());
for (Pair<ItemStack, Double> 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<RECIPE extends RecipeARC> 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<RECIPE extends RecipeARC> 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;
}
}