From 7d3e4d313dfe2e82e5955e16ba862316fec58ad0 Mon Sep 17 00:00:00 2001 From: AlcatrazEscapee Date: Wed, 30 Nov 2022 18:59:19 -0500 Subject: [PATCH] 1.19 port: fix various regressions. --- .../common/container/SmallVesselContainer.java | 11 +++++++++++ .../util/inventory/InventorySlot.java | 18 ++++++++++++++++++ .../assets/notreepunching/lang/en_us.json | 1 + Data/main.py | 3 ++- Fabric/src/main/resources/fabric.mod.json | 2 +- settings.gradle | 2 +- 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Common/src/main/java/com/alcatrazescapee/notreepunching/common/container/SmallVesselContainer.java b/Common/src/main/java/com/alcatrazescapee/notreepunching/common/container/SmallVesselContainer.java index 329919d..d381c23 100644 --- a/Common/src/main/java/com/alcatrazescapee/notreepunching/common/container/SmallVesselContainer.java +++ b/Common/src/main/java/com/alcatrazescapee/notreepunching/common/container/SmallVesselContainer.java @@ -6,6 +6,7 @@ import com.alcatrazescapee.notreepunching.common.items.SmallVesselItem; import com.alcatrazescapee.notreepunching.util.inventory.InventorySlot; import com.alcatrazescapee.notreepunching.util.inventory.ItemStackAttachedInventory; +import net.minecraft.world.item.ItemStack; public final class SmallVesselContainer extends ItemStackContainer { @@ -15,6 +16,16 @@ public SmallVesselContainer(int windowId, Inventory playerInventory, Interaction init(playerInventory); } + @Override + protected boolean moveStack(ItemStack stack, int slotIndex) + { + return switch (typeOf(slotIndex)) + { + case MAIN_INVENTORY, HOTBAR -> !moveItemStackTo(stack, 0, SmallVesselItem.SLOTS, false); + case CONTAINER -> !moveItemStackTo(stack, containerSlots, slots.size(), false); + }; + } + @Override protected void addContainerSlots() { diff --git a/Common/src/main/java/com/alcatrazescapee/notreepunching/util/inventory/InventorySlot.java b/Common/src/main/java/com/alcatrazescapee/notreepunching/util/inventory/InventorySlot.java index 10b06a6..4361524 100644 --- a/Common/src/main/java/com/alcatrazescapee/notreepunching/util/inventory/InventorySlot.java +++ b/Common/src/main/java/com/alcatrazescapee/notreepunching/util/inventory/InventorySlot.java @@ -38,6 +38,24 @@ public void set(ItemStack stack) inventory.set(slot, stack); } + @Override + public void initialize(ItemStack stack) + { + inventory.set(slot, stack); + } + + @Override + public void setChanged() + { + inventory.modified(); + } + + @Override + public int getMaxStackSize() + { + return 64; + } + @Override public ItemStack remove(int amount) { diff --git a/Common/src/main/resources/assets/notreepunching/lang/en_us.json b/Common/src/main/resources/assets/notreepunching/lang/en_us.json index 1545b51..e140db5 100644 --- a/Common/src/main/resources/assets/notreepunching/lang/en_us.json +++ b/Common/src/main/resources/assets/notreepunching/lang/en_us.json @@ -3,6 +3,7 @@ "itemGroup.notreepunching.items": "No Tree Punching", "notreepunching.tooltip.small_vessel_more": "%d More...", "notreepunching.block_entity.large_vessel": "Large Vessel", + "notreepunching.subtitle.knapping": "Rock smacks", "block.notreepunching.granite_cobblestone": "Granite Cobblestone", "block.notreepunching.granite_cobblestone_stairs": "Granite Cobblestone Stairs", "block.notreepunching.granite_cobblestone_slab": "Granite Cobblestone Slab", diff --git a/Data/main.py b/Data/main.py index 30d7252..09d3c15 100644 --- a/Data/main.py +++ b/Data/main.py @@ -44,7 +44,8 @@ def do_assets(common: ResourceManager): common.lang({ 'itemGroup.notreepunching.items': 'No Tree Punching', 'notreepunching.tooltip.small_vessel_more': '%d More...', - 'notreepunching.block_entity.large_vessel': 'Large Vessel' + 'notreepunching.block_entity.large_vessel': 'Large Vessel', + 'notreepunching.subtitle.knapping': 'Rock smacks' }) # Stone diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index 8ad3122..fc18cdf 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -29,7 +29,7 @@ "depends": { "fabricloader": ">=0.13", "fabric": "*", - "minecraft": "1.18.x", + "minecraft": "1.19.x", "java": ">=17" } } diff --git a/settings.gradle b/settings.gradle index a7ad899..37a93e4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,5 +15,5 @@ pluginManagement { } } -rootProject.name = 'NoTreePunching-1.18' +rootProject.name = "NoTreePunching-1.19" include("Common", "Fabric", "Forge") \ No newline at end of file