diff --git a/src/main/java/li/cil/oc2/common/Constants.java b/src/main/java/li/cil/oc2/common/Constants.java index 58e36533..6b70dac4 100644 --- a/src/main/java/li/cil/oc2/common/Constants.java +++ b/src/main/java/li/cil/oc2/common/Constants.java @@ -51,12 +51,8 @@ public final class Constants { public static final String INVENTORY_OPERATIONS_MODULE_ITEM_NAME = "inventory_operations_module"; public static final String BLOCK_OPERATIONS_MODULE_ITEM_NAME = "block_operations_module"; - public static final String CONTROL_UNIT_ITEM_NAME = "control_unit"; - public static final String ARITHMETIC_LOGIC_UNIT_ITEM_NAME = "arithmetic_logic_unit"; - public static final String MICROCHIP_ITEM_NAME = "microchip"; - public static final String DISK_PLATTER_ITEM_NAME = "disk_platter"; public static final String TRANSISTOR_ITEM_NAME = "transistor"; - public static final String PCB_ITEM_NAME = "pcb"; + public static final String CIRCUIT_BOARD_ITEM_NAME = "circuit_board"; /////////////////////////////////////////////////////////////////// diff --git a/src/main/java/li/cil/oc2/common/Main.java b/src/main/java/li/cil/oc2/common/Main.java index a19bfd63..221f0e49 100644 --- a/src/main/java/li/cil/oc2/common/Main.java +++ b/src/main/java/li/cil/oc2/common/Main.java @@ -10,7 +10,7 @@ import li.cil.oc2.common.bus.device.data.Firmwares; import li.cil.oc2.common.bus.device.provider.Providers; import li.cil.oc2.common.container.Containers; import li.cil.oc2.common.entity.Entities; -import li.cil.oc2.common.customrecipes.CustomRecipes; +import li.cil.oc2.common.item.crafting.RecipeSerializers; import li.cil.oc2.common.item.Items; import li.cil.oc2.common.serialization.serializers.Serializers; import li.cil.oc2.common.tags.BlockTags; @@ -21,7 +21,6 @@ import li.cil.sedna.Sedna; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; @Mod(API.MOD_ID) @@ -40,13 +39,13 @@ public final class Main { TileEntities.initialize(); Entities.initialize(); Containers.initialize(); + RecipeSerializers.initialize(); SoundEvents.initialize(); Providers.initialize(); DeviceTypes.initialize(); BlockDeviceDataRegistration.initialize(); Firmwares.initialize(); - CustomRecipes.initialize(); FMLJavaModLoadingContext.get().getModEventBus().register(CommonSetup.class); DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> FMLJavaModLoadingContext.get().getModEventBus().register(ClientSetup.class)); diff --git a/src/main/java/li/cil/oc2/common/customrecipes/CustomRecipes.java b/src/main/java/li/cil/oc2/common/customrecipes/CustomRecipes.java deleted file mode 100644 index 37cae61a..00000000 --- a/src/main/java/li/cil/oc2/common/customrecipes/CustomRecipes.java +++ /dev/null @@ -1,20 +0,0 @@ -package li.cil.oc2.common.customrecipes; - -import li.cil.oc2.api.API; -import net.minecraft.item.crafting.IRecipeSerializer; -import net.minecraftforge.fml.RegistryObject; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; - -public final class CustomRecipes { - private static final DeferredRegister> INITIALIZER = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, API.MOD_ID); - - public static final RegistryObject HDD_RECIPE = INITIALIZER.register("hard_drive", HDDRecipe.Serializer::new); - public static final RegistryObject MEMORY_RECIPE = INITIALIZER.register("memory", MemoryRecipe.Serializer::new); - public static final RegistryObject FLASH_MEMORY_LINUX_RECIPE = INITIALIZER.register("flash_memory_linux", LinuxFlashRecipe.Serializer::new); - - public static void initialize() { - INITIALIZER.register(FMLJavaModLoadingContext.get().getModEventBus()); - } -} diff --git a/src/main/java/li/cil/oc2/common/customrecipes/HDDRecipe.java b/src/main/java/li/cil/oc2/common/customrecipes/HDDRecipe.java deleted file mode 100644 index e03aa6c4..00000000 --- a/src/main/java/li/cil/oc2/common/customrecipes/HDDRecipe.java +++ /dev/null @@ -1,109 +0,0 @@ -package li.cil.oc2.common.customrecipes; - -import com.google.gson.JsonObject; -import li.cil.oc2.common.Constants; -import li.cil.oc2.common.item.HardDriveItem; -import li.cil.oc2.common.item.Items; -import net.minecraft.inventory.CraftingInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.*; -import net.minecraft.network.PacketBuffer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.fml.RegistryObject; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.ForgeRegistryEntry; -import org.jetbrains.annotations.NotNull; - -public class HDDRecipe implements ICraftingRecipe { - private static final RegistryObject regObject = RegistryObject.of(new ResourceLocation("oc2:hard_drive"), ForgeRegistries.ITEMS); - - private final ResourceLocation id; - - public HDDRecipe(ResourceLocation idIn) { - id = idIn; - } - - @Override - public @NotNull ResourceLocation getId() { - return id; - } - - @Override - public @NotNull ItemStack getRecipeOutput() { - return new ItemStack(regObject.get()); - } - - @Override - public boolean matches(@NotNull CraftingInventory inv, @NotNull World worldIn) { - return craftingTemplateForTiers(inv) && creatingTiers(inv) != -1; - } - - @Override - public @NotNull ItemStack getCraftingResult(@NotNull CraftingInventory inv) { - boolean checkTemplate = craftingTemplateForTiers(inv); - - if (!checkTemplate) return ItemStack.EMPTY; - - int tier = creatingTiers(inv); - return (tier != -1) ? HardDriveItem.withCapacity(((int) Math.pow(2, tier)) * Constants.MEGABYTE) : ItemStack.EMPTY; - } - - @Override - public boolean canFit(int width, int height) { - return width * height >= 9; - } - - @Override - public @NotNull IRecipeSerializer getSerializer() { - return CustomRecipes.HDD_RECIPE.get(); - } - - public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { - @Override - public @NotNull HDDRecipe read(@NotNull ResourceLocation recipeId, @NotNull JsonObject json) { - return new HDDRecipe(recipeId); - } - - @Override - public HDDRecipe read(@NotNull ResourceLocation recipeId, @NotNull PacketBuffer buffer) { - return new HDDRecipe(recipeId); - } - - @Override - public void write(@NotNull PacketBuffer buffer, @NotNull HDDRecipe recipe) { - - } - } - - private int creatingTiers(CraftingInventory inv) { - Item iron = net.minecraft.item.Items.IRON_INGOT; - Item gold = net.minecraft.item.Items.GOLD_INGOT; - Item diamond = net.minecraft.item.Items.DIAMOND; - Item first = inv.getStackInSlot(2).getItem(); - Item second = inv.getStackInSlot(8).getItem(); - boolean ironTemplate = first.equals(iron) && second.equals(iron); - boolean goldTemplate = first.equals(gold) && second.equals(gold); - boolean diamondTemplate = first.equals(diamond) && second.equals(diamond); - - if (ironTemplate) return 1; - else if (goldTemplate) return 2; - else if (diamondTemplate) return 3; - else return -1; - - } - - private boolean craftingTemplateForTiers(CraftingInventory inv) { - - Item slot5 = inv.getStackInSlot(5).getItem(); - - return inv.getStackInSlot(0).getItem().equals(Items.MICROCHIP_ITEM.get()) - && inv.getStackInSlot(1).getItem().equals(Items.DISK_PLATTER_ITEM.get()) - && inv.getStackInSlot(3).getItem().equals(Items.PCB_ITEM.get()) - && inv.getStackInSlot(4).getItem().equals(Items.DISK_PLATTER_ITEM.get()) - && (slot5.equals(net.minecraft.item.Items.PISTON) || slot5.equals(net.minecraft.item.Items.STICKY_PISTON)) - && inv.getStackInSlot(6).getItem().equals(Items.MICROCHIP_ITEM.get()) - && inv.getStackInSlot(7).getItem().equals(Items.DISK_PLATTER_ITEM.get()); - } -} \ No newline at end of file diff --git a/src/main/java/li/cil/oc2/common/customrecipes/LinuxFlashRecipe.java b/src/main/java/li/cil/oc2/common/customrecipes/LinuxFlashRecipe.java deleted file mode 100644 index 2e34a359..00000000 --- a/src/main/java/li/cil/oc2/common/customrecipes/LinuxFlashRecipe.java +++ /dev/null @@ -1,94 +0,0 @@ -package li.cil.oc2.common.customrecipes; - -import com.google.gson.JsonObject; -import li.cil.oc2.api.bus.device.data.Firmware; -import li.cil.oc2.common.Constants; -import li.cil.oc2.common.bus.device.data.Firmwares; -import li.cil.oc2.common.item.FlashMemoryItem; -import li.cil.oc2.common.item.Items; -import li.cil.oc2.common.item.MemoryItem; -import net.minecraft.inventory.CraftingInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.ICraftingRecipe; -import net.minecraft.item.crafting.IRecipeSerializer; -import net.minecraft.network.PacketBuffer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.fml.RegistryObject; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.ForgeRegistryEntry; -import org.jetbrains.annotations.NotNull; - -import java.util.Arrays; - -public class LinuxFlashRecipe implements ICraftingRecipe { - private static final RegistryObject regObject = RegistryObject.of(new ResourceLocation("oc2:flash_memory"), ForgeRegistries.ITEMS); - - private final ResourceLocation id; - - public LinuxFlashRecipe(ResourceLocation idIn) { - id = idIn; - } - - @Override - public @NotNull ResourceLocation getId() { - return id; - } - - @Override - public @NotNull ItemStack getRecipeOutput() { - return new ItemStack(regObject.get()); - } - - @Override - public boolean matches(@NotNull CraftingInventory inv, @NotNull World worldIn) { - return isValid(inv); - } - - @Override - public @NotNull ItemStack getCraftingResult(@NotNull CraftingInventory inv) { - return (isValid(inv)) ? FlashMemoryItem.withFirmware(Firmwares.BUILDROOT.get()) : ItemStack.EMPTY; - } - - @Override - public boolean canFit(int width, int height) { - return width * height >= 4; - } - - @Override - public @NotNull IRecipeSerializer getSerializer() { - return CustomRecipes.FLASH_MEMORY_LINUX_RECIPE.get(); - } - - public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { - @Override - public @NotNull LinuxFlashRecipe read(@NotNull ResourceLocation recipeId, @NotNull JsonObject json) { - return new LinuxFlashRecipe(recipeId); - } - - @Override - public LinuxFlashRecipe read(@NotNull ResourceLocation recipeId, @NotNull PacketBuffer buffer) { - return new LinuxFlashRecipe(recipeId); - } - - @Override - public void write(@NotNull PacketBuffer buffer, @NotNull LinuxFlashRecipe recipe) { - - } - } - - private boolean isValid(CraftingInventory inv) { - ItemStack[] array = new ItemStack[8]; - - for (int i = 0; i < 8; i++) { - array[i] = inv.getStackInSlot(i); - } - - boolean memoryCard = Arrays.stream(array).filter(x -> x.getItem().equals(Items.FLASH_MEMORY_ITEM.get())).count() == 1; - boolean wrenchItem = Arrays.stream(array).filter(x -> x.getItem().equals(Items.WRENCH_ITEM.get())).count() == 1; - boolean emptySlots = Arrays.stream(array).filter(ItemStack::isEmpty).count() == 6; - - return memoryCard && wrenchItem && emptySlots; - } -} diff --git a/src/main/java/li/cil/oc2/common/customrecipes/MemoryRecipe.java b/src/main/java/li/cil/oc2/common/customrecipes/MemoryRecipe.java deleted file mode 100644 index b435f5ee..00000000 --- a/src/main/java/li/cil/oc2/common/customrecipes/MemoryRecipe.java +++ /dev/null @@ -1,101 +0,0 @@ -package li.cil.oc2.common.customrecipes; - -import com.google.gson.JsonObject; -import li.cil.oc2.common.Constants; -import li.cil.oc2.common.item.Items; -import li.cil.oc2.common.item.MemoryItem; -import net.minecraft.inventory.CraftingInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.ICraftingRecipe; -import net.minecraft.item.crafting.IRecipeSerializer; -import net.minecraft.network.PacketBuffer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.fml.RegistryObject; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.ForgeRegistryEntry; -import org.jetbrains.annotations.NotNull; - -public class MemoryRecipe implements ICraftingRecipe { - private static final RegistryObject regObject = RegistryObject.of(new ResourceLocation("oc2:memory"), ForgeRegistries.ITEMS); - - private final ResourceLocation id; - - public MemoryRecipe(ResourceLocation idIn) { - id = idIn; - } - - @Override - public @NotNull ResourceLocation getId() { - return id; - } - - @Override - public @NotNull ItemStack getRecipeOutput() { - return new ItemStack(regObject.get()); - } - - @Override - public boolean matches(@NotNull CraftingInventory inv, @NotNull World worldIn) { - int level = getLevelOfMemory(inv); - return level == 2 || level == 4 || level == 8; - } - - @Override - public @NotNull ItemStack getCraftingResult(@NotNull CraftingInventory inv) { - int level = getLevelOfMemory(inv); - - return (level == 2 || level == 4 || level == 8) ? MemoryItem.withCapacity(level * Constants.MEGABYTE) : ItemStack.EMPTY; - } - - @Override - public boolean canFit(int width, int height) { - return width * height >= 4; - } - - @Override - public @NotNull IRecipeSerializer getSerializer() { - return CustomRecipes.MEMORY_RECIPE.get(); - } - - public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { - @Override - public @NotNull MemoryRecipe read(@NotNull ResourceLocation recipeId, @NotNull JsonObject json) { - return new MemoryRecipe(recipeId); - } - - @Override - public MemoryRecipe read(@NotNull ResourceLocation recipeId, @NotNull PacketBuffer buffer) { - return new MemoryRecipe(recipeId); - } - - @Override - public void write(@NotNull PacketBuffer buffer, @NotNull MemoryRecipe recipe) { - - } - } - - private int getLevelOfMemory(CraftingInventory inv) { - if (!inv.getStackInSlot(0).getItem().equals(Items.PCB_ITEM.get())) return 0; - ItemStack[] array = new ItemStack[8]; - - for (int i = 0; i < 8; i++) { - array[i] = inv.getStackInSlot(i); - } - - int value = 0; - for (int i = 1; i < 9; i++) { - if (array[0].getItem().equals(Items.MICROCHIP_ITEM.get())) { - value++; - } - } - int valueEmpty = 0; - for (int i = 1; i < 9; i++) { - if (array[0].isEmpty()) { - valueEmpty++; - } - } - return valueEmpty + value == 8 ? value : 0; - } -} diff --git a/src/main/java/li/cil/oc2/common/item/Items.java b/src/main/java/li/cil/oc2/common/item/Items.java index c99cbbfa..d6f53121 100644 --- a/src/main/java/li/cil/oc2/common/item/Items.java +++ b/src/main/java/li/cil/oc2/common/item/Items.java @@ -45,12 +45,8 @@ public final class Items { public static final RegistryObject INVENTORY_OPERATIONS_MODULE = register(Constants.INVENTORY_OPERATIONS_MODULE_ITEM_NAME); public static final RegistryObject BLOCK_OPERATIONS_MODULE = register(Constants.BLOCK_OPERATIONS_MODULE_ITEM_NAME, BlockOperationsModule::new); - public static final RegistryObject CONTROL_UNIT_ITEM = register(Constants.CONTROL_UNIT_ITEM_NAME, Item::new); - public static final RegistryObject ARITHMETIC_LOGIC_UNIT_ITEM = register(Constants.ARITHMETIC_LOGIC_UNIT_ITEM_NAME, Item::new); - public static final RegistryObject MICROCHIP_ITEM = register(Constants.MICROCHIP_ITEM_NAME, Item::new); - public static final RegistryObject DISK_PLATTER_ITEM = register(Constants.DISK_PLATTER_ITEM_NAME, Item::new); - public static final RegistryObject TRANSISTOR_ITEM = register(Constants.TRANSISTOR_ITEM_NAME, Item::new); - public static final RegistryObject PCB_ITEM = register(Constants.PCB_ITEM_NAME, Item::new); + public static final RegistryObject TRANSISTOR = register(Constants.TRANSISTOR_ITEM_NAME, ModItem::new); + public static final RegistryObject CIRCUIT_BOARD = register(Constants.CIRCUIT_BOARD_ITEM_NAME, ModItem::new); /////////////////////////////////////////////////////////////////// diff --git a/src/main/java/li/cil/oc2/common/item/crafting/RecipeSerializers.java b/src/main/java/li/cil/oc2/common/item/crafting/RecipeSerializers.java new file mode 100644 index 00000000..b14af870 --- /dev/null +++ b/src/main/java/li/cil/oc2/common/item/crafting/RecipeSerializers.java @@ -0,0 +1,19 @@ +package li.cil.oc2.common.item.crafting; + +import li.cil.oc2.api.API; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraftforge.fml.RegistryObject; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; + +public final class RecipeSerializers { + private static final DeferredRegister> RECIPE_SERIALIZERS = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, API.MOD_ID); + + public static final RegistryObject SHAPED = RECIPE_SERIALIZERS.register("shaped", ShapedNbtRecipe.Serializer::new); + public static final RegistryObject SHAPELESS = RECIPE_SERIALIZERS.register("shapeless", ShapelessNbtRecipe.Serializer::new); + + public static void initialize() { + RECIPE_SERIALIZERS.register(FMLJavaModLoadingContext.get().getModEventBus()); + } +} diff --git a/src/main/java/li/cil/oc2/common/item/crafting/ShapedNbtRecipe.java b/src/main/java/li/cil/oc2/common/item/crafting/ShapedNbtRecipe.java new file mode 100644 index 00000000..87bcd36d --- /dev/null +++ b/src/main/java/li/cil/oc2/common/item/crafting/ShapedNbtRecipe.java @@ -0,0 +1,57 @@ +package li.cil.oc2.common.item.crafting; + +import com.google.gson.JsonObject; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.ShapedRecipe; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.JSONUtils; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.registries.ForgeRegistryEntry; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.Nullable; + +public final class ShapedNbtRecipe extends ShapedRecipe { + private static final Logger LOGGER = LogManager.getLogger(); + + public ShapedNbtRecipe(final ShapedRecipe recipe) { + this(recipe, recipe.getRecipeOutput()); + } + + public ShapedNbtRecipe(final ShapedRecipe recipe, final ItemStack output) { + super(recipe.getId(), recipe.getGroup(), recipe.getWidth(), recipe.getHeight(), recipe.getIngredients(), output); + } + + public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { + @Override + public ShapedNbtRecipe read(final ResourceLocation location, final JsonObject json) { + final ShapedRecipe recipe = CRAFTING_SHAPED.read(location, json); + final ItemStack stack = recipe.getRecipeOutput(); + if (json.has("nbt")) { + try { + final CompoundNBT recipeTag = JsonToNBT.getTagFromJson( + JSONUtils.getJsonObject(json, "nbt").toString()); + stack.getOrCreateTag().merge(recipeTag); + } catch (final CommandSyntaxException e) { + LOGGER.error(e); + } + } + return new ShapedNbtRecipe(recipe, stack); + } + + @Nullable + @Override + public ShapedNbtRecipe read(final ResourceLocation location, final PacketBuffer buffer) { + return new ShapedNbtRecipe(CRAFTING_SHAPED.read(location, buffer)); + } + + @Override + public void write(final PacketBuffer buffer, final ShapedNbtRecipe recipe) { + CRAFTING_SHAPED.write(buffer, recipe); + } + } +} diff --git a/src/main/java/li/cil/oc2/common/item/crafting/ShapelessNbtRecipe.java b/src/main/java/li/cil/oc2/common/item/crafting/ShapelessNbtRecipe.java new file mode 100644 index 00000000..4dbc7649 --- /dev/null +++ b/src/main/java/li/cil/oc2/common/item/crafting/ShapelessNbtRecipe.java @@ -0,0 +1,57 @@ +package li.cil.oc2.common.item.crafting; + +import com.google.gson.JsonObject; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipeSerializer; +import net.minecraft.item.crafting.ShapelessRecipe; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.JSONUtils; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.registries.ForgeRegistryEntry; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.Nullable; + +public final class ShapelessNbtRecipe extends ShapelessRecipe { + private static final Logger LOGGER = LogManager.getLogger(); + + public ShapelessNbtRecipe(final ShapelessRecipe recipe) { + this(recipe, recipe.getRecipeOutput()); + } + + public ShapelessNbtRecipe(final ShapelessRecipe recipe, final ItemStack output) { + super(recipe.getId(), recipe.getGroup(), output, recipe.getIngredients()); + } + + public static class Serializer extends ForgeRegistryEntry> implements IRecipeSerializer { + @Override + public ShapelessNbtRecipe read(final ResourceLocation location, final JsonObject json) { + final ShapelessRecipe recipe = CRAFTING_SHAPELESS.read(location, json); + final ItemStack stack = recipe.getRecipeOutput(); + if (json.has("nbt")) { + try { + final CompoundNBT recipeTag = JsonToNBT.getTagFromJson( + JSONUtils.getJsonObject(json, "nbt").toString()); + stack.getOrCreateTag().merge(recipeTag); + } catch (final CommandSyntaxException e) { + LOGGER.error(e); + } + } + return new ShapelessNbtRecipe(recipe, stack); + } + + @Nullable + @Override + public ShapelessNbtRecipe read(final ResourceLocation location, final PacketBuffer buffer) { + return new ShapelessNbtRecipe(CRAFTING_SHAPELESS.read(location, buffer)); + } + + @Override + public void write(final PacketBuffer buffer, final ShapelessNbtRecipe recipe) { + CRAFTING_SHAPELESS.write(buffer, recipe); + } + } +} diff --git a/src/main/java/li/cil/oc2/common/item/crafting/package-info.java b/src/main/java/li/cil/oc2/common/item/crafting/package-info.java new file mode 100644 index 00000000..43082be6 --- /dev/null +++ b/src/main/java/li/cil/oc2/common/item/crafting/package-info.java @@ -0,0 +1,7 @@ +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +package li.cil.oc2.common.item.crafting; + +import mcp.MethodsReturnNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/li/cil/oc2/data/CraftingRecipes.java b/src/main/java/li/cil/oc2/data/CraftingRecipes.java deleted file mode 100644 index fdb9f020..00000000 --- a/src/main/java/li/cil/oc2/data/CraftingRecipes.java +++ /dev/null @@ -1,194 +0,0 @@ -package li.cil.oc2.data; - -import li.cil.oc2.common.item.Items; -import net.minecraft.advancements.criterion.InventoryChangeTrigger; -import net.minecraft.data.*; -import net.minecraft.item.Item; -import net.minecraft.item.crafting.Ingredient; -import net.minecraft.util.IItemProvider; -import net.minecraftforge.common.Tags; -import net.minecraftforge.fml.RegistryObject; - -import java.util.function.Consumer; - -public final class CraftingRecipes extends RecipeProvider { - - public CraftingRecipes(final DataGenerator generatorIn) { - super(generatorIn); - } - - @Override - protected void registerRecipes(final Consumer consumer) { - ShapedRecipeBuilder - .shapedRecipe(Items.WRENCH_ITEM.get()) - .patternLine("I I") - .patternLine(" C ") - .patternLine(" I ") - .key('I', net.minecraft.item.Items.IRON_INGOT) - .key('C', Items.MICROCHIP_ITEM.get()) - .addCriterion("has_microchip", inventoryChange(Items.MICROCHIP_ITEM.get())) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.TRANSISTOR_ITEM.get(), 4) - .patternLine("III") - .patternLine("GPG") - .patternLine(" R ") - .key('I', net.minecraft.item.Items.IRON_INGOT) - .key('G', net.minecraft.item.Items.GOLD_NUGGET) - .key('R', net.minecraft.item.Items.REDSTONE) - .key('P', net.minecraft.item.Items.PAPER) - .addCriterion("has_iron", inventoryChange(net.minecraft.item.Items.GOLD_NUGGET)) - .build(consumer); - - createInterfaceCard(Items.REDSTONE_INTERFACE_CARD_ITEM, net.minecraft.item.Items.REDSTONE_TORCH, consumer); - - createInterfaceCardBlock(Items.REDSTONE_INTERFACE_ITEM, Items.REDSTONE_INTERFACE_CARD_ITEM, consumer); - - ShapelessRecipeBuilder - .shapelessRecipe(Items.PCB_ITEM.get()) - .addIngredient(net.minecraft.item.Items.GOLD_NUGGET) - .addIngredient(Ingredient.fromItems(net.minecraft.item.Items.SLIME_BALL, net.minecraft.item.Items.HONEY_BOTTLE)) - .addIngredient(Ingredient.fromItems(net.minecraft.item.Items.KELP, net.minecraft.item.Items.GREEN_DYE)) - .addCriterion("has_iron", inventoryChange(net.minecraft.item.Items.GOLD_NUGGET)) - .build(consumer); - - createInterfaceCard(Items.NETWORK_INTERFACE_CARD_ITEM, Items.NETWORK_CABLE_ITEM.get(), consumer); - - createInterfaceCardBlock(Items.NETWORK_HUB_ITEM, Items.NETWORK_INTERFACE_CARD_ITEM, consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.NETWORK_CONNECTOR_ITEM.get(), 2) - .patternLine("NWN") - .patternLine("NWN") - .key('N', net.minecraft.item.Items.GOLD_NUGGET) - .key('W', Items.NETWORK_CABLE_ITEM.get()) - .addCriterion("has_iron", inventoryChange(Items.NETWORK_CABLE_ITEM.get())) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.NETWORK_CABLE_ITEM.get(), 6) - .patternLine("SSS") - .patternLine("GGG") - .key('G', net.minecraft.item.Items.GOLD_NUGGET) - .key('S', net.minecraft.item.Items.STRING) - .addCriterion("has_iron", inventoryChange(net.minecraft.item.Items.GOLD_NUGGET)) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.MICROCHIP_ITEM.get()) - .patternLine("III") - .patternLine("RTR") - .patternLine("III") - .key('I', net.minecraft.item.Items.GOLD_NUGGET) - .key('T', Items.TRANSISTOR_ITEM.get()) - .key('R', net.minecraft.item.Items.REDSTONE) - .addCriterion("has_iron", inventoryChange(net.minecraft.item.Items.IRON_INGOT)) - .build(consumer); - - // MEMORY - // HARD_DRIVE - // FLASH_MEMORY_LINUX - // FLASH_MEMORY - - ShapedRecipeBuilder - .shapedRecipe(Items.DISK_PLATTER_ITEM.get(), 6) - .patternLine(" N ") - .patternLine("N N") - .patternLine(" N ") - .key('N', net.minecraft.item.Items.IRON_NUGGET) - .addCriterion("has_iron", inventoryChange(net.minecraft.item.Items.IRON_NUGGET)) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.CONTROL_UNIT_ITEM.get()) - .patternLine("IRI") - .patternLine("TCT") - .patternLine("ITI") - .key('I', net.minecraft.item.Items.GOLD_NUGGET) - .key('T', Items.TRANSISTOR_ITEM.get()) - .key('C', net.minecraft.item.Items.CLOCK) - .key('R', net.minecraft.item.Items.REDSTONE) - .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR_ITEM.get())) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.COMPUTER_ITEM.get()) - .patternLine("IMI") - .patternLine("BCB") - .patternLine("IPI") - .key('I', net.minecraft.item.Items.GOLD_NUGGET) - .key('C', Tags.Items.CHESTS_WOODEN) - .key('M', Items.MICROCHIP_ITEM.get()) - .key('P', Items.PCB_ITEM.get()) - .key('B', net.minecraft.item.Items.IRON_BARS) - .addCriterion("has_microchip", inventoryChange(Items.MICROCHIP_ITEM.get())) - .addCriterion("has_pcb", inventoryChange(Items.PCB_ITEM.get())) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.BUS_INTERFACE_ITEM.get()) - .patternLine("N ") - .patternLine("NC ") - .patternLine("N ") - .key('N', net.minecraft.item.Items.GOLD_NUGGET) - .key('C', Items.BUS_CABLE_ITEM.get()) - .addCriterion("has_bus_cable", inventoryChange(Items.BUS_CABLE_ITEM.get())) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.BUS_CABLE_ITEM.get(), 3) - .patternLine("NNN") - .patternLine("WWW") - .patternLine("NNN") - .key('N', net.minecraft.item.Items.GOLD_NUGGET) - .key('W', Items.NETWORK_CABLE_ITEM.get()) - .addCriterion("has_network_cable", inventoryChange(Items.NETWORK_CABLE_ITEM.get())) - .build(consumer); - - ShapedRecipeBuilder - .shapedRecipe(Items.ARITHMETIC_LOGIC_UNIT_ITEM.get()) - .patternLine("IRI") - .patternLine("TNT") - .patternLine("ITI") - .key('I', net.minecraft.item.Items.IRON_NUGGET) - .key('T', Items.TRANSISTOR_ITEM.get()) - .key('N', Items.MICROCHIP_ITEM.get()) - .key('R', net.minecraft.item.Items.REDSTONE) - .addCriterion("has_microchip", inventoryChange(Items.MICROCHIP_ITEM.get())) - .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR_ITEM.get())) - .build(consumer); - } - - private void createInterfaceCard(final RegistryObject result, final Item type, final Consumer consumer) { - ShapedRecipeBuilder - .shapedRecipe(result.get()) - .patternLine("POG") - .patternLine("PC ") - .patternLine("PI ") - .key('I', net.minecraft.item.Items.GOLD_NUGGET) - .key('P', net.minecraft.item.Items.IRON_NUGGET) - .key('C', Items.PCB_ITEM.get()) - .key('O', Items.MICROCHIP_ITEM.get()) - .key('G', type) - .addCriterion("has_pcb", inventoryChange(Items.PCB_ITEM.get())) - .addCriterion("has_microchip", inventoryChange(Items.MICROCHIP_ITEM.get())) - .build(consumer); - } - - private void createInterfaceCardBlock(final RegistryObject result, final RegistryObject type, final Consumer consumer) { - ShapedRecipeBuilder - .shapedRecipe(result.get()) - .patternLine("GGG") - .patternLine("GCG") - .patternLine("GGG") - .key('G', net.minecraft.item.Items.GOLD_NUGGET) - .key('C', type.get()) - .addCriterion("has_custom_card", inventoryChange(type.get())) - .build(consumer); - } - - private static InventoryChangeTrigger.Instance inventoryChange(IItemProvider item) { - return InventoryChangeTrigger.Instance.forItems(item); - } -} diff --git a/src/main/java/li/cil/oc2/data/DataGenerators.java b/src/main/java/li/cil/oc2/data/DataGenerators.java index 59a7391d..81337d28 100644 --- a/src/main/java/li/cil/oc2/data/DataGenerators.java +++ b/src/main/java/li/cil/oc2/data/DataGenerators.java @@ -21,7 +21,7 @@ public final class DataGenerators { final BlockTagsProvider blockTagProvider = new ModBlockTagsProvider(generator, existingFileHelper); generator.addProvider(blockTagProvider); generator.addProvider(new ModItemTagsProvider(generator, blockTagProvider, existingFileHelper)); - generator.addProvider(new CraftingRecipes(generator)); + generator.addProvider(new ModRecipesProvider(generator)); } } } diff --git a/src/main/java/li/cil/oc2/data/ModBlockStateProvider.java b/src/main/java/li/cil/oc2/data/ModBlockStateProvider.java index c956881b..55a7fe3b 100644 --- a/src/main/java/li/cil/oc2/data/ModBlockStateProvider.java +++ b/src/main/java/li/cil/oc2/data/ModBlockStateProvider.java @@ -33,6 +33,7 @@ public class ModBlockStateProvider extends BlockStateProvider { .transform(ModelBuilder.Perspective.FIXED) .rotation(270, 0, 0) .translation(0, 0, -5) + .scale(1, 1, 1) .end() .end(); horizontalBlock(Blocks.NETWORK_HUB, Items.NETWORK_HUB); @@ -47,6 +48,7 @@ public class ModBlockStateProvider extends BlockStateProvider { final ModelFile baseModel = models().getExistingFile(new ResourceLocation(API.MOD_ID, "block/cable_base")); final ModelFile linkModel = models().getExistingFile(new ResourceLocation(API.MOD_ID, "block/cable_link")); final ModelFile plugModel = models().getExistingFile(new ResourceLocation(API.MOD_ID, "block/cable_plug")); + final ModelFile straightModel = models().getExistingFile(new ResourceLocation(API.MOD_ID, "block/cable_straight")); final MultiPartBlockStateBuilder builder = getMultipartBuilder(Blocks.BUS_CABLE.get()); @@ -88,7 +90,7 @@ public class ModBlockStateProvider extends BlockStateProvider { }); itemModels().getBuilder(Items.BUS_CABLE.getId().getPath()) - .parent(baseModel) + .parent(straightModel) .transforms() .transform(ModelBuilder.Perspective.GUI) .rotation(30, 225, 0) diff --git a/src/main/java/li/cil/oc2/data/ModItemModelProvider.java b/src/main/java/li/cil/oc2/data/ModItemModelProvider.java index dbe9055d..83512e90 100644 --- a/src/main/java/li/cil/oc2/data/ModItemModelProvider.java +++ b/src/main/java/li/cil/oc2/data/ModItemModelProvider.java @@ -43,6 +43,9 @@ public final class ModItemModelProvider extends ItemModelProvider { simple(Items.INVENTORY_OPERATIONS_MODULE, "item/inventory_operations_module"); simple(Items.BLOCK_OPERATIONS_MODULE, "item/block_operations_module"); + simple(Items.TRANSISTOR, "item/transistor"); + simple(Items.CIRCUIT_BOARD, "item/circuit_board"); + withExistingParent(Constants.ROBOT_ENTITY_NAME, "template_shulker_box"); } diff --git a/src/main/java/li/cil/oc2/data/ModRecipesProvider.java b/src/main/java/li/cil/oc2/data/ModRecipesProvider.java new file mode 100644 index 00000000..7babbea2 --- /dev/null +++ b/src/main/java/li/cil/oc2/data/ModRecipesProvider.java @@ -0,0 +1,198 @@ +package li.cil.oc2.data; + +import li.cil.oc2.common.item.Items; +import net.minecraft.advancements.criterion.InventoryChangeTrigger; +import net.minecraft.data.*; +import net.minecraft.tags.ItemTags; +import net.minecraft.util.IItemProvider; +import net.minecraftforge.common.Tags; + +import java.util.function.Consumer; + +public final class ModRecipesProvider extends RecipeProvider { + + public ModRecipesProvider(final DataGenerator generatorIn) { + super(generatorIn); + } + + @Override + protected void registerRecipes(final Consumer consumer) { + ShapedRecipeBuilder + .shapedRecipe(Items.COMPUTER.get()) + .patternLine("ICI") + .patternLine("XTX") + .patternLine("IBI") + .key('I', Tags.Items.INGOTS_IRON) + .key('C', Tags.Items.CHESTS_WOODEN) + .key('X', Items.BUS_INTERFACE.get()) + .key('T', Items.TRANSISTOR.get()) + .key('B', Items.CIRCUIT_BOARD.get()) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .addCriterion("has_circuit_board", inventoryChange(Items.CIRCUIT_BOARD.get())) + .build(consumer); + + ShapedRecipeBuilder + .shapedRecipe(Items.BUS_CABLE.get(), 16) + .patternLine("III") + .patternLine("GTG") + .patternLine("III") + .key('I', Tags.Items.INGOTS_IRON) + .key('G', Tags.Items.INGOTS_GOLD) + .key('T', Items.TRANSISTOR.get()) + .addCriterion("has_gold", inventoryChange(net.minecraft.item.Items.GOLD_INGOT)) + .build(consumer); + + ShapelessRecipeBuilder + .shapelessRecipe(Items.BUS_INTERFACE.get()) + .addIngredient(Items.TRANSISTOR.get()) + .addIngredient(Items.BUS_CABLE.get()) + .addCriterion("has_bus_cable", inventoryChange(Items.BUS_CABLE.get())) + .build(consumer); + + ShapedRecipeBuilder + .shapedRecipe(Items.NETWORK_CONNECTOR.get(), 4) + .patternLine("IGI") + .patternLine("ITI") + .key('I', Tags.Items.INGOTS_IRON) + .key('G', Tags.Items.GLASS) + .key('T', Items.TRANSISTOR.get()) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .build(consumer); + + ShapedRecipeBuilder + .shapedRecipe(Items.NETWORK_HUB.get()) + .patternLine("ICI") + .patternLine("XRX") + .patternLine("ICI") + .key('I', Tags.Items.INGOTS_IRON) + .key('C', Items.NETWORK_CONNECTOR.get()) + .key('R', net.minecraft.item.Items.REPEATER) + .key('X', Items.BUS_INTERFACE.get()) + .addCriterion("has_network_connector", inventoryChange(Items.NETWORK_CONNECTOR.get())) + .build(consumer); + + ShapedRecipeBuilder + .shapedRecipe(Items.REDSTONE_INTERFACE.get()) + .patternLine("IRI") + .patternLine("XTX") + .patternLine("IRI") + .key('I', Tags.Items.INGOTS_IRON) + .key('R', Tags.Items.DUSTS_REDSTONE) + .key('T', Items.TRANSISTOR.get()) + .key('X', Items.BUS_INTERFACE.get()) + .addCriterion("has_computer", inventoryChange(Items.COMPUTER.get())) + .build(consumer); + + ShapedRecipeBuilder + .shapedRecipe(Items.DISK_DRIVE.get()) + .patternLine("IBI") + .patternLine("XSX") + .patternLine("IDI") + .key('I', Tags.Items.INGOTS_IRON) + .key('B', ItemTags.BUTTONS) + .key('S', net.minecraft.item.Items.STICK) + .key('X', Items.BUS_INTERFACE.get()) + .key('D', net.minecraft.item.Items.DISPENSER) + .addCriterion("has_computer", inventoryChange(Items.COMPUTER.get())) + .build(consumer); + + ShapedRecipeBuilder + .shapedRecipe(Items.CHARGER.get()) + .patternLine("IPI") + .patternLine("XTX") + .patternLine("IRI") + .key('I', Tags.Items.INGOTS_IRON) + .key('P', net.minecraft.item.Items.LIGHT_WEIGHTED_PRESSURE_PLATE) + .key('T', Items.TRANSISTOR.get()) + .key('X', Items.BUS_INTERFACE.get()) + .key('R', Tags.Items.STORAGE_BLOCKS_REDSTONE) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .build(consumer); + + + ShapedRecipeBuilder + .shapedRecipe(Items.WRENCH.get()) + .patternLine("I I") + .patternLine(" T ") + .patternLine(" I ") + .key('I', Tags.Items.INGOTS_IRON) + .key('T', Items.TRANSISTOR.get()) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .build(consumer); + + + ShapedRecipeBuilder + .shapedRecipe(Items.NETWORK_CABLE.get(), 8) + .patternLine("SSS") + .patternLine("GTG") + .patternLine("SSS") + .key('S', Tags.Items.STRING) + .key('G', Tags.Items.GLASS) + .key('T', Items.TRANSISTOR.get()) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .build(consumer); + + // todo Robot + + // todo Memory + // todo HardDrive + // todo HardDrive - Linux + // todo FlashMemory + // todo FlashMemory - Linux + + ShapedRecipeBuilder + .shapedRecipe(Items.REDSTONE_INTERFACE_CARD.get()) + .patternLine("IRT") + .patternLine(" B ") + .key('I', Tags.Items.INGOTS_IRON) + .key('B', Items.CIRCUIT_BOARD.get()) + .key('T', Items.TRANSISTOR.get()) + .key('R', Tags.Items.DUSTS_REDSTONE) + .addCriterion("has_board", inventoryChange(Items.CIRCUIT_BOARD.get())) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .build(consumer); + + ShapedRecipeBuilder + .shapedRecipe(Items.NETWORK_INTERFACE_CARD.get()) + .patternLine("IRT") + .patternLine(" B ") + .key('I', Tags.Items.INGOTS_IRON) + .key('B', Items.CIRCUIT_BOARD.get()) + .key('T', Items.TRANSISTOR.get()) + .key('R', net.minecraft.item.Items.REPEATER) + .addCriterion("has_board", inventoryChange(Items.CIRCUIT_BOARD.get())) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .build(consumer); + + // todo Floppy + + + // todo InventoryOperationsModule + // todo BlockOperationsModule + + ShapedRecipeBuilder + .shapedRecipe(Items.TRANSISTOR.get(), 8) + .patternLine(" G ") + .patternLine("RPR") + .patternLine("III") + .key('I', Tags.Items.INGOTS_IRON) + .key('G', Tags.Items.INGOTS_GOLD) + .key('R', Tags.Items.DUSTS_REDSTONE) + .key('P', net.minecraft.item.Items.PAPER) + .addCriterion("has_gold", inventoryChange(net.minecraft.item.Items.GOLD_INGOT)) + .build(consumer); + + ShapelessRecipeBuilder + .shapelessRecipe(Items.CIRCUIT_BOARD.get(), 4) + .addIngredient(Tags.Items.INGOTS_GOLD) + .addIngredient(net.minecraft.item.Items.CLAY_BALL) + .addIngredient(Items.TRANSISTOR.get()) + .addCriterion("has_transistor", inventoryChange(Items.TRANSISTOR.get())) + .build(consumer); + + } + + private static InventoryChangeTrigger.Instance inventoryChange(final IItemProvider item) { + return InventoryChangeTrigger.Instance.forItems(item); + } +} diff --git a/src/main/resources/assets/oc2/lang/en_us.json b/src/main/resources/assets/oc2/lang/en_us.json index 75c8a107..e85dfc48 100644 --- a/src/main/resources/assets/oc2/lang/en_us.json +++ b/src/main/resources/assets/oc2/lang/en_us.json @@ -33,12 +33,8 @@ "item.oc2.block_operations_module": "Block Operations Module", "item.oc2.block_operations_module.desc": "Enables robots to break and place blocks.", - "item.oc2.control_unit": "Control Unit (CU)", - "item.oc2.arithmetic_logic_unit": "Arithmetic Logic Unit (ALU)", - "item.oc2.microchip": "Microchip", - "item.oc2.disk_platter": "Disk Platter", "item.oc2.transistor": "Transistor", - "item.oc2.pcb": "Printed Circuit Board (PCB)", + "item.oc2.circuit_board": "Circuit Board", "entity.oc2.robot": "Robot", diff --git a/src/main/resources/assets/oc2/models/item/arithmetic_logic_unit.json b/src/main/resources/assets/oc2/models/item/arithmetic_logic_unit.json deleted file mode 100644 index 4ea87bb6..00000000 --- a/src/main/resources/assets/oc2/models/item/arithmetic_logic_unit.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "oc2:items/arithmetic_logic_unit" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/oc2/models/item/pcb.json b/src/main/resources/assets/oc2/models/item/circuit_board.json similarity index 61% rename from src/main/resources/assets/oc2/models/item/pcb.json rename to src/main/resources/assets/oc2/models/item/circuit_board.json index 07888a0c..784d3d6d 100644 --- a/src/main/resources/assets/oc2/models/item/pcb.json +++ b/src/main/resources/assets/oc2/models/item/circuit_board.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "oc2:items/pcb" + "layer0": "oc2:item/circuit_board" } } \ No newline at end of file diff --git a/src/main/resources/assets/oc2/models/item/control_unit.json b/src/main/resources/assets/oc2/models/item/control_unit.json deleted file mode 100644 index 9837fbc6..00000000 --- a/src/main/resources/assets/oc2/models/item/control_unit.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "oc2:items/control_unit" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/oc2/models/item/disk_platter.json b/src/main/resources/assets/oc2/models/item/disk_platter.json deleted file mode 100644 index 4c18c534..00000000 --- a/src/main/resources/assets/oc2/models/item/disk_platter.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "oc2:items/disk_platter" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/oc2/models/item/microchip.json b/src/main/resources/assets/oc2/models/item/microchip.json deleted file mode 100644 index a9fe86e3..00000000 --- a/src/main/resources/assets/oc2/models/item/microchip.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "oc2:items/microchip" - } -} \ No newline at end of file diff --git a/src/main/resources/assets/oc2/models/item/network_connector.json b/src/main/resources/assets/oc2/models/item/network_connector.json index 43e30736..6e2dfe6e 100644 --- a/src/main/resources/assets/oc2/models/item/network_connector.json +++ b/src/main/resources/assets/oc2/models/item/network_connector.json @@ -8,7 +8,9 @@ 0 ], "translation": [ - 0, 2, 0 + 0, + 2, + 0 ], "scale": [ 0.75, diff --git a/src/main/resources/assets/oc2/models/item/transistor.json b/src/main/resources/assets/oc2/models/item/transistor.json index f41c713f..94a0f77d 100644 --- a/src/main/resources/assets/oc2/models/item/transistor.json +++ b/src/main/resources/assets/oc2/models/item/transistor.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "oc2:items/transistor" + "layer0": "oc2:item/transistor" } } \ No newline at end of file diff --git a/src/main/resources/assets/oc2/textures/item/arithmetic_logic_unit.png b/src/main/resources/assets/oc2/textures/item/arithmetic_logic_unit.png deleted file mode 100644 index 8a622399..00000000 Binary files a/src/main/resources/assets/oc2/textures/item/arithmetic_logic_unit.png and /dev/null differ diff --git a/src/main/resources/assets/oc2/textures/item/circuit_board.png b/src/main/resources/assets/oc2/textures/item/circuit_board.png new file mode 100644 index 00000000..645fbc76 Binary files /dev/null and b/src/main/resources/assets/oc2/textures/item/circuit_board.png differ diff --git a/src/main/resources/assets/oc2/textures/item/control_unit.png b/src/main/resources/assets/oc2/textures/item/control_unit.png deleted file mode 100644 index 172ab866..00000000 Binary files a/src/main/resources/assets/oc2/textures/item/control_unit.png and /dev/null differ diff --git a/src/main/resources/assets/oc2/textures/item/disk_platter.png b/src/main/resources/assets/oc2/textures/item/disk_platter.png deleted file mode 100644 index 09b989b9..00000000 Binary files a/src/main/resources/assets/oc2/textures/item/disk_platter.png and /dev/null differ diff --git a/src/main/resources/assets/oc2/textures/item/memory1.png b/src/main/resources/assets/oc2/textures/item/memory1.png index 53efb704..c471c167 100644 Binary files a/src/main/resources/assets/oc2/textures/item/memory1.png and b/src/main/resources/assets/oc2/textures/item/memory1.png differ diff --git a/src/main/resources/assets/oc2/textures/item/memory2.png b/src/main/resources/assets/oc2/textures/item/memory2.png index d1522c9b..7197a583 100644 Binary files a/src/main/resources/assets/oc2/textures/item/memory2.png and b/src/main/resources/assets/oc2/textures/item/memory2.png differ diff --git a/src/main/resources/assets/oc2/textures/item/memory3.png b/src/main/resources/assets/oc2/textures/item/memory3.png index 2a851fa2..95f4354c 100644 Binary files a/src/main/resources/assets/oc2/textures/item/memory3.png and b/src/main/resources/assets/oc2/textures/item/memory3.png differ diff --git a/src/main/resources/assets/oc2/textures/item/microchip.png b/src/main/resources/assets/oc2/textures/item/microchip.png deleted file mode 100644 index c726d51d..00000000 Binary files a/src/main/resources/assets/oc2/textures/item/microchip.png and /dev/null differ diff --git a/src/main/resources/assets/oc2/textures/item/network_interface_card.png b/src/main/resources/assets/oc2/textures/item/network_interface_card.png index 6a0df6f1..63249116 100644 Binary files a/src/main/resources/assets/oc2/textures/item/network_interface_card.png and b/src/main/resources/assets/oc2/textures/item/network_interface_card.png differ diff --git a/src/main/resources/assets/oc2/textures/item/pcb.png b/src/main/resources/assets/oc2/textures/item/pcb.png deleted file mode 100644 index 6d8b9260..00000000 Binary files a/src/main/resources/assets/oc2/textures/item/pcb.png and /dev/null differ diff --git a/src/main/resources/assets/oc2/textures/item/redstone_interface_card.png b/src/main/resources/assets/oc2/textures/item/redstone_interface_card.png index 922988e0..b8b13a79 100644 Binary files a/src/main/resources/assets/oc2/textures/item/redstone_interface_card.png and b/src/main/resources/assets/oc2/textures/item/redstone_interface_card.png differ diff --git a/src/main/resources/assets/oc2/textures/item/transistor.png b/src/main/resources/assets/oc2/textures/item/transistor.png index 32d017f4..54fc8885 100644 Binary files a/src/main/resources/assets/oc2/textures/item/transistor.png and b/src/main/resources/assets/oc2/textures/item/transistor.png differ diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/bus_cable.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/bus_cable.json new file mode 100644 index 00000000..757100c4 --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/bus_cable.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:bus_cable" + ] + }, + "criteria": { + "has_gold": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:gold_ingot" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:bus_cable" + } + } + }, + "requirements": [ + [ + "has_gold", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/bus_interface.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/bus_interface.json new file mode 100644 index 00000000..ec13a20b --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/bus_interface.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:bus_interface" + ] + }, + "criteria": { + "has_bus_cable": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:bus_cable" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:bus_interface" + } + } + }, + "requirements": [ + [ + "has_bus_cable", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/charger.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/charger.json new file mode 100644 index 00000000..1e1519dd --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/charger.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:charger" + ] + }, + "criteria": { + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:charger" + } + } + }, + "requirements": [ + [ + "has_transistor", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/circuit_board.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/circuit_board.json new file mode 100644 index 00000000..184e4f14 --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/circuit_board.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:circuit_board" + ] + }, + "criteria": { + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:circuit_board" + } + } + }, + "requirements": [ + [ + "has_transistor", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/computer.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/computer.json new file mode 100644 index 00000000..95b435a5 --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/computer.json @@ -0,0 +1,43 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:computer" + ] + }, + "criteria": { + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_circuit_board": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:circuit_board" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:computer" + } + } + }, + "requirements": [ + [ + "has_transistor", + "has_circuit_board", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/disk_drive.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/disk_drive.json new file mode 100644 index 00000000..ff72d88d --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/disk_drive.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:disk_drive" + ] + }, + "criteria": { + "has_computer": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:computer" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:disk_drive" + } + } + }, + "requirements": [ + [ + "has_computer", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_cable.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_cable.json new file mode 100644 index 00000000..423b2021 --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_cable.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:network_cable" + ] + }, + "criteria": { + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:network_cable" + } + } + }, + "requirements": [ + [ + "has_transistor", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_connector.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_connector.json new file mode 100644 index 00000000..6b88c20a --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_connector.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:network_connector" + ] + }, + "criteria": { + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:network_connector" + } + } + }, + "requirements": [ + [ + "has_transistor", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_hub.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_hub.json new file mode 100644 index 00000000..fc3a74f2 --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_hub.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:network_hub" + ] + }, + "criteria": { + "has_network_connector": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:network_connector" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:network_hub" + } + } + }, + "requirements": [ + [ + "has_network_connector", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_interface_card.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_interface_card.json new file mode 100644 index 00000000..60b0beba --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/network_interface_card.json @@ -0,0 +1,43 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:network_interface_card" + ] + }, + "criteria": { + "has_board": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:circuit_board" + } + ] + } + }, + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:network_interface_card" + } + } + }, + "requirements": [ + [ + "has_board", + "has_transistor", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/redstone_interface.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/redstone_interface.json new file mode 100644 index 00000000..9073e0fb --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/redstone_interface.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:redstone_interface" + ] + }, + "criteria": { + "has_computer": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:computer" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:redstone_interface" + } + } + }, + "requirements": [ + [ + "has_computer", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/redstone_interface_card.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/redstone_interface_card.json new file mode 100644 index 00000000..d6e77acd --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/redstone_interface_card.json @@ -0,0 +1,43 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:redstone_interface_card" + ] + }, + "criteria": { + "has_board": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:circuit_board" + } + ] + } + }, + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:redstone_interface_card" + } + } + }, + "requirements": [ + [ + "has_board", + "has_transistor", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/transistor.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/transistor.json new file mode 100644 index 00000000..d734f12a --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/transistor.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:transistor" + ] + }, + "criteria": { + "has_gold": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "minecraft:gold_ingot" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:transistor" + } + } + }, + "requirements": [ + [ + "has_gold", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/advancements/recipes/oc2.common/wrench.json b/src/main/resources/data/oc2/advancements/recipes/oc2.common/wrench.json new file mode 100644 index 00000000..dae904b9 --- /dev/null +++ b/src/main/resources/data/oc2/advancements/recipes/oc2.common/wrench.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "oc2:wrench" + ] + }, + "criteria": { + "has_transistor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "item": "oc2:transistor" + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "oc2:wrench" + } + } + }, + "requirements": [ + [ + "has_transistor", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/arithmetic_logic_unit.json b/src/main/resources/data/oc2/recipes/arithmetic_logic_unit.json deleted file mode 100644 index 39ec1b4c..00000000 --- a/src/main/resources/data/oc2/recipes/arithmetic_logic_unit.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "IRI", - "TMT", - "ITI" - ], - "key": { - "I": { - "item": "minecraft:iron_nugget" - }, - "T": { - "item": "oc2:transistor" - }, - "M": { - "item": "oc2:microchip" - }, - "R": { - "item": "minecraft:redstone" - } - }, - "result": { - "item": "oc2:arithmetic_logic_unit" - } -} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/bus_cable.json b/src/main/resources/data/oc2/recipes/bus_cable.json index 7f30f682..20b93005 100644 --- a/src/main/resources/data/oc2/recipes/bus_cable.json +++ b/src/main/resources/data/oc2/recipes/bus_cable.json @@ -1,20 +1,23 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "NNN", - "WWW", - "NNN" + "III", + "GTG", + "III" ], "key": { - "N": { - "item": "minecraft:gold_nugget" + "I": { + "tag": "forge:ingots/iron" }, - "W": { - "item": "oc2:network_cable" + "G": { + "tag": "forge:ingots/gold" + }, + "T": { + "item": "oc2:transistor" } }, "result": { "item": "oc2:bus_cable", - "count": 3 + "count": 16 } } \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/bus_interface.json b/src/main/resources/data/oc2/recipes/bus_interface.json index 7dd7c677..42b76523 100644 --- a/src/main/resources/data/oc2/recipes/bus_interface.json +++ b/src/main/resources/data/oc2/recipes/bus_interface.json @@ -1,18 +1,13 @@ { - "type": "minecraft:crafting_shaped", - "pattern": [ - "N ", - "NC ", - "N " - ], - "key": { - "N": { - "item": "minecraft:gold_nugget" + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "oc2:transistor" }, - "C": { + { "item": "oc2:bus_cable" } - }, + ], "result": { "item": "oc2:bus_interface" } diff --git a/src/main/resources/data/oc2/recipes/charger.json b/src/main/resources/data/oc2/recipes/charger.json new file mode 100644 index 00000000..4edc9706 --- /dev/null +++ b/src/main/resources/data/oc2/recipes/charger.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "IPI", + "XTX", + "IRI" + ], + "key": { + "I": { + "tag": "forge:ingots/iron" + }, + "P": { + "item": "minecraft:light_weighted_pressure_plate" + }, + "T": { + "item": "oc2:transistor" + }, + "X": { + "item": "oc2:bus_interface" + }, + "R": { + "tag": "forge:storage_blocks/redstone" + } + }, + "result": { + "item": "oc2:charger" + } +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/circuit_board.json b/src/main/resources/data/oc2/recipes/circuit_board.json new file mode 100644 index 00000000..01d25e41 --- /dev/null +++ b/src/main/resources/data/oc2/recipes/circuit_board.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "tag": "forge:ingots/gold" + }, + { + "item": "minecraft:clay_ball" + }, + { + "item": "oc2:transistor" + } + ], + "result": { + "item": "oc2:circuit_board", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/computer.json b/src/main/resources/data/oc2/recipes/computer.json index a95091cf..3a89117c 100644 --- a/src/main/resources/data/oc2/recipes/computer.json +++ b/src/main/resources/data/oc2/recipes/computer.json @@ -1,29 +1,28 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "IMI", - "BCB", - "IPI" + "ICI", + "XTX", + "IBI" ], "key": { "I": { - "item": "minecraft:gold_ingot" + "tag": "forge:ingots/iron" }, "C": { - "item": "minecraft:chest" + "tag": "forge:chests" }, - "M": { - "item": "oc2:microchip" + "X": { + "item": "oc2:bus_interface" }, - "P": { - "item": "oc2:pcb" + "T": { + "item": "oc2:transistor" }, "B": { - "item": "minecraft:iron_bars" + "item": "oc2:circuit_board" } }, "result": { - "item": "oc2:computer", - "count": 1 + "item": "oc2:computer" } } \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/control_unit.json b/src/main/resources/data/oc2/recipes/control_unit.json deleted file mode 100644 index 800c1ffd..00000000 --- a/src/main/resources/data/oc2/recipes/control_unit.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "IRI", - "TCT", - "ITI" - ], - "key": { - "I": { - "item": "minecraft:gold_nugget" - }, - "T": { - "item": "oc2:transistor" - }, - "C": { - "item": "minecraft:clock" - }, - "R": { - "item": "minecraft:redstone" - } - }, - "result": { - "item": "oc2:control_unit" - } -} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/disk_drive.json b/src/main/resources/data/oc2/recipes/disk_drive.json new file mode 100644 index 00000000..91e8ab78 --- /dev/null +++ b/src/main/resources/data/oc2/recipes/disk_drive.json @@ -0,0 +1,28 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "IBI", + "XSX", + "IDI" + ], + "key": { + "I": { + "tag": "forge:ingots/iron" + }, + "B": { + "tag": "minecraft:buttons" + }, + "S": { + "item": "minecraft:stick" + }, + "X": { + "item": "oc2:bus_interface" + }, + "D": { + "item": "minecraft:dispenser" + } + }, + "result": { + "item": "oc2:disk_drive" + } +} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/disk_platter.json b/src/main/resources/data/oc2/recipes/disk_platter.json deleted file mode 100644 index ffd02f0d..00000000 --- a/src/main/resources/data/oc2/recipes/disk_platter.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " N ", - "N N", - " N " - ], - "key": { - "N": { - "item": "minecraft:iron_nugget" - } - }, - "result": { - "item": "oc2:disk_platter" - } -} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/microchip.json b/src/main/resources/data/oc2/recipes/microchip.json deleted file mode 100644 index d0656d67..00000000 --- a/src/main/resources/data/oc2/recipes/microchip.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "III", - "RTR", - "III" - ], - "key": { - "I": { - "item": "minecraft:gold_nugget" - }, - "T": { - "item": "oc2:transistor" - }, - "R": { - "item": "minecraft:redstone" - } - }, - "result": { - "item": "oc2:microchip" - } -} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/network_cable.json b/src/main/resources/data/oc2/recipes/network_cable.json index 3a43fdf3..0e055728 100644 --- a/src/main/resources/data/oc2/recipes/network_cable.json +++ b/src/main/resources/data/oc2/recipes/network_cable.json @@ -2,19 +2,22 @@ "type": "minecraft:crafting_shaped", "pattern": [ "SSS", - "GGG", - " " + "GTG", + "SSS" ], "key": { "S": { - "item": "minecraft:string" + "tag": "forge:string" }, "G": { - "item": "minecraft:gold_nugget" + "tag": "forge:glass" + }, + "T": { + "item": "oc2:transistor" } }, "result": { "item": "oc2:network_cable", - "count": 6 + "count": 8 } } \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/network_connector.json b/src/main/resources/data/oc2/recipes/network_connector.json index 2db43f1c..ca133d31 100644 --- a/src/main/resources/data/oc2/recipes/network_connector.json +++ b/src/main/resources/data/oc2/recipes/network_connector.json @@ -1,20 +1,22 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - " ", - "NWN", - "NWN" + "IGI", + "ITI" ], "key": { - "N": { - "item": "minecraft:gold_nugget" + "I": { + "tag": "forge:ingots/iron" }, - "W": { - "item": "oc2:network_cable" + "G": { + "tag": "forge:glass" + }, + "T": { + "item": "oc2:transistor" } }, "result": { "item": "oc2:network_connector", - "count": 2 + "count": 4 } } \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/network_hub.json b/src/main/resources/data/oc2/recipes/network_hub.json index b348b17c..d5950cbf 100644 --- a/src/main/resources/data/oc2/recipes/network_hub.json +++ b/src/main/resources/data/oc2/recipes/network_hub.json @@ -1,16 +1,22 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "GGG", - "GCG", - "GGG" + "ICI", + "XRX", + "ICI" ], "key": { - "G": { - "item": "minecraft:gold_nugget" + "I": { + "tag": "forge:ingots/iron" }, "C": { - "item": "oc2:network_interface_card" + "item": "oc2:network_connector" + }, + "R": { + "item": "minecraft:repeater" + }, + "X": { + "item": "oc2:bus_interface" } }, "result": { diff --git a/src/main/resources/data/oc2/recipes/network_interface_card.json b/src/main/resources/data/oc2/recipes/network_interface_card.json index 002150bd..01031778 100644 --- a/src/main/resources/data/oc2/recipes/network_interface_card.json +++ b/src/main/resources/data/oc2/recipes/network_interface_card.json @@ -1,25 +1,21 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "POG", - "PC ", - "PI " + "IRT", + " B " ], "key": { "I": { - "item": "minecraft:gold_nugget" + "tag": "forge:ingots/iron" }, - "P": { - "item": "minecraft:iron_nugget" + "B": { + "item": "oc2:circuit_board" }, - "C": { - "item": "oc2:pcb" + "T": { + "item": "oc2:transistor" }, - "O": { - "item": "oc2:microchip" - }, - "G": { - "item": "oc2:network_cable" + "R": { + "item": "minecraft:repeater" } }, "result": { diff --git a/src/main/resources/data/oc2/recipes/pcb.json b/src/main/resources/data/oc2/recipes/pcb.json deleted file mode 100644 index 2494cce9..00000000 --- a/src/main/resources/data/oc2/recipes/pcb.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "minecraft:gold_nugget" - }, - [ - { - "item": "minecraft:slime_ball" - }, - { - "item": "minecraft:honey_bottle" - } - ], - [ - { - "item": "minecraft:kelp" - }, - { - "item": "minecraft:green_dye" - } - ] - ], - "result": { - "item": "oc2:pcb" - } -} \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/redstone_interface.json b/src/main/resources/data/oc2/recipes/redstone_interface.json index 5e41d0c8..0efb6c7a 100644 --- a/src/main/resources/data/oc2/recipes/redstone_interface.json +++ b/src/main/resources/data/oc2/recipes/redstone_interface.json @@ -1,16 +1,22 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "GGG", - "GCG", - "GGG" + "IRI", + "XTX", + "IRI" ], "key": { - "G": { - "item": "minecraft:gold_nugget" + "I": { + "tag": "forge:ingots/iron" }, - "C": { - "item": "oc2:redstone_interface_card" + "R": { + "tag": "forge:dusts/redstone" + }, + "T": { + "item": "oc2:transistor" + }, + "X": { + "item": "oc2:bus_interface" } }, "result": { diff --git a/src/main/resources/data/oc2/recipes/redstone_interface_card.json b/src/main/resources/data/oc2/recipes/redstone_interface_card.json index d2ee0578..1e420a1a 100644 --- a/src/main/resources/data/oc2/recipes/redstone_interface_card.json +++ b/src/main/resources/data/oc2/recipes/redstone_interface_card.json @@ -1,25 +1,21 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "POG", - "PC ", - "PI " + "IRT", + " B " ], "key": { "I": { - "item": "minecraft:gold_nugget" + "tag": "forge:ingots/iron" }, - "P": { - "item": "minecraft:iron_nugget" + "B": { + "item": "oc2:circuit_board" }, - "C": { - "item": "oc2:pcb" + "T": { + "item": "oc2:transistor" }, - "O": { - "item": "oc2:microchip" - }, - "G": { - "item": "minecraft:redstone_torch" + "R": { + "tag": "forge:dusts/redstone" } }, "result": { diff --git a/src/main/resources/data/oc2/recipes/transistor.json b/src/main/resources/data/oc2/recipes/transistor.json index 8072e972..98eea6e0 100644 --- a/src/main/resources/data/oc2/recipes/transistor.json +++ b/src/main/resources/data/oc2/recipes/transistor.json @@ -1,19 +1,19 @@ { "type": "minecraft:crafting_shaped", "pattern": [ - "III", - "GPG", - " R " + " G ", + "RPR", + "III" ], "key": { "I": { - "item": "minecraft:iron_ingot" + "tag": "forge:ingots/iron" }, "G": { - "item": "minecraft:gold_nugget" + "tag": "forge:ingots/gold" }, "R": { - "item": "minecraft:redstone" + "tag": "forge:dusts/redstone" }, "P": { "item": "minecraft:paper" @@ -21,6 +21,6 @@ }, "result": { "item": "oc2:transistor", - "count": 4 + "count": 8 } } \ No newline at end of file diff --git a/src/main/resources/data/oc2/recipes/wrench.json b/src/main/resources/data/oc2/recipes/wrench.json index 121712c4..6aaae7c9 100644 --- a/src/main/resources/data/oc2/recipes/wrench.json +++ b/src/main/resources/data/oc2/recipes/wrench.json @@ -2,15 +2,15 @@ "type": "minecraft:crafting_shaped", "pattern": [ "I I", - " C ", + " T ", " I " ], "key": { "I": { - "item": "minecraft:iron_ingot" + "tag": "forge:ingots/iron" }, - "C": { - "item": "oc2:microchip" + "T": { + "item": "oc2:transistor" } }, "result": {