diff --git a/build.gradle b/build.gradle index 37ad28a..bfaf579 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,8 @@ +//file:noinspection GradlePackageVersionRange plugins { - id 'fabric-loom' version '0.10-SNAPSHOT' + id 'fabric-loom' version '0.12-SNAPSHOT' id 'maven-publish' - id 'io.github.juuxel.loom-quiltflower-mini' version '1.2.1' + id 'io.github.juuxel.loom-quiltflower' version '1.7.1' } version = "${project.mod_version}+${project.minecraft_base_version}" @@ -42,13 +43,13 @@ dependencies { modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}" modLocalRuntime "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}" + modLocalRuntime "dev.architectury:architectury-fabric:4.10.86" + modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" modImplementation "io.wispforest:owo-lib:${project.owo_version}" include "io.wispforest:owo-sentinel:${project.owo_version}" - modCompileOnly ("maven.modrinth:lithium:${project.lithium_version}") - modImplementation 'com.ptsmods:devlogin:1.2.1' } diff --git a/gradle.properties b/gradle.properties index c85f46c..56c045a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,27 +1,24 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G # Fabric Properties -# check these on https://wispforest.io/versions -minecraft_base_version=1.18 +# check these on https://fabricmc.net/develop +minecraft_base_version=1.18.2 minecraft_version=1.18.2 -yarn_mappings=1.18.2+build.1 -loader_version=0.13.3 +yarn_mappings=1.18.2+build.4 +loader_version=0.14.10 # Mod Properties -mod_version=2.0.13 +mod_version=2.0.16 maven_group=wraith archives_base_name=wraith-alloy-forgery # Dependencies -fabric_version=0.47.8+1.18.2 +fabric_version=0.59.1+1.18.2 # https://maven.shedaniel.me/me/shedaniel/RoughlyEnoughItems-fabric/ -rei_version=8.0.438 +rei_version=8.3.561 # https://www.curseforge.com/minecraft/mc-mods/modmenu/files -modmenu_version=3.0.1 +modmenu_version=3.1.1 # https://maven.wispforest.io/io/wispforest/owo-lib -owo_version=0.7.2+1.18 - -# https://modrinth.com/mod/lithium -lithium_version=mc1.18.2-0.7.9 +owo_version=0.7.2-no-cme+1.18 diff --git a/settings.gradle b/settings.gradle index 64446d0..5b60df3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,9 +6,5 @@ pluginManagement { url = 'https://maven.fabricmc.net/' } gradlePluginPortal() - maven { - name = 'Cotton' - url = 'https://server.bbkr.space/artifactory/libs-release/' - } } } diff --git a/src/main/java/wraith/alloyforgery/AlloyForgeScreenHandler.java b/src/main/java/wraith/alloyforgery/AlloyForgeScreenHandler.java index ca9a08c..dd6ba4b 100644 --- a/src/main/java/wraith/alloyforgery/AlloyForgeScreenHandler.java +++ b/src/main/java/wraith/alloyforgery/AlloyForgeScreenHandler.java @@ -76,4 +76,8 @@ public int getLavaProgress() { public boolean canUse(PlayerEntity player) { return this.controllerInventory.canPlayerUse(player); } + + public Inventory getControllerInventory(){ + return this.controllerInventory; + } } diff --git a/src/main/java/wraith/alloyforgery/AlloyForgery.java b/src/main/java/wraith/alloyforgery/AlloyForgery.java index d1c8a75..271dcc8 100644 --- a/src/main/java/wraith/alloyforgery/AlloyForgery.java +++ b/src/main/java/wraith/alloyforgery/AlloyForgery.java @@ -5,10 +5,12 @@ import io.wispforest.owo.particles.ClientParticles; import io.wispforest.owo.particles.systems.ParticleSystem; import io.wispforest.owo.particles.systems.ParticleSystemController; +import io.wispforest.owo.util.OwoFreezer; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; -import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry; import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.particle.ParticleTypes; import net.minecraft.resource.ResourceType; @@ -18,6 +20,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.util.registry.Registry; import wraith.alloyforgery.block.ForgeControllerBlockEntity; +import wraith.alloyforgery.data.AlloyForgeryGlobalRemaindersLoader; import wraith.alloyforgery.forges.ForgeRegistry; import wraith.alloyforgery.forges.FuelDataLoader; import wraith.alloyforgery.recipe.AlloyForgeRecipe; @@ -29,7 +32,7 @@ public class AlloyForgery implements ModInitializer { public static final OwoItemGroup ALLOY_FORGERY_GROUP = new AlloyForgeryItemGroup(id("alloy_forgery")); - public static BlockEntityType FORGE_CONTROLLER_BLOCK_ENTITY; + public static BlockEntityType FORGE_CONTROLLER_BLOCK_ENTITY = ForgeControllerBlockEntity.Type.INSTANCE; public static ScreenHandlerType ALLOY_FORGE_SCREEN_HANDLER_TYPE; private static final ParticleSystemController CONTROLLER = new ParticleSystemController(id("particles")); @@ -46,23 +49,31 @@ public class AlloyForgery implements ModInitializer { facing.getOffsetX() * 0.65); }); - @Override @SuppressWarnings("UnstableApiUsage") + @Override public void onInitialize() { - ALLOY_FORGE_SCREEN_HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(id("alloy_forge"), AlloyForgeScreenHandler::new); + ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(new AlloyForgeryGlobalRemaindersLoader()); - ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(FuelDataLoader.INSTANCE); + ALLOY_FORGE_SCREEN_HANDLER_TYPE = Registry.register(Registry.SCREEN_HANDLER, id("alloy_forge"), new ScreenHandlerType<>(AlloyForgeScreenHandler::new)); + ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(FuelDataLoader.INSTANCE); ModDataLoader.load(ForgeRegistry.Loader.INSTANCE); - FORGE_CONTROLLER_BLOCK_ENTITY = ForgeControllerBlockEntity.Type.INSTANCE; Registry.register(Registry.BLOCK_ENTITY_TYPE, id("forge_controller"), FORGE_CONTROLLER_BLOCK_ENTITY); - FluidStorage.SIDED.registerSelf(FORGE_CONTROLLER_BLOCK_ENTITY); Registry.register(Registry.RECIPE_TYPE, AlloyForgeRecipe.Type.ID, AlloyForgeRecipe.Type.INSTANCE); Registry.register(Registry.RECIPE_SERIALIZER, AlloyForgeRecipe.Type.ID, AlloyForgeRecipeSerializer.INSTANCE); ALLOY_FORGERY_GROUP.initialize(); + + ItemStorage.SIDED.registerFallback((world, pos, state, blockEntity, context) -> { + if (context == Direction.DOWN && world.getBlockEntity(pos.up()) instanceof ForgeControllerBlockEntity froge) + return InventoryStorage.of(froge, Direction.DOWN); + + return null; + }); + + OwoFreezer.registerFreezeCallback(() -> FluidStorage.SIDED.registerSelf(AlloyForgery.FORGE_CONTROLLER_BLOCK_ENTITY)); } public static Identifier id(String path) { diff --git a/src/main/java/wraith/alloyforgery/block/ForgeControllerBlock.java b/src/main/java/wraith/alloyforgery/block/ForgeControllerBlock.java index 81d175c..41e52ca 100644 --- a/src/main/java/wraith/alloyforgery/block/ForgeControllerBlock.java +++ b/src/main/java/wraith/alloyforgery/block/ForgeControllerBlock.java @@ -14,6 +14,7 @@ import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.DirectionProperty; import net.minecraft.state.property.Properties; +import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; @@ -58,6 +59,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt controller.addFuel(fuelDefinition.fuel()); } else { if (!controller.verifyMultiblock()) { + player.sendMessage(new TranslatableText("message.alloy_forgery.invalid_multiblock").formatted(Formatting.GRAY), true); return ActionResult.SUCCESS; } diff --git a/src/main/java/wraith/alloyforgery/block/ForgeControllerBlockEntity.java b/src/main/java/wraith/alloyforgery/block/ForgeControllerBlockEntity.java index 75e270c..9939198 100644 --- a/src/main/java/wraith/alloyforgery/block/ForgeControllerBlockEntity.java +++ b/src/main/java/wraith/alloyforgery/block/ForgeControllerBlockEntity.java @@ -13,6 +13,7 @@ import net.minecraft.block.Blocks; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.block.entity.HopperBlockEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.fluid.Fluids; @@ -23,8 +24,11 @@ import net.minecraft.screen.NamedScreenHandlerFactory; import net.minecraft.screen.PropertyDelegate; import net.minecraft.screen.ScreenHandler; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; +import net.minecraft.util.ItemScatterer; import net.minecraft.util.collection.DefaultedList; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; @@ -35,10 +39,12 @@ import wraith.alloyforgery.forges.ForgeDefinition; import wraith.alloyforgery.forges.ForgeFuelRegistry; import wraith.alloyforgery.forges.ForgeRegistry; -import wraith.alloyforgery.forges.UnifiedInventoryView; +import wraith.alloyforgery.mixin.HopperBlockEntityAccessor; import wraith.alloyforgery.recipe.AlloyForgeRecipe; -import java.util.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; @SuppressWarnings("UnstableApiUsage") public class ForgeControllerBlockEntity extends BlockEntity implements ImplementedInventory, SidedInventory, NamedScreenHandlerFactory, InsertionOnlyStorage { @@ -50,7 +56,6 @@ public class ForgeControllerBlockEntity extends BlockEntity implements Implement public static final int INVENTORY_SIZE = 12; private final DefaultedList items = DefaultedList.ofSize(INVENTORY_SIZE, ItemStack.EMPTY); - private final UnifiedInventoryView unifiedView; private final FluidHolder fluidHolder = new FluidHolder(); @@ -58,7 +63,7 @@ public class ForgeControllerBlockEntity extends BlockEntity implements Implement private final ImmutableList multiblockPositions; private final Direction facing; - private int fuel; + private float fuel; private int currentSmeltTime; private int smeltProgress; @@ -71,8 +76,6 @@ public ForgeControllerBlockEntity(BlockPos pos, BlockState state) { facing = state.get(ForgeControllerBlock.FACING); multiblockPositions = generateMultiblockPositions(pos.toImmutable(), state.get(ForgeControllerBlock.FACING)); - - unifiedView = new UnifiedInventoryView(this, 0, 9); } private final PropertyDelegate properties = new PropertyDelegate() { @@ -86,7 +89,8 @@ public int get(int index) { } @Override - public void set(int index, int value) {} + public void set(int index, int value) { + } @Override public int size() { @@ -97,7 +101,6 @@ public int size() { @Override public void readNbt(NbtCompound nbt) { Inventories.readNbt(nbt, items); - unifiedView.markDirty(); this.currentSmeltTime = nbt.getInt("CurrentSmeltTime"); this.fuel = nbt.getInt("Fuel"); @@ -111,7 +114,7 @@ public void readNbt(NbtCompound nbt) { public void writeNbt(NbtCompound nbt) { Inventories.writeNbt(nbt, items); - nbt.putInt("Fuel", fuel); + nbt.putInt("Fuel", Math.round(fuel)); nbt.putInt("CurrentSmeltTime", currentSmeltTime); final var fluidNbt = new NbtCompound(); @@ -120,21 +123,11 @@ public void writeNbt(NbtCompound nbt) { nbt.put("FuelFluidInput", fluidNbt); } - @Override - public void markDirty() { - unifiedView.markDirty(); - super.markDirty(); - } - @Override public DefaultedList getItems() { return items; } - public UnifiedInventoryView asUnifiedView(){ - return this.unifiedView; - } - public ItemStack getFuelStack() { return getStack(11); } @@ -187,8 +180,7 @@ public void tick() { } if (this.fluidHolder.amount >= 81) { - final long fuelInsertAmount = Math.min((this.fluidHolder.amount / 81) * 24, - ((this.forgeDefinition.fuelCapacity() - this.fuel) / 24) * 24); + final float fuelInsertAmount = Math.min((this.fluidHolder.amount / 81f) * 24, ((this.forgeDefinition.fuelCapacity() - this.fuel) / 24) * 24); this.fuel += fuelInsertAmount; this.fluidHolder.amount -= (fuelInsertAmount / 24) * 81; @@ -201,7 +193,7 @@ public void tick() { this.world.setBlockState(pos, currentBlockState.with(ForgeControllerBlock.LIT, false)); } - if(!this.unifiedView.isUnifiedInvEmpty()){ + if (!this.isEmpty()) { final var recipeOptional = world.getRecipeManager().getFirstMatch(AlloyForgeRecipe.Type.INSTANCE, this, world); if (recipeOptional.isEmpty()) { @@ -229,14 +221,18 @@ public void tick() { return; } - this.currentSmeltTime += forgeDefinition.speedMultiplier(); + this.currentSmeltTime++; this.fuel -= fuelRequirement; if (world.random.nextDouble() > 0.75) { AlloyForgery.FORGE_PARTICLES.spawn(world, Vec3d.of(pos), facing); } } else { - recipe.consumeNeededIngredients(this); + var remainderList = recipe.attemptToGetRemainders(this); + + recipe.craft(this); + + if(remainderList != null) this.handleForgingRemainders(remainderList); if (outputStack.isEmpty()) { this.setStack(10, recipeOutput); @@ -245,14 +241,104 @@ public void tick() { } this.currentSmeltTime = 0; - this.unifiedView.markDirty(); } } - }else{ + } else { this.currentSmeltTime = 0; } } + public void handleForgingRemainders(DefaultedList remainderList) { + for (int i = 0; i < remainderList.size(); ++i) { + var inputStack = this.getStack(i); + var remainderStack = remainderList.get(i); + + if (!remainderStack.isEmpty()) { + if (inputStack.isEmpty()) { + this.setStack(i, remainderStack); + } else if (ItemStack.areItemsEqualIgnoreDamage(inputStack, remainderStack) && ItemStack.areNbtEqual(inputStack, remainderStack)) { + remainderStack.increment(inputStack.getCount()); + + if (remainderStack.getCount() > remainderStack.getMaxCount()) { + int excess = remainderStack.getCount() - remainderStack.getMaxCount(); + remainderStack.decrement(excess); + + var insertStack = remainderStack.copy(); + insertStack.setCount(excess); + + if(!attemptToInsertIntoHopper(insertStack)){ + var frontForgePos = pos.offset(getCachedState().get(ForgeControllerBlock.FACING)); + + world.playSound(null, frontForgePos.getX(), frontForgePos.getY(), frontForgePos.getZ(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.BLOCKS, 1.0F, 0.2F); + + ItemScatterer.spawn(world, frontForgePos.getX(), frontForgePos.getY(), frontForgePos.getZ(), insertStack); + } + } + + this.setStack(i, remainderStack); + } else { + if(!attemptToInsertIntoHopper(remainderStack)){ + var frontForgePos = pos.offset(getCachedState().get(ForgeControllerBlock.FACING)); + + world.playSound(null, frontForgePos.getX(), frontForgePos.getY(), frontForgePos.getZ(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.BLOCKS, 1.0F, 0.2F); + + ItemScatterer.spawn(world, frontForgePos.getX(), frontForgePos.getY(), frontForgePos.getZ(), remainderStack); + } + } + } + } + } + + @SuppressWarnings("BooleanMethodIsAlwaysInverted") + public boolean attemptToInsertIntoHopper(ItemStack remainderStack){ + if (remainderStack.isEmpty()) return true; + + HopperBlockEntity blockEntity = null; + + for (int y = 1; y <= 2; y++) { + if (world.getBlockEntity(this.pos.down(y)) instanceof HopperBlockEntity hopperBlockEntity) { + blockEntity = hopperBlockEntity; + + break; + } + } + + if (blockEntity != null) { + var isHopperEmpty = blockEntity.isEmpty(); + + for (int slotIndex = 0; slotIndex < blockEntity.size(); ++slotIndex) { + if (remainderStack.isEmpty()) break; + + if (!blockEntity.getStack(slotIndex).isEmpty()) { + final var itemStack = blockEntity.getStack(slotIndex).copy(); + + if (itemStack.isEmpty()) { + blockEntity.setStack(slotIndex, remainderStack); + remainderStack = ItemStack.EMPTY; + } else if (ItemOps.canStack(itemStack, remainderStack)) { + int availableSpace = itemStack.getMaxCount() - itemStack.getCount(); + int j = Math.min(itemStack.getCount(), availableSpace); + remainderStack.decrement(j); + itemStack.increment(j); + } + } else { + blockEntity.setStack(slotIndex, remainderStack); + break; + } + } + + if (isHopperEmpty && !((HopperBlockEntityAccessor)blockEntity).alloyForge$isDisabled()) { + ((HopperBlockEntityAccessor)blockEntity).alloyForge$setTransferCooldown(8); + } + + blockEntity.markDirty(); + + return true; + } + + return false; + } + @SuppressWarnings("BooleanMethodIsAlwaysInverted") public boolean verifyMultiblock() { final BlockState belowController = world.getBlockState(multiblockPositions.get(0)); @@ -330,7 +416,7 @@ public long insert(FluidVariant resource, long maxAmount, TransactionContext tra } @Override - public Iterator> iterator(TransactionContext transaction) { + public Iterator> iterator(TransactionContext transaction) { return this.fluidHolder.iterator(transaction); } diff --git a/src/main/java/wraith/alloyforgery/client/AlloyForgeScreen.java b/src/main/java/wraith/alloyforgery/client/AlloyForgeScreen.java index 1b407bd..1275fa6 100644 --- a/src/main/java/wraith/alloyforgery/client/AlloyForgeScreen.java +++ b/src/main/java/wraith/alloyforgery/client/AlloyForgeScreen.java @@ -13,6 +13,8 @@ public class AlloyForgeScreen extends HandledScreen { + public static int blockAtlasWidth = 0, blockAtlasHeight = 0; + private static final Identifier TEXTURE = AlloyForgery.id("textures/gui/forge_controller.png"); private final SpriteIdentifier lavaSpriteId = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, new Identifier("block/lava_still")); @@ -45,11 +47,11 @@ protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int final var fullFrames = this.handler.getLavaProgress() / 16; for (int i = 0; i < fullFrames; i++) { drawTexture(matrices, this.x + 63 + i * 16, this.y + 4, lavaSprite.getX(), lavaSprite.getY() + 2, - 16, 10, 1024, 1024); + 16, 10, blockAtlasWidth, blockAtlasHeight); } drawTexture(matrices, this.x + 63 + fullFrames * 16, this.y + 4, lavaSprite.getX(), lavaSprite.getY() + 2, - (this.handler.getLavaProgress() - fullFrames * 16), 10, 1024, 1024); + (this.handler.getLavaProgress() - fullFrames * 16), 10, blockAtlasWidth, blockAtlasHeight); } public int rootX() { diff --git a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryPlugin.java b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryClientPlugin.java similarity index 95% rename from src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryPlugin.java rename to src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryClientPlugin.java index 00fe3cb..e69ec5e 100644 --- a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryPlugin.java +++ b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryClientPlugin.java @@ -10,7 +10,7 @@ import wraith.alloyforgery.forges.ForgeRegistry; import wraith.alloyforgery.recipe.AlloyForgeRecipe; -public class AlloyForgeryPlugin implements REIClientPlugin { +public class AlloyForgeryClientPlugin implements REIClientPlugin { @Override public void registerCategories(CategoryRegistry registry) { diff --git a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryCommonPlugin.java b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryCommonPlugin.java new file mode 100644 index 0000000..62fdf7c --- /dev/null +++ b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryCommonPlugin.java @@ -0,0 +1,20 @@ +package wraith.alloyforgery.compat.rei; + +import me.shedaniel.rei.api.common.display.DisplaySerializerRegistry; +import me.shedaniel.rei.api.common.plugins.REIServerPlugin; +import me.shedaniel.rei.api.common.transfer.info.MenuInfoRegistry; +import me.shedaniel.rei.api.common.transfer.info.simple.SimpleMenuInfoProvider; +import wraith.alloyforgery.AlloyForgeScreenHandler; + +public class AlloyForgeryCommonPlugin implements REIServerPlugin { + + @Override + public void registerMenuInfo(MenuInfoRegistry registry) { + registry.register(AlloyForgingCategory.ID, AlloyForgeScreenHandler.class, SimpleMenuInfoProvider.of(AlloyForgeryMenuInfo::new)); + } + + @Override + public void registerDisplaySerializer(DisplaySerializerRegistry registry) { + registry.register(AlloyForgingCategory.ID, AlloyForgingDisplay.Serializer.INSTANCE); + } +} diff --git a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryMenuInfo.java b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryMenuInfo.java new file mode 100644 index 0000000..ce51efa --- /dev/null +++ b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgeryMenuInfo.java @@ -0,0 +1,42 @@ +package wraith.alloyforgery.compat.rei; + +import me.shedaniel.rei.api.common.transfer.info.MenuInfoContext; +import me.shedaniel.rei.api.common.transfer.info.clean.InputCleanHandler; +import me.shedaniel.rei.api.common.transfer.info.simple.SimplePlayerInventoryMenuInfo; +import me.shedaniel.rei.api.common.transfer.info.stack.SlotAccessor; +import net.minecraft.inventory.Inventory; +import wraith.alloyforgery.AlloyForgeScreenHandler; + +import java.util.ArrayList; +import java.util.List; + +public record AlloyForgeryMenuInfo(AlloyForgingDisplay display) implements SimplePlayerInventoryMenuInfo { + + @Override + public Iterable getInputSlots(MenuInfoContext context) { + Inventory inventory = context.getMenu().getControllerInventory(); + + List list = new ArrayList<>(inventory.size() - 2); + for (int i = 0; i < inventory.size() - 2; i++) { + list.add(SlotAccessor.fromContainer(inventory, i)); + } + + return list; + } + + @Override + public AlloyForgingDisplay getDisplay() { + return this.display; + } + + @Override + public InputCleanHandler getInputCleanHandler() { + return context -> { + for (SlotAccessor gridStack : getInputSlots(context)) { + InputCleanHandler.returnSlotsToPlayerInventory(context, getDumpHandler(), gridStack); + } + + clearInputSlots(context.getMenu()); + }; + } +} diff --git a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingCategory.java b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingCategory.java index d5ac807..25ba6ec 100644 --- a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingCategory.java +++ b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingCategory.java @@ -2,6 +2,7 @@ import me.shedaniel.math.Point; import me.shedaniel.math.Rectangle; +import me.shedaniel.rei.api.client.REIRuntime; import me.shedaniel.rei.api.client.gui.Renderer; import me.shedaniel.rei.api.client.gui.widgets.Widget; import me.shedaniel.rei.api.client.gui.widgets.Widgets; @@ -24,6 +25,7 @@ public class AlloyForgingCategory implements DisplayCategory { final Identifier GUI_TEXTURE = AlloyForgery.id("textures/gui/forge_controller.png"); + final Identifier DARK_GUI_TEXTURE = AlloyForgery.id("textures/gui/forge_controller_dark.png"); public static final CategoryIdentifier ID = CategoryIdentifier.of(AlloyForgery.id("forging")); @@ -47,16 +49,17 @@ public List setupDisplay(AlloyForgingDisplay display, Rectangle bounds) Point origin = bounds.getLocation(); final var widgets = new ArrayList(); + final var texture = REIRuntime.getInstance().isDarkThemeEnabled() ? DARK_GUI_TEXTURE : GUI_TEXTURE; widgets.add(Widgets.createRecipeBase(bounds)); - widgets.add(Widgets.createTexturedWidget(GUI_TEXTURE, origin.x + 10, origin.y + 18, 42, 21, 124, 58)); - widgets.add(Widgets.createTexturedWidget(GUI_TEXTURE, origin.x + 115, origin.y + 21, 176, 0, 15, 19)); + widgets.add(Widgets.createTexturedWidget(texture, origin.x + 10, origin.y + 18, 42, 21, 124, 58)); + widgets.add(Widgets.createTexturedWidget(texture, origin.x + 115, origin.y + 21, 176, 0, 15, 19)); for (int i = 0; i < display.getInputEntries().size(); i++) { final var slotLocation = new Point(origin.x + 12 + i % 5 * 18, origin.y + 40 + (i > 4 ? 1 : 0) * 18); widgets.add(Widgets.createSlot(slotLocation).entries(display.getInputEntries().get(i)).markInput().disableBackground()); - widgets.add(Widgets.createTexturedWidget(GUI_TEXTURE, slotLocation.x - 1, slotLocation.y - 1, 208, 0, 18, 18)); + widgets.add(Widgets.createTexturedWidget(texture, slotLocation.x - 1, slotLocation.y - 1, 208, 0, 18, 18)); } final var resultSlot = Widgets.createSlot(new Point(origin.x + 113, origin.y + 47)); diff --git a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingDisplay.java b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingDisplay.java index 260539d..0370157 100644 --- a/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingDisplay.java +++ b/src/main/java/wraith/alloyforgery/compat/rei/AlloyForgingDisplay.java @@ -1,15 +1,20 @@ package wraith.alloyforgery.compat.rei; +import com.google.common.collect.ImmutableMap; import me.shedaniel.rei.api.common.category.CategoryIdentifier; import me.shedaniel.rei.api.common.display.Display; +import me.shedaniel.rei.api.common.display.DisplaySerializer; import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.util.EntryIngredients; +import net.fabricmc.fabric.api.util.NbtType; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtHelper; +import net.minecraft.nbt.NbtList; +import net.minecraft.recipe.Ingredient; import wraith.alloyforgery.recipe.AlloyForgeRecipe; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; public class AlloyForgingDisplay implements Display { @@ -22,7 +27,23 @@ public class AlloyForgingDisplay implements Display { public final Map overrides; public AlloyForgingDisplay(AlloyForgeRecipe recipe) { - this.inputs = recipe.getIngredients().stream().map(EntryIngredients::ofIngredient).toList(); + List convertedInputs = new ArrayList<>(); + + for (Map.Entry entry : recipe.getIngredientsMap().entrySet()) { + for (int i = entry.getValue(); i > 0; ) { + int stackCount = Math.min(i, 64); + + convertedInputs.add( + EntryIngredients.ofItemStacks(Arrays.stream(entry.getKey().getMatchingStacks()) + .map(ItemStack::copy) + .peek(stack -> stack.setCount(stackCount)) + .toList())); + + i -= stackCount; + } + } + + this.inputs = convertedInputs; this.output = EntryIngredients.of(recipe.getOutput()); this.minForgeTier = recipe.getMinForgeTier(); @@ -31,6 +52,16 @@ public AlloyForgingDisplay(AlloyForgeRecipe recipe) { this.overrides = recipe.getTierOverrides(); } + public AlloyForgingDisplay(List inputs, EntryIngredient output, int minForgeTier, int requiredFuel, Map overrides) { + this.inputs = inputs; + this.output = output; + + this.minForgeTier = minForgeTier; + this.requiredFuel = requiredFuel; + + this.overrides = overrides; + } + @Override public List getInputEntries() { return inputs; @@ -45,4 +76,69 @@ public List getOutputEntries() { public CategoryIdentifier getCategoryIdentifier() { return AlloyForgingCategory.ID; } + + public enum Serializer implements DisplaySerializer { + + INSTANCE; + + @Override + public NbtCompound save(NbtCompound tag, AlloyForgingDisplay display) { + // Store the fuel per tick + tag.putInt("fuel_per_tick", display.requiredFuel); + + // Save the minimum Forge Tier + tag.putInt("min_forge_tier", display.minForgeTier); + + // Store the recipe inputs + NbtList inputs = new NbtList(); + inputs.addAll(display.inputs.stream().map(EntryIngredient::save).toList()); + tag.put("inputs", inputs); + + // Store the recipe output + tag.put("output", display.output.save()); + + NbtList overrides = new NbtList(); + display.overrides.forEach((overrideRange, itemStack) -> { + NbtCompound overrideTag = new NbtCompound(); + + overrideTag.putInt("lower", overrideRange.lowerBound()); + overrideTag.putInt("upper", overrideRange.upperBound()); + overrideTag.put("stack", itemStack.getOrCreateNbt()); + + overrides.add(overrideTag); + }); + tag.put("overrides", overrides); + + return tag; + } + + @Override + public AlloyForgingDisplay read(NbtCompound tag) { + // Get the fuel per tick + int requiredFuel = tag.getInt("fuel_per_tick"); + + // Get the minimum Forge Tier + int minForgeTier = tag.getInt("fuel_per_tick"); + + // We get a list of all the recipe inputs + List input = new ArrayList<>(); + tag.getList("inputs", NbtType.LIST).forEach(nbtElement -> input.add(EntryIngredient.read((NbtList) nbtElement))); + + // We get the single recipe output + EntryIngredient output = EntryIngredient.read(tag.getList("output", NbtType.LIST)); + + // Last thing we grab is the recipes Override Range Values + ImmutableMap.Builder builder = new ImmutableMap.Builder<>(); + tag.getList("overrides", NbtType.COMPOUND).forEach(nbtElement -> { + NbtCompound overrideTag = (NbtCompound) nbtElement; + + AlloyForgeRecipe.OverrideRange range = new AlloyForgeRecipe.OverrideRange(overrideTag.getInt("lower"), overrideTag.getInt("upper")); + ItemStack stack = ItemStack.fromNbt(overrideTag.getCompound("stack")); + + builder.put(range, stack); + }); + + return new AlloyForgingDisplay(input, output, minForgeTier, requiredFuel, builder.build()); + } + } } diff --git a/src/main/java/wraith/alloyforgery/data/AlloyForgeryGlobalRemaindersLoader.java b/src/main/java/wraith/alloyforgery/data/AlloyForgeryGlobalRemaindersLoader.java new file mode 100644 index 0000000..6fe147a --- /dev/null +++ b/src/main/java/wraith/alloyforgery/data/AlloyForgeryGlobalRemaindersLoader.java @@ -0,0 +1,68 @@ +package wraith.alloyforgery.data; + +import com.google.gson.*; +import com.mojang.logging.LogUtils; +import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.recipe.ShapedRecipe; +import net.minecraft.resource.JsonDataLoader; +import net.minecraft.resource.ResourceManager; +import net.minecraft.util.Identifier; +import net.minecraft.util.JsonHelper; +import net.minecraft.util.profiler.Profiler; +import org.slf4j.Logger; +import wraith.alloyforgery.AlloyForgery; +import wraith.alloyforgery.recipe.AlloyForgeRecipe; + +import java.util.HashMap; +import java.util.Map; + +public class AlloyForgeryGlobalRemaindersLoader extends JsonDataLoader implements IdentifiableResourceReloadListener { + + private static final Logger LOGGER = LogUtils.getLogger(); + + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); + + public AlloyForgeryGlobalRemaindersLoader() { + super(GSON, "forge_remainder"); + } + + @Override + protected void apply(Map prepared, ResourceManager manager, Profiler profiler) { + prepared.forEach((identifier, jsonElement) -> { + try { + if(jsonElement instanceof JsonObject jsonObject){ + if(!jsonObject.has("remainders")){ + throw new JsonSyntaxException("The Global Remainders file seems to be missing the needed remainders field."); + } + + var remainders = new HashMap(); + + for (var remainderEntry : jsonObject.getAsJsonObject("remainders").entrySet()) { + var item = JsonHelper.asItem(new JsonPrimitive(remainderEntry.getKey()), remainderEntry.getKey()); + + if (remainderEntry.getValue().isJsonObject()) { + var remainderStack = ShapedRecipe.outputFromJson(remainderEntry.getValue().getAsJsonObject()); + remainders.put(item, remainderStack); + } else { + var remainderItem = JsonHelper.asItem(remainderEntry.getValue(), "item"); + remainders.put(item, new ItemStack(remainderItem)); + } + } + + AlloyForgeRecipe.addRemainders(remainders); + } else { + throw new JsonSyntaxException("JsonElement wasn't a JsonObject meaning it is malformed"); + } + } catch (IllegalArgumentException | JsonParseException exception) { + LOGGER.error("[AlloyForgerRemainders]: Parsing error loading recipe {}", identifier, exception); + } + }); + } + + @Override + public Identifier getFabricId() { + return new Identifier(AlloyForgery.MOD_ID, "forge_remainder"); + } +} diff --git a/src/main/java/wraith/alloyforgery/forges/ForgeDefinition.java b/src/main/java/wraith/alloyforgery/forges/ForgeDefinition.java index b9df68d..2662a20 100644 --- a/src/main/java/wraith/alloyforgery/forges/ForgeDefinition.java +++ b/src/main/java/wraith/alloyforgery/forges/ForgeDefinition.java @@ -5,11 +5,13 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.wispforest.owo.registration.ComplexRegistryAction; -import io.wispforest.owo.util.ModCompatHelpers; +import io.wispforest.owo.registration.RegistryHelper; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidStorage; import net.minecraft.block.Block; import net.minecraft.util.Identifier; import net.minecraft.util.JsonHelper; import net.minecraft.util.registry.Registry; +import wraith.alloyforgery.AlloyForgery; import java.util.ArrayList; @@ -50,6 +52,7 @@ private ForgeDefinition(int forgeTier, float speedMultiplier, int fuelCapacity, this(forgeTier, speedMultiplier, fuelCapacity, (int) (BASE_MAX_SMELT_TIME / speedMultiplier), material, additionalMaterials); } + @SuppressWarnings("UnstableApiUsage") public static void loadAndEnqueue(Identifier id, JsonObject json) { final int forgeTier = JsonHelper.getInt(json, "tier"); @@ -69,10 +72,9 @@ public static void loadAndEnqueue(Identifier id, JsonObject json) { final var definition = new ForgeDefinition(forgeTier, speedMultiplier, fuelCapacity, mainMaterial, additionalMaterialsBuilder.build()); ForgeRegistry.registerDefinition(id, definition); - }).entry(mainMaterialId).entries(additionalMaterialIds).build(); - ModCompatHelpers.getRegistryHelper(Registry.BLOCK).runWhenPresent(action); + RegistryHelper.get(Registry.BLOCK).runWhenPresent(action); } public boolean isBlockValid(Block block) { diff --git a/src/main/java/wraith/alloyforgery/forges/ForgeRegistry.java b/src/main/java/wraith/alloyforgery/forges/ForgeRegistry.java index a305553..50f730c 100644 --- a/src/main/java/wraith/alloyforgery/forges/ForgeRegistry.java +++ b/src/main/java/wraith/alloyforgery/forges/ForgeRegistry.java @@ -32,7 +32,7 @@ static void registerDefinition(Identifier forgeDefinitionId, ForgeDefinition def Registry.register(Registry.BLOCK, controllerBlockRegistryId, controllerBlock); Registry.register(Registry.ITEM, controllerBlockRegistryId, new ForgeControllerItem(controllerBlock, new Item.Settings().group(AlloyForgery.ALLOY_FORGERY_GROUP))); - TagInjector.injectBlocks(MINEABLE_PICKAXE, controllerBlock); + TagInjector.inject(Registry.BLOCK, MINEABLE_PICKAXE, controllerBlock); store(forgeDefinitionId, definition, controllerBlock); } @@ -67,7 +67,8 @@ public static final class Loader implements ModDataConsumer { public static final Loader INSTANCE = new Loader(); - private Loader() {} + private Loader() { + } @Override public String getDataSubdirectory() { diff --git a/src/main/java/wraith/alloyforgery/forges/UnifiedInventoryView.java b/src/main/java/wraith/alloyforgery/forges/UnifiedInventoryView.java deleted file mode 100644 index db17073..0000000 --- a/src/main/java/wraith/alloyforgery/forges/UnifiedInventoryView.java +++ /dev/null @@ -1,148 +0,0 @@ -package wraith.alloyforgery.forges; - -import net.minecraft.inventory.Inventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; - -import java.util.HashMap; -import java.util.Map; - -/** - * A way to view an {@link Inventory} as a slot-less representation of the items within the said inventory. - *

