From 5ccbc0b9fde6abb0c16ea959a127407a8b53fb98 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 28 May 2017 00:48:01 +0200 Subject: [PATCH] add crafting table on a stick compat for InvTweaks Closes #782 --- .../mod/inventory/ContainerCrafter.java | 3 ++- .../api/container/InventoryContainer.java | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/main/java/invtweaks/api/container/InventoryContainer.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java index 02f021114..4542a9638 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java @@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.inventory; import de.ellpeck.actuallyadditions.mod.util.StackUtil; +import invtweaks.api.container.InventoryContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.*; @@ -19,7 +20,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; - +@InventoryContainer public class ContainerCrafter extends Container{ public final World world; diff --git a/src/main/java/invtweaks/api/container/InventoryContainer.java b/src/main/java/invtweaks/api/container/InventoryContainer.java new file mode 100644 index 000000000..b3614d278 --- /dev/null +++ b/src/main/java/invtweaks/api/container/InventoryContainer.java @@ -0,0 +1,20 @@ +package invtweaks.api.container; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * A marker for containers that need special treatment, such as crafting inputs or alternate player inventory positions, + * but do not have a chest-like component. + *

+ * Does not enable the Inventory Tweaks sorting buttons for this container. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface InventoryContainer { + // Set to true if the Inventory Tweaks options button should be shown for this container. + // (For instance, if you are replacing a vanilla container such as the player's inventory) + boolean showOptions() default true; +}