Skip to content

Commit

Permalink
1.19 port: fix various regressions.
Browse files Browse the repository at this point in the history
  • Loading branch information
alcatrazEscapee committed Nov 30, 2022
1 parent d20ca10 commit 7d3e4d3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion Data/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"depends": {
"fabricloader": ">=0.13",
"fabric": "*",
"minecraft": "1.18.x",
"minecraft": "1.19.x",
"java": ">=17"
}
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ pluginManagement {
}
}

rootProject.name = 'NoTreePunching-1.18'
rootProject.name = "NoTreePunching-1.19"
include("Common", "Fabric", "Forge")

0 comments on commit 7d3e4d3

Please sign in to comment.