This ignores NBT data and only the base {@link Item} of a stack will be stored and compared against

- */ -public class UnifiedInventoryView { - - private final Inventory mainInventory; - - private final int beginIndex; - private final int endIndex; - - private final Map unifiedInv = new HashMap<>(); - - private boolean isDirty = false; - - public UnifiedInventoryView(Inventory inventory) { - this(inventory, 0, inventory.size() - 1); - } - - /** - * Note: The given begin and end Indices are just to tell the code what slots it can view from within the {@link #mainInventory} - */ - public UnifiedInventoryView(Inventory inventory, int beginIndex, int endIndex) { - this.mainInventory = inventory; - - if (!(beginIndex < inventory.size() && beginIndex >= 0)) - throw new IndexOutOfBoundsException("The Beginning Index is out of Bounds for the given Inventory!"); - else if (!(endIndex < inventory.size() && endIndex >= 0)) - throw new IndexOutOfBoundsException("The Ending Index is out of Bounds for the given Inventory!"); - else if (beginIndex > endIndex) - throw new IndexOutOfBoundsException("The beginning index must be less than the ending index!"); - - this.beginIndex = beginIndex; - this.endIndex = endIndex; - - markDirty(); - } - - /** - * @return the current Unified Inventory View of the given Inventory - */ - public Map getUnifiedInventory() { - if (isDirty) { - this.unifiedInv.clear(); - - for (int i = beginIndex; i <= endIndex; i++) { - final var stack = mainInventory.getStack(i); - - if (!stack.isEmpty()) { - final var item = stack.getItem(); - - if (unifiedInv.containsKey(item)) { - unifiedInv.replace(item, unifiedInv.get(item) + stack.getCount()); - } else { - unifiedInv.put(item, stack.getCount()); - } - } - } - - isDirty = false; - } - - return unifiedInv; - } - - /** - * Removes the given Item with a certain amount from the given {@link #mainInventory}. - *

If the given removalAmount is 0 or less, it will remove all instances of the item from the inventory

- * - * @param item The item to be removed - * @param removalAmount The amount to be removed - * @return If the given amount wanted to be removed was actually removed - */ - public boolean removeItems(Item item, int removalAmount) { - boolean hasRemovedGivenCount = false; - - if (item != Items.AIR && getUnifiedInventory().containsKey(item)) { - final int currentItemCount = getUnifiedInventory().get(item); - final int remainder = currentItemCount - removalAmount; - - if (remainder > 0) { - getUnifiedInventory().replace(item, remainder); - - int leftToRemove = removalAmount; - - for (int i = beginIndex; i <= endIndex; i++) { - ItemStack stack = mainInventory.getStack(i); - - if (stack.isOf(item)) { - if (leftToRemove - stack.getCount() < 0) { - stack.setCount(stack.getCount() - leftToRemove); - - break; - } else { - mainInventory.removeStack(i); - - leftToRemove = leftToRemove - stack.getCount(); - } - } - } - - if (leftToRemove < 0) { - hasRemovedGivenCount = true; - } - } else { - getUnifiedInventory().remove(item); - - for (int i = beginIndex; i <= endIndex; i++) { - final var stack = mainInventory.getStack(i); - - if (stack.isOf(item)) { - mainInventory.removeStack(i); - } - } - - hasRemovedGivenCount = true; - } - - markDirty(); - } - - return hasRemovedGivenCount; - } - - /** - * Method used to tell the {@link #getUnifiedInventory()} that it needs to re-cache the {@link #unifiedInv} Map from the linked {@link #mainInventory} - */ - public void markDirty() { - this.isDirty = true; - } - - /** - * Checks if the {@link #unifiedInv} is empty - */ - public boolean isUnifiedInvEmpty() { - return this.getUnifiedInventory().isEmpty(); - } -} diff --git a/src/main/java/wraith/alloyforgery/mixin/DataPackContentsMixin.java b/src/main/java/wraith/alloyforgery/mixin/DataPackContentsMixin.java new file mode 100644 index 0000000..ddba32f --- /dev/null +++ b/src/main/java/wraith/alloyforgery/mixin/DataPackContentsMixin.java @@ -0,0 +1,19 @@ +package wraith.alloyforgery.mixin; + +import net.minecraft.server.DataPackContents; +import net.minecraft.util.registry.DynamicRegistryManager; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import wraith.alloyforgery.recipe.AlloyForgeRecipe; + +@Mixin(DataPackContents.class) +public class DataPackContentsMixin { + + @Inject(method = "refresh", at = @At("TAIL")) + private void alloy_forgery$onRefresh(DynamicRegistryManager dynamicRegistryManager, CallbackInfo ci) { + AlloyForgeRecipe.PENDING_RECIPES.forEach(AlloyForgeRecipe::finishRecipe); + } + +} diff --git a/src/main/java/wraith/alloyforgery/mixin/HopperBlockEntityAccessor.java b/src/main/java/wraith/alloyforgery/mixin/HopperBlockEntityAccessor.java new file mode 100644 index 0000000..26abf45 --- /dev/null +++ b/src/main/java/wraith/alloyforgery/mixin/HopperBlockEntityAccessor.java @@ -0,0 +1,15 @@ +package wraith.alloyforgery.mixin; + +import net.minecraft.block.entity.HopperBlockEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(HopperBlockEntity.class) +public interface HopperBlockEntityAccessor { + + @Invoker("setTransferCooldown") + void alloyForge$setTransferCooldown(int transferCooldown); + + @Invoker("isDisabled") + boolean alloyForge$isDisabled(); +} diff --git a/src/main/java/wraith/alloyforgery/mixin/HopperBlockEntityMixin.java b/src/main/java/wraith/alloyforgery/mixin/HopperBlockEntityMixin.java deleted file mode 100644 index d85cf6d..0000000 --- a/src/main/java/wraith/alloyforgery/mixin/HopperBlockEntityMixin.java +++ /dev/null @@ -1,26 +0,0 @@ -package wraith.alloyforgery.mixin; - -import net.minecraft.block.entity.Hopper; -import net.minecraft.block.entity.HopperBlockEntity; -import net.minecraft.inventory.Inventory; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import wraith.alloyforgery.block.ForgeControllerBlockEntity; - -@Mixin(HopperBlockEntity.class) -public abstract class HopperBlockEntityMixin { - - @Inject(method = "getInputInventory", at = @At("RETURN"), cancellable = true) - private static void injectPassthroughInventory(World world, Hopper hopper, CallbackInfoReturnable cir) { - if (cir.getReturnValue() != null) return; - - final var pos = new BlockPos(hopper.getHopperX(), hopper.getHopperY() + 2, hopper.getHopperZ()); - if (!(world.getBlockEntity(pos) instanceof ForgeControllerBlockEntity)) return; - cir.setReturnValue((Inventory) world.getBlockEntity(pos)); - } - -} diff --git a/src/main/java/wraith/alloyforgery/mixin/HopperHelperMixin.java b/src/main/java/wraith/alloyforgery/mixin/HopperHelperMixin.java deleted file mode 100644 index b81c494..0000000 --- a/src/main/java/wraith/alloyforgery/mixin/HopperHelperMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -package wraith.alloyforgery.mixin; - -import me.jellysquid.mods.lithium.common.hopper.HopperHelper; -import net.minecraft.inventory.Inventory; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import wraith.alloyforgery.block.ForgeControllerBlockEntity; - -@Mixin(HopperHelper.class) -public class HopperHelperMixin { - - @Inject(method = "vanillaGetBlockInventory", at = @At("RETURN"), cancellable = true) - private static void injectPassthroughInventory(World world, BlockPos pos, CallbackInfoReturnable cir) { - if (cir.getReturnValue() != null) return; - - if (!(world.getBlockEntity(pos.up()) instanceof ForgeControllerBlockEntity forge)) return; - cir.setReturnValue(forge); - } - -} diff --git a/src/main/java/wraith/alloyforgery/mixin/RecipeManagerMixin.java b/src/main/java/wraith/alloyforgery/mixin/RecipeManagerMixin.java index 2b8ebe0..2fb74df 100644 --- a/src/main/java/wraith/alloyforgery/mixin/RecipeManagerMixin.java +++ b/src/main/java/wraith/alloyforgery/mixin/RecipeManagerMixin.java @@ -20,7 +20,7 @@ public class RecipeManagerMixin { public void injectForgeRecipes(Map map, ResourceManager resourceManager, Profiler profiler, CallbackInfo ci) { for (var id : ForgeRegistry.getForgeIds()) { final var forgeDefinition = ForgeRegistry.getForgeDefinition(id).get(); - map.put(id, forgeDefinition.generateRecipe(id)); + map.putIfAbsent(id, forgeDefinition.generateRecipe(id)); } } diff --git a/src/main/java/wraith/alloyforgery/mixin/SpriteAtlasTextureDataAccessor.java b/src/main/java/wraith/alloyforgery/mixin/SpriteAtlasTextureDataAccessor.java new file mode 100644 index 0000000..857f368 --- /dev/null +++ b/src/main/java/wraith/alloyforgery/mixin/SpriteAtlasTextureDataAccessor.java @@ -0,0 +1,14 @@ +package wraith.alloyforgery.mixin; + +import net.minecraft.client.texture.SpriteAtlasTexture; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(SpriteAtlasTexture.Data.class) +public interface SpriteAtlasTextureDataAccessor { + @Accessor("width") + int af$getWidth(); + + @Accessor("height") + int af$getHeight(); +} diff --git a/src/main/java/wraith/alloyforgery/mixin/SpriteAtlasTextureMixin.java b/src/main/java/wraith/alloyforgery/mixin/SpriteAtlasTextureMixin.java new file mode 100644 index 0000000..b9776d0 --- /dev/null +++ b/src/main/java/wraith/alloyforgery/mixin/SpriteAtlasTextureMixin.java @@ -0,0 +1,29 @@ +package wraith.alloyforgery.mixin; + +import net.minecraft.client.texture.SpriteAtlasTexture; +import net.minecraft.screen.PlayerScreenHandler; +import net.minecraft.util.Identifier; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import wraith.alloyforgery.client.AlloyForgeScreen; + +@Mixin(SpriteAtlasTexture.class) +public class SpriteAtlasTextureMixin { + + @Shadow + @Final + private Identifier id; + + @Inject(method = "upload", at = @At("HEAD")) + private void captureSize(SpriteAtlasTexture.Data data, CallbackInfo ci) { + if (!this.id.equals(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE)) return; + + AlloyForgeScreen.blockAtlasWidth = ((SpriteAtlasTextureDataAccessor) data).af$getWidth(); + AlloyForgeScreen.blockAtlasHeight = ((SpriteAtlasTextureDataAccessor) data).af$getHeight(); + } + +} diff --git a/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipe.java b/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipe.java index 32aa99e..b9bdf78 100644 --- a/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipe.java +++ b/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipe.java @@ -1,36 +1,47 @@ package wraith.alloyforgery.recipe; import com.google.common.collect.ImmutableMap; +import it.unimi.dsi.fastutil.ints.Int2IntLinkedOpenHashMap; +import it.unimi.dsi.fastutil.ints.Int2IntMap; import net.minecraft.inventory.Inventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Recipe; import net.minecraft.recipe.RecipeSerializer; import net.minecraft.recipe.RecipeType; +import net.minecraft.tag.TagKey; import net.minecraft.util.Identifier; +import net.minecraft.util.Pair; import net.minecraft.util.collection.DefaultedList; +import net.minecraft.util.registry.Registry; import net.minecraft.world.World; import wraith.alloyforgery.AlloyForgery; -import wraith.alloyforgery.block.ForgeControllerBlockEntity; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Map; +import javax.annotation.Nullable; +import java.util.*; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.stream.Collectors; +import java.util.stream.IntStream; public class AlloyForgeRecipe implements Recipe { + private static final Map GLOBAL_RECIPE_REMAINDER = new HashMap<>(); + + private static final List INPUT_SLOT_INDICES = IntStream.rangeClosed(0, 9).boxed().toList(); + + public static final Map PENDING_RECIPES = new HashMap<>(); + private final Identifier id; private final Map inputs; - - private final ItemStack output; + private ItemStack output; private final int minForgeTier; private final int fuelPerTick; - private final ImmutableMap tierOverrides; + private ImmutableMap tierOverrides; public AlloyForgeRecipe(Identifier id, Map inputs, ItemStack output, int minForgeTier, int fuelPerTick, ImmutableMap overrides) { this.id = id; @@ -42,6 +53,39 @@ public AlloyForgeRecipe(Identifier id, Map inputs, ItemStac this.tierOverrides = overrides; } + public void finishRecipe(PendingRecipeData pendingData) { + if (pendingData.defaultTag() != null) { + final var itemEntryList = Registry.ITEM.getEntryList(pendingData.defaultTag().getLeft()); + + itemEntryList.ifPresentOrElse(registryEntries -> { + this.output = registryEntries.get(0).value().getDefaultStack(); + this.output.setCount(pendingData.defaultTag().getRight()); + + }, () -> { + throw new InvalidTagException("Default tag " + pendingData.defaultTag().getLeft().id() + " of recipe " + this.id + " must not be empty"); + }); + } + + final var overrides = ImmutableMap.builder(); + + pendingData.unfinishedTierOverrides().forEach((range, override) -> { + if (override.isCountOnly()) { + ItemStack stack = this.output.copy(); + stack.setCount(override.count()); + + overrides.put(range, stack); + } else { + overrides.put(range, override.stack()); + } + }); + + this.tierOverrides = overrides.build(); + } + + public static void addRemainders(Map remainders){ + GLOBAL_RECIPE_REMAINDER.putAll(remainders); + } + @Override public boolean isIgnoredInRecipeBook() { return true; @@ -49,37 +93,48 @@ public boolean isIgnoredInRecipeBook() { @Override public boolean matches(Inventory inventory, World world) { - int matchedIngredients = 0; - final var unifiedView = ((ForgeControllerBlockEntity) inventory).asUnifiedView(); - - //Confirm that the there is enough items for this recipe to even work - if (unifiedView.getUnifiedInventory().size() != inputs.size()) - return false; + return tryBind(inventory) != null; + } - final var localInputs = new ArrayList<>(inputs.entrySet()); + public Int2IntMap tryBind(Inventory inventory) { + var indices = new ConcurrentLinkedQueue<>(INPUT_SLOT_INDICES); + var boundSlots = new Int2IntLinkedOpenHashMap(); - for (Map.Entry invEntry : unifiedView.getUnifiedInventory().entrySet()) { - boolean isValidIngredient = false; + for (var ingredient : this.inputs.entrySet()) { + int remaining = ingredient.getValue(); - for (int i = 0; i < localInputs.size(); i++) { - Map.Entry inputEntry = localInputs.get(i); + for (int index : indices) { + var stack = inventory.getStack(index); - //First test if we have enough Items based on the Ingredients needed amount for the recipe and then test if the item is am ingredient - if ((invEntry.getValue() - inputEntry.getValue() >= 0) && inputEntry.getKey().test(invEntry.getKey().getDefaultStack())) { - isValidIngredient = true; - matchedIngredients++; + if (ingredient.getKey().test(stack)) { + boundSlots.put(index, Math.min(stack.getCount(), remaining)); + indices.remove(index); - localInputs.remove(i); - break; + remaining -= stack.getCount(); + if (remaining <= 0) break; } } - if (!isValidIngredient) { - return false; + if (remaining > 0) { + return null; } } - return matchedIngredients == inputs.size(); + verification: + for (int index : indices) { + var stack = inventory.getStack(index); + if (stack.isEmpty()) continue; + + for (var ingredient : this.inputs.keySet()) { + if (ingredient.test(stack)) { + continue verification; + } + } + + return null; + } + + return boundSlots; } @Override @@ -101,22 +156,40 @@ public Map getIngredientsMap() { @Override public ItemStack craft(Inventory inventory) { + tryBind(inventory).forEach(inventory::removeStack); + return ItemStack.EMPTY; } - /** - * Method to reduce the Items within the Unified Inventory based of the recipe ingredient requirements - */ - public void consumeNeededIngredients(Inventory inventory) { - final var unifiedView = ((ForgeControllerBlockEntity) inventory).asUnifiedView(); + @Nullable + public DefaultedList attemptToGetRemainders(Inventory inventory) { + final var remainders = DefaultedList.ofSize(inventory.size(), ItemStack.EMPTY); - for (final var item : new HashSet<>(unifiedView.getUnifiedInventory().keySet())) { - inputs.forEach((input, inputCount) -> { - if (input.test(item.getDefaultStack())) { - unifiedView.removeItems(item, inputCount); - } - }); + //final var owoRemainders = RecipeRemainderStorage.has(this.getId()) ? RecipeRemainderStorage.get(this.getId()) : Map.of(); + + if(/*owoRemainders.isEmpty() &&*/ GLOBAL_RECIPE_REMAINDER.isEmpty()) return null; + + var setAnyRemainders = false; + + for (int i : tryBind(inventory).keySet()) { + var item = inventory.getStack(i).getItem(); + +// if (!owoRemainders.isEmpty()) { +// if (!owoRemainders.containsKey(item)) continue; +// +// remainders.set(i, owoRemainders.get(item).copy()); +// +// setAnyRemainders = true; +// } else + + if(GLOBAL_RECIPE_REMAINDER.containsKey(item)){ + remainders.set(i, GLOBAL_RECIPE_REMAINDER.get(item).copy()); + + setAnyRemainders = true; + } } + + return setAnyRemainders ? remainders : null; } @Override @@ -127,11 +200,21 @@ public boolean fits(int width, int height) { @Override @Deprecated public ItemStack getOutput() { - return output.copy(); + return this.output.copy(); } public ItemStack getOutput(int forgeTier) { - return tierOverrides.getOrDefault(tierOverrides.keySet().stream().filter(overrideRange -> overrideRange.test(forgeTier)).findAny().orElse(null), output).copy(); + ItemStack stack = tierOverrides.getOrDefault(tierOverrides.keySet().stream().filter(overrideRange -> overrideRange.test(forgeTier)).findAny().orElse(null), output).copy(); + + if (stack.getItem() == Items.AIR) { + int stackCount = stack.getCount(); + + stack = this.output.copy(); + + stack.setCount(stackCount); + } + + return stack; } @Override @@ -202,4 +285,27 @@ private Type() {} public static final Identifier ID = AlloyForgery.id("forging"); public static final Type INSTANCE = new Type(); } + + public record PendingRecipeData(@Nullable Pair, Integer> defaultTag, + ImmutableMap unfinishedTierOverrides) { + public record PendingOverride(@Nullable ItemStack stack, int count) { + public boolean isCountOnly() { + return this.stack == null; + } + + public static PendingOverride onlyCount(int count) { + return new PendingOverride(null, count); + } + + public static PendingOverride ofStack(ItemStack stack) { + return new PendingOverride(stack, -1); + } + } + } + + public static class InvalidTagException extends RuntimeException { + public InvalidTagException(String message) { + super(message); + } + } } diff --git a/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipeSerializer.java b/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipeSerializer.java index 084d274..aff880e 100644 --- a/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipeSerializer.java +++ b/src/main/java/wraith/alloyforgery/recipe/AlloyForgeRecipeSerializer.java @@ -1,20 +1,22 @@ package wraith.alloyforgery.recipe; import com.google.common.collect.ImmutableMap; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; import com.google.gson.JsonSyntaxException; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.RecipeSerializer; +import net.minecraft.tag.TagKey; import net.minecraft.util.Identifier; import net.minecraft.util.JsonHelper; +import net.minecraft.util.Pair; +import net.minecraft.util.registry.Registry; +import org.apache.commons.lang3.mutable.MutableInt; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.Map; public class AlloyForgeRecipeSerializer implements RecipeSerializer { @@ -24,36 +26,85 @@ public class AlloyForgeRecipeSerializer implements RecipeSerializer jsonObjectIntegerMap = new HashMap<>(); + Map ingredientDataToCount = new LinkedHashMap<>(); - for(JsonElement entry : JsonHelper.getArray(json, "inputs")) { - JsonObject object = entry.getAsJsonObject(); + for (var entry : JsonHelper.getArray(json, "inputs")) { + var object = entry.getAsJsonObject(); - if(jsonObjectIntegerMap.containsKey(object)) { - jsonObjectIntegerMap.replace(object, jsonObjectIntegerMap.get(object) + 1); + IngredientData inputData; + + if (object.has("item")) { + inputData = new IngredientData(object.get("item").getAsString(), false); + } else if (object.has("tag")) { + inputData = new IngredientData(object.get("tag").getAsString(), true); } else { - jsonObjectIntegerMap.put(object, 1); + throw new JsonSyntaxException("An ingredient entry needs either a tag or an item"); } + + ingredientDataToCount.computeIfAbsent(inputData, stringStringPair -> new MutableInt(0)) + .add(object.keySet().contains("count") ? object.get("count").getAsInt() : 1); + } + + if (ingredientDataToCount.isEmpty()) throw new JsonSyntaxException("Inputs cannot be empty"); + if (ingredientDataToCount.keySet().size() > 10) { + throw new JsonSyntaxException("Recipe has more than 10 distinct input ingredients"); } - if (jsonObjectIntegerMap.isEmpty()) throw new JsonSyntaxException("Inputs cannot be empty"); + var ingredientToCount = new LinkedHashMap(); + for (var entry : ingredientDataToCount.entrySet()) { + final var ingredientData = entry.getKey(); - Map ingredientIntegerMap = new HashMap<>(); + Ingredient ingredient; + Identifier identifier = new Identifier(ingredientData.data()); - for(Map.Entry entry : jsonObjectIntegerMap.entrySet()) { - ingredientIntegerMap.put(Ingredient.fromJson(entry.getKey()), entry.getValue()); + ingredient = ingredientData.isTag() + ? Ingredient.fromTag(TagKey.of(Registry.ITEM_KEY, identifier)) + : Ingredient.ofItems(JsonHelper.asItem(new JsonPrimitive(ingredientData.data()), identifier.toString())); + + ingredientToCount.put(ingredient, entry.getValue().intValue()); + } + + if (ingredientToCount.values().stream().mapToInt(integer -> integer).sum() > (10 * 64)) { + throw new JsonSyntaxException("Recipe exceeded maximum input item count of " + (10 * 64)); } - final var outputStack = getItemStack(JsonHelper.getObject(json, "output")); + final var outputObject = JsonHelper.getObject(json, "output"); + + boolean prioritisedOutput = false; + ItemStack outputStack = null; + Pair, Integer> defaultTag = null; + + if (outputObject.has("priority")) { + if (!outputObject.has("default")) { + throw new JsonSyntaxException("Priority-based recipes must declare a 'default' tag"); + } + + prioritisedOutput = true; + + for (var itemElement : JsonHelper.getArray(outputObject, "priority")) { + var maybeItem = Registry.ITEM.getOrEmpty(Identifier.tryParse(itemElement.getAsString())); + + if (maybeItem.isPresent()) { + outputStack = maybeItem.get().getDefaultStack(); + outputStack.setCount(JsonHelper.getInt(outputObject, "count")); + break; + } + } + + if (outputStack == null) { + defaultTag = new Pair<>(TagKey.of(Registry.ITEM_KEY, new Identifier(JsonHelper.getString(outputObject, "default"))), JsonHelper.getInt(outputObject, "count")); + } + } else { + outputStack = getItemStack(outputObject); + } final int minForgeTier = JsonHelper.getInt(json, "min_forge_tier"); final int requiredFuel = JsonHelper.getInt(json, "fuel_per_tick"); - final var overridesJson = JsonHelper.getObject(json, "overrides", new JsonObject()); - final var overridesBuilder = ImmutableMap.builder(); - - for (var entry : overridesJson.entrySet()) { + final var overrides = JsonHelper.getObject(json, "overrides", new JsonObject()); + final var overridesBuilder = ImmutableMap.builder(); + for (var entry : overrides.entrySet()) { final var overrideString = entry.getKey(); AlloyForgeRecipe.OverrideRange overrideRange = null; @@ -69,10 +120,39 @@ public AlloyForgeRecipe read(Identifier id, JsonObject json) { throw new JsonSyntaxException("Invalid override range token: " + overrideString); } - overridesBuilder.put(overrideRange, getItemStack(entry.getValue().getAsJsonObject())); + final var overrideObject = entry.getValue().getAsJsonObject(); + + if (overrideObject.has("id")) { + overridesBuilder.put(overrideRange, AlloyForgeRecipe.PendingRecipeData.PendingOverride.ofStack(getItemStack(overrideObject))); + } else { + overridesBuilder.put(overrideRange, AlloyForgeRecipe.PendingRecipeData.PendingOverride.onlyCount(JsonHelper.getInt(overrideObject, "count"))); + } } - return new AlloyForgeRecipe(id, ingredientIntegerMap, outputStack, minForgeTier, requiredFuel, overridesBuilder.build()); + var effectiveOverrides = ImmutableMap.of(); + if (!prioritisedOutput) { + final var builder = ImmutableMap.builder(); + + for (var entry : overridesBuilder.build().entrySet()) { + if (entry.getValue().isCountOnly()) { + var stack = outputStack.copy(); + stack.setCount(entry.getValue().count()); + builder.put(entry.getKey(), stack); + } else { + builder.put(entry.getKey(), entry.getValue().stack()); + } + } + + effectiveOverrides = builder.build(); + } + + final var recipe = new AlloyForgeRecipe(id, ingredientToCount, outputStack, minForgeTier, requiredFuel, effectiveOverrides); + + if (prioritisedOutput) { + AlloyForgeRecipe.PENDING_RECIPES.put(recipe, new AlloyForgeRecipe.PendingRecipeData(defaultTag, overridesBuilder.build())); + } + + return recipe; } private ItemStack getItemStack(JsonObject json) { @@ -84,9 +164,7 @@ private ItemStack getItemStack(JsonObject json) { @Override public AlloyForgeRecipe read(Identifier id, PacketByteBuf buf) { - -// final var inputs = buf.readCollection(value -> new ArrayList<>(), Ingredient::fromPacket); - final var inputs = buf.readMap(value -> new HashMap(), Ingredient::fromPacket, PacketByteBuf::readVarInt); + final var inputs = buf.readMap(value -> new LinkedHashMap<>(), Ingredient::fromPacket, PacketByteBuf::readVarInt); final var output = buf.readItemStack(); @@ -102,7 +180,6 @@ public AlloyForgeRecipe read(Identifier id, PacketByteBuf buf) { public void write(PacketByteBuf buf, AlloyForgeRecipe recipe) { buf.writeMap(recipe.getIngredientsMap(), (buf1, ingredient) -> ingredient.write(buf1), PacketByteBuf::writeVarInt); - //buf.writeCollection(recipe.getIngredients(), (buf1, ingredient) -> ingredient.write(buf1)); buf.writeItemStack(recipe.getOutput()); buf.writeVarInt(recipe.getMinForgeTier()); @@ -113,4 +190,6 @@ public void write(PacketByteBuf buf, AlloyForgeRecipe recipe) { buf1.writeVarInt(overrideRange.upperBound()); }, PacketByteBuf::writeItemStack); } + + private record IngredientData(String data, boolean isTag) {} } diff --git a/src/main/resources/alloy-forgery.mixins.json b/src/main/resources/alloy-forgery.mixins.json index 0a89284..ce9f249 100644 --- a/src/main/resources/alloy-forgery.mixins.json +++ b/src/main/resources/alloy-forgery.mixins.json @@ -5,12 +5,14 @@ "plugin": "wraith.alloyforgery.mixin.AlloyForgeryMixinPlugin", "compatibilityLevel": "JAVA_8", "mixins": [ + "DataPackContentsMixin", "DefaultedRegistryMixin", - "HopperBlockEntityMixin", - "HopperHelperMixin", - "RecipeManagerMixin" + "HopperBlockEntityAccessor", + "RecipeManagerMixin", + "SpriteAtlasTextureDataAccessor" ], "client": [ + "SpriteAtlasTextureMixin" ], "injectors": { "defaultRequire": 1 diff --git a/src/main/resources/assets/alloy_forgery/lang/ko_kr.json b/src/main/resources/assets/alloy_forgery/lang/ko_kr.json new file mode 100644 index 0000000..5ea79ec --- /dev/null +++ b/src/main/resources/assets/alloy_forgery/lang/ko_kr.json @@ -0,0 +1,24 @@ +{ + "block.alloy_forgery.bricks_forge_controller": "벽돌 단조 제어 장치", + "block.alloy_forgery.stone_bricks_forge_controller": "석재 벽돌 단조 제어 장치", + "block.alloy_forgery.deepslate_bricks_forge_controller": "심층암 벽돌 단조 제어 장치", + "block.alloy_forgery.end_stone_bricks_forge_controller": "엔드 석재 벽돌 단조 제어 장치", + "block.alloy_forgery.polished_blackstone_forge_controller": "윤나는 흑암 단조 제어 장치", + "block.alloy_forgery.prismarine_bricks_forge_controller": "프리즈머린 벽돌 단조 제어 장치", + + "tooltip.alloy_forgery.forge_tier": "티어: %d", + "tooltip.alloy_forgery.fuel_capacity": "연료 용량: %d", + + "container.alloy_forgery.forge_controller": "합금 단조", + + "container.alloy_forgery.rei.title": "합금 단조", + "container.alloy_forgery.rei.min_tier": "필요 티어: %d", + "container.alloy_forgery.rei.fuel_per_tick": "틱당 연료: %d", + + "message.alloy_forgery.invalid_multiblock": "잘못된 멀티블록 구성", + "itemGroup.alloy_forgery.alloy_forgery": "Alloy Forgery", + "itemGroup.alloy_forgery.alloy_forgery.button.discord": "Discord", + "itemGroup.alloy_forgery.alloy_forgery.button.curseforge": "CurseForge", + "itemGroup.alloy_forgery.alloy_forgery.button.modrinth": "Modrinth", + "itemGroup.alloy_forgery.alloy_forgery.button.github": "GitHub" +} \ No newline at end of file diff --git a/src/main/resources/assets/alloy_forgery/lang/ru_ru.json b/src/main/resources/assets/alloy_forgery/lang/ru_ru.json new file mode 100644 index 0000000..a63338e --- /dev/null +++ b/src/main/resources/assets/alloy_forgery/lang/ru_ru.json @@ -0,0 +1,19 @@ +{ + "block.alloy_forgery.bricks_forge_controller": "Контроллер кузницы из кирпичей", + "block.alloy_forgery.stone_bricks_forge_controller": "Контроллер кузницы из каменных кирпичей", + "block.alloy_forgery.deepslate_bricks_forge_controller": "Контроллер кузницы из глубинносланцевых кирпичей", + "block.alloy_forgery.end_stone_bricks_forge_controller": "Контроллер кузницы из эндерняковых кирпичей", + "block.alloy_forgery.polished_blackstone_forge_controller": "Контроллер кузницы из полированного чернита", + + "tooltip.alloy_forgery.forge_tier": "Уровень: %d", + "tooltip.alloy_forgery.fuel_capacity": "Запас топлива: %d", + + "container.alloy_forgery.forge_controller": "Контроллер кузницы", + + "container.alloy_forgery.rei.title": "Alloy Forgery", + "container.alloy_forgery.rei.min_tier": "Требуемый уровень: %d", + "container.alloy_forgery.rei.fuel_per_tick": "Расход топлива в тик: %d", + + "message.alloy_forgery.invalid_multiblock": "Есть ошибки в составлении многоблочной структуры", + "itemGroup.alloy_forgery.alloy_forgery": "Alloy Forgery" +} diff --git a/src/main/resources/assets/alloy_forgery/lang/zh_cn.json b/src/main/resources/assets/alloy_forgery/lang/zh_cn.json new file mode 100644 index 0000000..d5df088 --- /dev/null +++ b/src/main/resources/assets/alloy_forgery/lang/zh_cn.json @@ -0,0 +1,24 @@ +{ + "block.alloy_forgery.bricks_forge_controller": "红砖冶炼控制器", + "block.alloy_forgery.stone_bricks_forge_controller": "石砖冶炼控制器", + "block.alloy_forgery.deepslate_bricks_forge_controller": "深板岩砖冶炼控制器", + "block.alloy_forgery.end_stone_bricks_forge_controller": "末地石砖冶炼控制器", + "block.alloy_forgery.polished_blackstone_forge_controller": "磨制黑石冶炼控制器", + "block.alloy_forgery.prismarine_bricks_forge_controller": "海晶石砖冶炼控制器", + + "tooltip.alloy_forgery.forge_tier": "等级:%d", + "tooltip.alloy_forgery.fuel_capacity": "燃料容量:%d", + + "container.alloy_forgery.forge_controller": "合金冶炼炉", + + "container.alloy_forgery.rei.title": "冶炼合金", + "container.alloy_forgery.rei.min_tier": "冶炼炉等级要求:%d", + "container.alloy_forgery.rei.fuel_per_tick": "燃料消耗:%d/tick", + + "message.alloy_forgery.invalid_multiblock": "多方块结构无效", + "itemGroup.alloy_forgery.alloy_forgery": "合金冶炼炉", + "itemGroup.alloy_forgery.alloy_forgery.button.discord": "Discord", + "itemGroup.alloy_forgery.alloy_forgery.button.curseforge": "CurseForge", + "itemGroup.alloy_forgery.alloy_forgery.button.modrinth": "Modrinth", + "itemGroup.alloy_forgery.alloy_forgery.button.github": "GitHub" +} \ No newline at end of file diff --git a/src/main/resources/assets/alloy_forgery/textures/gui/forge_controller_dark.png b/src/main/resources/assets/alloy_forgery/textures/gui/forge_controller_dark.png new file mode 100644 index 0000000..fd29e4b Binary files /dev/null and b/src/main/resources/assets/alloy_forgery/textures/gui/forge_controller_dark.png differ diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/adamantite_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/adamantite_ingot_from_ores.json new file mode 100644 index 0000000..ce371a3 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/adamantite_ingot_from_ores.json @@ -0,0 +1,31 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:adamantite_ores", + "c:adamantite_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:adamantite_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:adamantite_ingot" + ], + "default": "c:adamantite_ingot", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/adamantite_ingot_from_raw_ore.json b/src/main/resources/data/alloy_forgery/recipes/compat/adamantite_ingot_from_raw_ore.json new file mode 100644 index 0000000..e084697 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/adamantite_ingot_from_raw_ore.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_adamantite_ores", + "c:adamantite_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_adamantite_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:adamantite_ingot" + ], + "default": "c:adamantite_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_ingots.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_ingots.json new file mode 100644 index 0000000..556836b --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_ingots.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:copper_ingots", + "c:zinc_ingots", + "c:brass_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:copper_ingots", + "count": 2 + }, + { + "tag": "c:zinc_ingots" + } + ], + "output": { + "priority": [ + "create:brass_ingot", + "techreborn:brass_ingot" + ], + "default": "c:brass_ingots", + "count": 3 + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_ores.json new file mode 100644 index 0000000..86fd0d7 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_ores.json @@ -0,0 +1,40 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:copper_ores", + "c:zinc_ores", + "c:brass_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "minecraft:copper_ores", + "count": 2 + }, + { + "tag": "c:zinc_ores" + } + ], + "output": { + "priority": [ + "create:brass_ingot", + "techreborn:brass_ingot" + ], + "default": "c:brass_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + }, + "3+": { + "count": 5 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_raw_ores.json new file mode 100644 index 0000000..c5eea51 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/brass_from_raw_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_copper_ores", + "c:raw_zinc_ores", + "c:brass_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_copper_ores", + "count": 2 + }, + { + "tag": "c:raw_zinc_ores" + } + ], + "output": { + "priority": [ + "create:brass_ingot", + "techreborn:brass_ingot" + ], + "default": "c:brass_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_ingots.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_ingots.json new file mode 100644 index 0000000..7741bdb --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_ingots.json @@ -0,0 +1,34 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:tin_ingots", + "c:copper_ingots", + "c:bronze_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:copper_ingots", + "count": 2 + }, + { + "tag": "c:tin_ingots" + } + ], + "output": { + "priority": [ + "mythicmetals:bronze_ingot", + "techreborn:bronze_ingot", + "indrev:bronze_ingot", + "modern_industrialization:bronze_ingot" + ], + "default": "c:bronze_ingots", + "count": 2 + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_ores.json new file mode 100644 index 0000000..4d3b86d --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_ores.json @@ -0,0 +1,39 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:tin_ores", + "c:copper_ores", + "c:bronze_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "minecraft:copper_ores", + "count": 2 + }, + { + "tag": "c:tin_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:bronze_ingot", + "techreborn:bronze_ingot", + "indrev:bronze_ingot", + "modern_industrialization:bronze_ingot" + ], + "default": "c:bronze_ingots", + "count": 4 + }, + "overrides": { + "2+": { + "count": 5 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_raw_ores.json new file mode 100644 index 0000000..2bd99ed --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/bronze_from_raw_ores.json @@ -0,0 +1,39 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_tin_ores", + "c:raw_copper_ores", + "c:bronze_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_copper_ores", + "count": 2 + }, + { + "tag": "c:raw_tin_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:bronze_ingot", + "techreborn:bronze_ingot", + "indrev:bronze_ingot", + "modern_industrialization:bronze_ingot" + ], + "default": "c:bronze_ingots", + "count": 2 + }, + "overrides": { + "2+": { + "count": 3 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_ingots.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_ingots.json new file mode 100644 index 0000000..2bc551d --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_ingots.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:gold_ingots", + "c:silver_ingots", + "c:electrum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:gold_ingots" + }, + { + "tag": "c:silver_ingots" + } + ], + "output": { + "priority": [ + "techreborn:electrum_ingot", + "indrev:electrum_ingot", + "modern_industrialization:electrum_ingot" + ], + "default": "c:electrum_ingots", + "count": 2 + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_ores.json new file mode 100644 index 0000000..88d633c --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:gold_ores", + "c:silver_ores", + "c:electrum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:gold_ores" + }, + { + "tag": "c:silver_ores" + } + ], + "output": { + "priority": [ + "techreborn:electrum_ingot", + "indrev:electrum_ingot", + "modern_industrialization:electrum_ingot" + ], + "default": "c:electrum_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_raw_ores.json new file mode 100644 index 0000000..267fd5e --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/electrum_from_raw_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_gold_ores", + "c:raw_silver_ors", + "c:electrum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_gold_ores" + }, + { + "tag": "c:raw_silver_ores" + } + ], + "output": { + "priority": [ + "techreborn:electrum_ingot", + "indrev:electrum_ingot", + "modern_industrialization:electrum_ingot" + ], + "default": "c:electrum_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_ingots.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_ingots.json new file mode 100644 index 0000000..b4628b1 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_ingots.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:iron_ingots", + "c:nickel_ingots", + "c:invar_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:iron_ingots", + "count": 2 + }, + { + "tag": "c:nickel_ingots" + } + ], + "output": { + "priority": [ + "techreborn:invar_ingot", + "modern_industrialization:invar_ingot" + ], + "default": "c:invar_ingots", + "count": 3 + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_ores.json new file mode 100644 index 0000000..1b05dca --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_ores.json @@ -0,0 +1,40 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:iron_ores", + "c:nickel_ores", + "c:invar_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "minecraft:iron_ores", + "count": 2 + }, + { + "tag": "c:nickel_ores" + } + ], + "output": { + "priority": [ + "techreborn:invar_ingot", + "modern_industrialization:invar_ingot" + ], + "default": "c:invar_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + }, + "3+": { + "count": 5 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_raw_ores.json new file mode 100644 index 0000000..e56f3bf --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/invar_from_raw_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_iron_ores", + "c:raw_nickel_ores", + "c:invar_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_iron_ores", + "count": 2 + }, + { + "tag": "c:raw_nickel_ores" + } + ], + "output": { + "priority": [ + "techreborn:invar_ingot", + "modern_industrialization:invar_ingot" + ], + "default": "c:invar_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_ingots.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_ingots.json new file mode 100644 index 0000000..26f8175 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_ingots.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:coal", + "c:iron_ingots", + "c:steel_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:iron_ingots" + }, + { + "tag": "c:coal" + } + ], + "output": { + "priority": [ + "techreborn:steel_ingot", + "indrev:steel_ingot", + "modern_industrialization:steel_ingot" + ], + "default": "c:steel_ingots", + "count": 2 + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_ores.json new file mode 100644 index 0000000..a237092 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:coal", + "c:iron_ores", + "c:steel_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "minecraft:iron_ores" + }, + { + "tag": "c:coal" + } + ], + "output": { + "priority": [ + "techreborn:steel_ingot", + "indrev:steel_ingot", + "modern_industrialization:steel_ingot" + ], + "default": "c:steel_ingots", + "count": 2 + }, + "overrides": { + "2+": { + "count": 3 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_raw_ores.json new file mode 100644 index 0000000..0082a08 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/alloys/steel_from_raw_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:coal", + "c:raw_iron_ores", + "c:steel_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_iron_ores" + }, + { + "tag": "c:coal" + } + ], + "output": { + "priority": [ + "techreborn:steel_ingot", + "indrev:steel_ingot", + "modern_industrialization:steel_ingot" + ], + "default": "c:steel_ingots", + "count": 2 + }, + "overrides": { + "2+": { + "count": 3 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/aluminum_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/aluminum_ingot_from_ores.json new file mode 100644 index 0000000..79d329b --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/aluminum_ingot_from_ores.json @@ -0,0 +1,35 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:bauxite_ores", + "c:aluminum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:bauxite_ores" + } + ], + "output": { + "priority": [ + "techreborn:aluminum_ingot", + "modern_industrialization:aluminum_ingot" + ], + "default": "c:aluminum_ingots", + "count": 3 + }, + "overrides": { + "2": { + "count": 4 + }, + "3+": { + "count": 5 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/antimony_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/antimony_ingot_from_ores.json new file mode 100644 index 0000000..7c55971 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/antimony_ingot_from_ores.json @@ -0,0 +1,34 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:antimony_ores", + "c:antimony_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:antimony_ores" + } + ], + "output": { + "priority": [ + "modern_industrialization:antimony_ingot" + ], + "default": "c:antimony_ingots", + "count": 3 + }, + "overrides": { + "2": { + "count": 4 + }, + "3+": { + "count": 5 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/antimony_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/antimony_ingot_from_raw_ores.json new file mode 100644 index 0000000..d1beb5a --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/antimony_ingot_from_raw_ores.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_antimony_ores", + "c:antimony_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_antimony_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "modern_industrialization:antimony_ingot" + ], + "default": "c:antimony_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/iridium_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/iridium_ingot_from_ores.json new file mode 100644 index 0000000..e63ae6a --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/iridium_ingot_from_ores.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:iridium_ores", + "c:iridium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:iridium_ores" + } + ], + "output": { + "priority": [ + "techreborn:iridium_ingot", + "modern_industrialization:iridium_ingot" + ], + "default": "c:iridium_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/iridium_ingot_from_raw_ore.json b/src/main/resources/data/alloy_forgery/recipes/compat/iridium_ingot_from_raw_ore.json new file mode 100644 index 0000000..84956dd --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/iridium_ingot_from_raw_ore.json @@ -0,0 +1,33 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_iridium_ores", + "c:iridium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_iridium_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "techreborn:iridium_ingot", + "modern_industrialization:iridium_ingot" + ], + "default": "c:iridium_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/lead_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/lead_ingot_from_ores.json new file mode 100644 index 0000000..48b9a67 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/lead_ingot_from_ores.json @@ -0,0 +1,36 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:lead_ores", + "c:lead_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:lead_ores" + } + ], + "output": { + "priority": [ + "techreborn:lead_ingot", + "indrev:lead_ingot", + "modern_industrialization:lead_ingot" + ], + "default": "c:lead_ingots", + "count": 3 + }, + "overrides": { + "2": { + "count": 4 + }, + "3+": { + "count": 5 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/lead_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/lead_ingot_from_raw_ores.json new file mode 100644 index 0000000..4f00f68 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/lead_ingot_from_raw_ores.json @@ -0,0 +1,34 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_lead_ores", + "c:lead_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_lead_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "techreborn:lead_ingot", + "indrev:lead_ingot", + "modern_industrialization:lead_ingot" + ], + "default": "c:lead_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/manganese_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/manganese_ingot_from_ores.json new file mode 100644 index 0000000..ab244ed --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/manganese_ingot_from_ores.json @@ -0,0 +1,35 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:manganese_ores", + "c:manganese_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:manganese_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:manganese_ingot", + "modern_industrialization:manganese_ingot" + ], + "default": "c:manganese_ingots", + "count": 2 + }, + "overrides": { + "2": { + "count": 3 + }, + "3+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/manganese_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/manganese_ingot_from_raw_ores.json new file mode 100644 index 0000000..72525c3 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/manganese_ingot_from_raw_ores.json @@ -0,0 +1,33 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_manganese_ores", + "c:manganese_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_manganese_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:manganese_ingot", + "modern_industrialization:manganese_ingot" + ], + "default": "c:manganese_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/mythril_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/mythril_ingot_from_ores.json new file mode 100644 index 0000000..069eeb7 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/mythril_ingot_from_ores.json @@ -0,0 +1,31 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:mythril_ores", + "c:mythril_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:mythril_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:mythril_ingot" + ], + "default": "c:mythril_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/mythril_ingot_from_raw_ore.json b/src/main/resources/data/alloy_forgery/recipes/compat/mythril_ingot_from_raw_ore.json new file mode 100644 index 0000000..7a91014 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/mythril_ingot_from_raw_ore.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_mythril_ores", + "c:mythril_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_mythril_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:mythril_ingot" + ], + "default": "c:mythril_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/nickel_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/nickel_ingot_from_ores.json new file mode 100644 index 0000000..d66ddd0 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/nickel_ingot_from_ores.json @@ -0,0 +1,35 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:nickel_ores", + "c:nickel_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:nickel_ores" + } + ], + "output": { + "priority": [ + "techreborn:nickel_ingot", + "modern_industrialization:nickel_ingot" + ], + "default": "c:nickel_ingots", + "count": 2 + }, + "overrides": { + "2": { + "count": 3 + }, + "3+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/nickel_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/nickel_ingot_from_raw_ores.json new file mode 100644 index 0000000..6a1d5f6 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/nickel_ingot_from_raw_ores.json @@ -0,0 +1,33 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_nickel_ores", + "c:nickel_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_nickel_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "techreborn:nickel_ingot", + "modern_industrialization:nickel_ingot" + ], + "default": "c:nickel_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/orichalcum_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/orichalcum_ingot_from_ores.json new file mode 100644 index 0000000..18017e8 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/orichalcum_ingot_from_ores.json @@ -0,0 +1,31 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:orichalcum_ores", + "c:orichalcum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:orichalcum_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:orichalcum_ingot" + ], + "default": "c:orichalcum_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/orichalcum_ingot_from_raw_ore.json b/src/main/resources/data/alloy_forgery/recipes/compat/orichalcum_ingot_from_raw_ore.json new file mode 100644 index 0000000..6c65124 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/orichalcum_ingot_from_raw_ore.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_orichalcum_ores", + "c:orichalcum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_orichalcum_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:orichalcum_ingot" + ], + "default": "c:orichalcum_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/osmium_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/osmium_ingot_from_ores.json new file mode 100644 index 0000000..b7bd4a9 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/osmium_ingot_from_ores.json @@ -0,0 +1,31 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:osmium_ores", + "c:osmium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:osmium_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:osmium_ingot" + ], + "default": "c:osmium_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/osmium_ingot_from_raw_ore.json b/src/main/resources/data/alloy_forgery/recipes/compat/osmium_ingot_from_raw_ore.json new file mode 100644 index 0000000..03372f3 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/osmium_ingot_from_raw_ore.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_osmium_ores", + "c:osmium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_osmium_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:osmium_ingot" + ], + "default": "c:osmium_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/palladium_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/palladium_ingot_from_ores.json new file mode 100644 index 0000000..afd9513 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/palladium_ingot_from_ores.json @@ -0,0 +1,31 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:palladium_ores", + "c:palladium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:palladium_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:palladium_ingot" + ], + "default": "c:palladium_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 15 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/palladium_ingot_from_raw_ore.json b/src/main/resources/data/alloy_forgery/recipes/compat/palladium_ingot_from_raw_ore.json new file mode 100644 index 0000000..a4d6f68 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/palladium_ingot_from_raw_ore.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_palladium_ores", + "c:palladium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_palladium_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:palladium_ingot" + ], + "default": "c:palladium_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 15 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/platinum_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/platinum_ingot_from_ores.json new file mode 100644 index 0000000..763b87b --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/platinum_ingot_from_ores.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:platinum_ores", + "c:platinum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:platinum_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:platinum_ingot", + "modern_industrialization:platinum_ingot" + ], + "default": "c:platinum_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/platinum_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/platinum_ingot_from_raw_ores.json new file mode 100644 index 0000000..b5d5bb3 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/platinum_ingot_from_raw_ores.json @@ -0,0 +1,33 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_platinum_ores", + "c:platinum_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_platinum_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:platinum_ingot", + "modern_industrialization:platinum_ingot" + ], + "default": "c:platinum_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/silver_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/silver_ingot_from_ores.json new file mode 100644 index 0000000..7c5401b --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/silver_ingot_from_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:silver_ores", + "c:silver_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:silver_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:silver_ingot", + "techreborn:silver_ingot", + "indrev:silver_ingot", + "modern_industrialization:silver_ingot" + ], + "default": "c:silver_ingots", + "count": 2 + }, + "overrides": { + "2": { + "count": 3 + }, + "3+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/silver_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/silver_ingot_from_raw_ores.json new file mode 100644 index 0000000..6f18626 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/silver_ingot_from_raw_ores.json @@ -0,0 +1,35 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_silver_ores", + "c:silver_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_silver_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:silver_ingot", + "techreborn:silver_ingot", + "indrev:silver_ingot", + "modern_industrialization:silver_ingot" + ], + "default": "c:silver_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/tin_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/tin_ingot_from_ores.json new file mode 100644 index 0000000..b7e0af4 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/tin_ingot_from_ores.json @@ -0,0 +1,37 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:tin_ores", + "c:tin_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:tin_ores" + } + ], + "output": { + "priority": [ + "mythicmetals:tin_ingot", + "techreborn:tin_ingot", + "indrev:tin_ingot", + "modern_industrialization:tin_ingot" + ], + "default": "c:tin_ingots", + "count": 2 + }, + "overrides": { + "2": { + "count": 3 + }, + "3+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/tin_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/tin_ingot_from_raw_ores.json new file mode 100644 index 0000000..13c4a89 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/tin_ingot_from_raw_ores.json @@ -0,0 +1,35 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_tin_ores", + "c:tin_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_tin_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "mythicmetals:tin_ingot", + "techreborn:tin_ingot", + "indrev:tin_ingot", + "modern_industrialization:tin_ingot" + ], + "default": "c:tin_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/titanium_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/titanium_ingot_from_ores.json new file mode 100644 index 0000000..dfe1000 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/titanium_ingot_from_ores.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:titanium_ores", + "c:titanium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:titanium_ores" + } + ], + "output": { + "priority": [ + "techreborn:titanium_ingot", + "modern_industrialization:titanium_ingot" + ], + "default": "c:titanium_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/titanium_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/titanium_ingot_from_raw_ores.json new file mode 100644 index 0000000..d85b595 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/titanium_ingot_from_raw_ores.json @@ -0,0 +1,33 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_titanium_ores", + "c:titanium_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_titanium_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "techreborn:titanium_ingot", + "modern_industrialization:titanium_ingot" + ], + "default": "c:titanium_ingots", + "count": 2 + }, + "overrides": { + "2+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 10 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/tungsten_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/tungsten_ingot_from_ores.json new file mode 100644 index 0000000..2365bf2 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/tungsten_ingot_from_ores.json @@ -0,0 +1,33 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:tungsten_ores", + "c:tungsten_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:tungsten_ores" + } + ], + "output": { + "priority": [ + "techreborn:tungsten_ingot", + "indrev:tungsten_ingot", + "modern_industrialization:tungsten_ingot" + ], + "default": "c:tungsten_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 15 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/tungsten_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/tungsten_ingot_from_raw_ores.json new file mode 100644 index 0000000..0d330b8 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/tungsten_ingot_from_raw_ores.json @@ -0,0 +1,34 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_tungsten_ores", + "c:tungsten_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_tungsten_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "techreborn:tungsten_ingot", + "indrev:tungsten_ingot", + "modern_industrialization:tungsten_ingot" + ], + "default": "c:tungsten_ingots", + "count": 2 + }, + "overrides": { + "3+": { + "count": 3 + } + }, + "min_forge_tier": 2, + "fuel_per_tick": 15 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/zinc_ingot_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/zinc_ingot_from_ores.json new file mode 100644 index 0000000..d49018e --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/zinc_ingot_from_ores.json @@ -0,0 +1,34 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:zinc_ores", + "c:zinc_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:zinc_ores" + } + ], + "output": { + "priority": [ + "techreborn:zinc_ingot" + ], + "default": "c:zinc_ingots", + "count": 3 + }, + "overrides": { + "2": { + "count": 4 + }, + "3+": { + "count": 5 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/compat/zinc_ingot_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/compat/zinc_ingot_from_raw_ores.json new file mode 100644 index 0000000..5064a81 --- /dev/null +++ b/src/main/resources/data/alloy_forgery/recipes/compat/zinc_ingot_from_raw_ores.json @@ -0,0 +1,32 @@ +{ + "fabric:load_conditions": [ + { + "condition": "fabric:item_tags_populated", + "values": [ + "c:raw_zinc_ores", + "c:zinc_ingots" + ] + } + ], + "type": "alloy_forgery:forging", + "inputs": [ + { + "tag": "c:raw_zinc_ores", + "count": 2 + } + ], + "output": { + "priority": [ + "techreborn:zinc_ingot" + ], + "default": "c:zinc_ingots", + "count": 3 + }, + "overrides": { + "2+": { + "count": 4 + } + }, + "min_forge_tier": 1, + "fuel_per_tick": 5 +} \ No newline at end of file diff --git a/src/main/resources/data/alloy_forgery/recipes/copper_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/copper_from_raw_ores.json index 45f79fd..c42d7c8 100644 --- a/src/main/resources/data/alloy_forgery/recipes/copper_from_raw_ores.json +++ b/src/main/resources/data/alloy_forgery/recipes/copper_from_raw_ores.json @@ -2,10 +2,8 @@ "type": "alloy_forgery:forging", "inputs": [ { - "item": "minecraft:raw_copper" - }, - { - "item": "minecraft:raw_copper" + "tag": "c:raw_copper_ores", + "count": 2 } ], "output": { diff --git a/src/main/resources/data/alloy_forgery/recipes/gold_from_ores.json b/src/main/resources/data/alloy_forgery/recipes/gold_from_ores.json index eece010..4c26fc3 100644 --- a/src/main/resources/data/alloy_forgery/recipes/gold_from_ores.json +++ b/src/main/resources/data/alloy_forgery/recipes/gold_from_ores.json @@ -2,7 +2,7 @@ "type": "alloy_forgery:forging", "inputs": [ { - "tag": "minecraft:gold_ores" + "tag": "c:gold_ores" } ], "output": { diff --git a/src/main/resources/data/alloy_forgery/recipes/gold_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/gold_from_raw_ores.json index d49cd20..8862983 100644 --- a/src/main/resources/data/alloy_forgery/recipes/gold_from_raw_ores.json +++ b/src/main/resources/data/alloy_forgery/recipes/gold_from_raw_ores.json @@ -2,10 +2,8 @@ "type": "alloy_forgery:forging", "inputs": [ { - "item": "minecraft:raw_gold" - }, - { - "item": "minecraft:raw_gold" + "tag": "c:raw_gold_ores", + "count": 2 } ], "output": { diff --git a/src/main/resources/data/alloy_forgery/recipes/iron_from_raw_ores.json b/src/main/resources/data/alloy_forgery/recipes/iron_from_raw_ores.json index a8993a3..9230b50 100644 --- a/src/main/resources/data/alloy_forgery/recipes/iron_from_raw_ores.json +++ b/src/main/resources/data/alloy_forgery/recipes/iron_from_raw_ores.json @@ -2,10 +2,8 @@ "type": "alloy_forgery:forging", "inputs": [ { - "item": "minecraft:raw_iron" - }, - { - "item": "minecraft:raw_iron" + "tag": "c:raw_iron_ores", + "count": 2 } ], "output": { diff --git a/src/main/resources/data/alloy_forgery/recipes/netherite_from_gold_and_scrap.json b/src/main/resources/data/alloy_forgery/recipes/netherite_from_gold_and_scrap.json index 83839a0..1daffa1 100644 --- a/src/main/resources/data/alloy_forgery/recipes/netherite_from_gold_and_scrap.json +++ b/src/main/resources/data/alloy_forgery/recipes/netherite_from_gold_and_scrap.json @@ -2,28 +2,12 @@ "type": "alloy_forgery:forging", "inputs": [ { - "item": "minecraft:gold_ingot" + "item": "minecraft:gold_ingot", + "count": 4 }, { - "item": "minecraft:gold_ingot" - }, - { - "item": "minecraft:gold_ingot" - }, - { - "item": "minecraft:gold_ingot" - }, - { - "item": "minecraft:netherite_scrap" - }, - { - "item": "minecraft:netherite_scrap" - }, - { - "item": "minecraft:netherite_scrap" - }, - { - "item": "minecraft:netherite_scrap" + "item": "minecraft:netherite_scrap", + "count": 4 } ], "output": { diff --git a/src/main/resources/data/c/items/gold_ores.json b/src/main/resources/data/c/items/gold_ores.json new file mode 100644 index 0000000..ec42ee5 --- /dev/null +++ b/src/main/resources/data/c/items/gold_ores.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:gold_ore" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/items/raw_gold_ores.json b/src/main/resources/data/c/items/raw_gold_ores.json new file mode 100644 index 0000000..3ac7724 --- /dev/null +++ b/src/main/resources/data/c/items/raw_gold_ores.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:raw_gold" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/items/raw_iron_ores.json b/src/main/resources/data/c/items/raw_iron_ores.json new file mode 100644 index 0000000..9c07274 --- /dev/null +++ b/src/main/resources/data/c/items/raw_iron_ores.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:raw_iron" + ] +} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e547787..52fd17c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -3,7 +3,7 @@ "id": "alloy_forgery", "version": "${version}", "name": "Alloy Forgery", - "description": "Configurable, data-driven alloy forges for all your smelting needs", + "description": "Configurable, data-driven Alloy Forges for all your smelting needs", "authors": [ "glisco" ], @@ -27,8 +27,11 @@ "main": [ "wraith.alloyforgery.AlloyForgery" ], - "rei_plugins": [ - "wraith.alloyforgery.compat.rei.AlloyForgeryPlugin" + "rei_client": [ + "wraith.alloyforgery.compat.rei.AlloyForgeryClientPlugin" + ], + "rei_common": [ + "wraith.alloyforgery.compat.rei.AlloyForgeryCommonPlugin" ] }, "mixins": [ @@ -38,7 +41,7 @@ "fabricloader": ">=0.10", "fabric": "*", "minecraft": ">=1.18.2", - "owo": ">=0.5.4" + "owo": ">0.7.1" }, "suggests": { "roughlyenoughitems": ">=8.0.0"