From 1c58b45e6e3cd0cbb77f38acd3c276527c607c8c Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sat, 24 Feb 2024 20:17:36 +0100 Subject: [PATCH] Fixed creative vending upgrades using the base stack, closes #239 --- .github/workflows/publish.yaml | 2 +- build.gradle | 6 +++--- .../functionalstorage/inventory/BigInventoryHandler.java | 2 +- .../inventory/CompactingInventoryHandler.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 39005f7c..9669b54e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -24,7 +24,7 @@ jobs: - name: build run: ./gradlew build - name: Publish Minecraft Mods Forge - uses: Kir-Antipov/mc-publish@v3.2 + uses: Kir-Antipov/mc-publish@v3.3.0 with: curseforge-id: 556861 modrinth-id: cO40ZIg3 diff --git a/build.gradle b/build.gradle index 88d905d3..71029458 100644 --- a/build.gradle +++ b/build.gradle @@ -90,10 +90,10 @@ dependencies { minecraft 'net.minecraftforge:forge:1.20.1-47.1.1' implementation fg.deobf(project.dependencies.create('com.hrznstudio:titanium:1.20.1-3.8.1-9')) - compileOnly fg.deobf("mezz.jei:jei-1.20.1-common-api:15.2.0.20") - compileOnly fg.deobf("mezz.jei:jei-1.20.1-forge-api:15.2.0.20") + compileOnly fg.deobf("mezz.jei:jei-1.20.1-common-api:15.2.0.23") + compileOnly fg.deobf("mezz.jei:jei-1.20.1-forge-api:15.2.0.23") // at runtime, use the full JEI jar for Forge - runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:15.2.0.20") + runtimeOnly fg.deobf("mezz.jei:jei-1.20.1-forge:15.2.0.23") implementation fg.deobf("curse.maven:the-one-probe-245211:4613250") implementation fg.deobf("curse.maven:mekanism-268560:4866575") annotationProcessor "org.spongepowered:mixin:0.8.5:processor" diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java index 0ba92635..cc29ce05 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/BigInventoryHandler.java @@ -71,7 +71,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { if (slot < type.getSlots()){ BigStack bigStack = this.storedStacks.get(slot); if (bigStack.getStack().isEmpty()) return ItemStack.EMPTY; - if (bigStack.getAmount() <= amount) { + if (!isCreative() && bigStack.getAmount() <= amount) { ItemStack out = bigStack.getStack().copy(); int newAmount = bigStack.getAmount(); if (!simulate && !isCreative()) { diff --git a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java index 578f561b..30617ef6 100644 --- a/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java +++ b/src/main/java/com/buuz135/functionalstorage/inventory/CompactingInventoryHandler.java @@ -117,7 +117,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { CompactingUtil.Result bigStack = this.resultList.get(slot); if (bigStack.getResult().isEmpty()) return ItemStack.EMPTY; int stackAmount = bigStack.getNeeded() * amount; - if (stackAmount >= this.amount) { + if (!isCreative() && stackAmount >= this.amount) { ItemStack out = bigStack.getResult().copy(); int newAmount = (int) Math.floor(this.amount / bigStack.getNeeded()); if (!simulate && !isCreative()) {