Moved Recipes to the common package...

This commit is contained in:
Michael Hillcox 2020-09-20 11:14:48 +01:00
parent 615bde1cb8
commit c945843038
No known key found for this signature in database
GPG key ID: 971C5B254742488F
7 changed files with 17 additions and 15 deletions

View file

@ -1,4 +1,4 @@
package de.ellpeck.actuallyadditions.recipes;
package de.ellpeck.actuallyadditions.common.recipes;
import de.ellpeck.actuallyadditions.api.lens.Lens;
import net.minecraft.block.BlockState;

View file

@ -1,9 +1,10 @@
package de.ellpeck.actuallyadditions.recipes;
package de.ellpeck.actuallyadditions.common.recipes;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import com.mojang.datafixers.Dynamic;
import com.mojang.datafixers.types.JsonOps;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.common.ActuallyAdditions;
import de.ellpeck.actuallyadditions.common.items.lens.Lenses;
@ -33,8 +34,8 @@ public class AtomicReconstructorBlockRecipeFactory extends ForgeRegistryEntry<IR
if(json.has("lens") && json.get("lens").isJsonObject()){
ResourceLocation lensId = new ResourceLocation(json.get("lens").getAsString());
if(ActuallyAdditions.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditions.LENS_REGISTRY.getValue(lensId);
if(ActuallyAdditionsAPI.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditionsAPI.LENS_REGISTRY.getValue(lensId);
} else {
throw new JsonSyntaxException(String.format("Lens type is given, but no lens could be found with id '%s'!", lensId));
}
@ -68,8 +69,8 @@ public class AtomicReconstructorBlockRecipeFactory extends ForgeRegistryEntry<IR
int energyConsumption = buffer.readVarInt();
Lens lens;
if(ActuallyAdditions.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditions.LENS_REGISTRY.getValue(lensId);
if(ActuallyAdditionsAPI.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditionsAPI.LENS_REGISTRY.getValue(lensId);
} else {
System.out.println(String.format("Lens is not possible to get while reading packet! '%s'", lensId));
return null;

View file

@ -1,4 +1,4 @@
package de.ellpeck.actuallyadditions.recipes;
package de.ellpeck.actuallyadditions.common.recipes;
import de.ellpeck.actuallyadditions.api.lens.Lens;
import net.minecraft.item.ItemStack;

View file

@ -1,7 +1,8 @@
package de.ellpeck.actuallyadditions.recipes;
package de.ellpeck.actuallyadditions.common.recipes;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.common.ActuallyAdditions;
import de.ellpeck.actuallyadditions.common.items.lens.Lenses;
@ -30,8 +31,8 @@ public class AtomicReconstructorItemRecipeFactory extends ForgeRegistryEntry<IRe
if(json.has("lens") && json.get("lens").isJsonObject()){
ResourceLocation lensId = new ResourceLocation(json.get("lens").getAsString());
if(ActuallyAdditions.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditions.LENS_REGISTRY.getValue(lensId);
if(ActuallyAdditionsAPI.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditionsAPI.LENS_REGISTRY.getValue(lensId);
} else {
throw new JsonSyntaxException(String.format("Lens type is given, but no lens could be found with id '%s'!", lensId));
}
@ -65,8 +66,8 @@ public class AtomicReconstructorItemRecipeFactory extends ForgeRegistryEntry<IRe
int energyConsumption = buffer.readVarInt();
Lens lens;
if(ActuallyAdditions.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditions.LENS_REGISTRY.getValue(lensId);
if(ActuallyAdditionsAPI.LENS_REGISTRY.containsKey(lensId)){
lens = ActuallyAdditionsAPI.LENS_REGISTRY.getValue(lensId);
} else {
System.out.println(String.format("Lens is not possible to get while reading packet! '%s'", lensId));
return null;

View file

@ -1,4 +1,4 @@
package de.ellpeck.actuallyadditions.recipes;
package de.ellpeck.actuallyadditions.common.recipes;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;

View file

@ -1,4 +1,4 @@
package de.ellpeck.actuallyadditions.recipes;
package de.ellpeck.actuallyadditions.common.recipes;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

View file

@ -1,4 +1,4 @@
package de.ellpeck.actuallyadditions.recipes;
package de.ellpeck.actuallyadditions.common.recipes;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;