InventoryTweaks compat for pouches!
This commit is contained in:
parent
422626a846
commit
4e4f7b1fbd
4 changed files with 42 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ minecraft{
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
deobfCompile "mezz.jei:jei_1.8.9:2.13.3.58"
|
deobfCompile "mezz.jei:jei_1.8.9:2.16.1.77"
|
||||||
}
|
}
|
||||||
|
|
||||||
task deobfJar(type: Jar) {
|
task deobfJar(type: Jar) {
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,13 @@ package com.oitsjustjose.criss_cross.container;
|
||||||
|
|
||||||
import com.oitsjustjose.criss_cross.lib.LibItems;
|
import com.oitsjustjose.criss_cross.lib.LibItems;
|
||||||
|
|
||||||
|
import invtweaks.api.container.ChestContainer;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@ChestContainer(isLargeChest = true)
|
||||||
public class ContainerPouch extends Container
|
public class ContainerPouch extends Container
|
||||||
{
|
{
|
||||||
private EntityPlayer player = null;
|
private EntityPlayer player = null;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public class ScribeRecipeMaker
|
||||||
ScribeRecipes scribeRecipes = ScribeRecipes.getInstance();
|
ScribeRecipes scribeRecipes = ScribeRecipes.getInstance();
|
||||||
Map<ItemStack, ItemStack> scribeMap = getMap(scribeRecipes);
|
Map<ItemStack, ItemStack> scribeMap = getMap(scribeRecipes);
|
||||||
|
|
||||||
List<ScribeRecipeJEI> recipes = new ArrayList<>();
|
List<ScribeRecipeJEI> recipes = new ArrayList<ScribeRecipeJEI>();
|
||||||
|
|
||||||
for (Map.Entry<ItemStack, ItemStack> entry : scribeMap.entrySet())
|
for (Map.Entry<ItemStack, ItemStack> entry : scribeMap.entrySet())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
38
src/main/java/invtweaks/api/container/ChestContainer.java
Normal file
38
src/main/java/invtweaks/api/container/ChestContainer.java
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
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 have a chest-like persistent storage component. Enables the Inventory Tweaks sorting
|
||||||
|
* buttons for this container.
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
public @interface ChestContainer {
|
||||||
|
// Set to true if the Inventory Tweaks sorting buttons should be shown for this container.
|
||||||
|
boolean showButtons() default true;
|
||||||
|
|
||||||
|
// Size of a chest row
|
||||||
|
int rowSize() default 9;
|
||||||
|
|
||||||
|
// Uses 'large chest' mode for sorting buttons
|
||||||
|
// (Renders buttons vertically down the right side of the GUI)
|
||||||
|
boolean isLargeChest() default false;
|
||||||
|
|
||||||
|
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
|
||||||
|
// Signature int func()
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@interface RowSizeCallback {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Annotation for method to get size of a chest row if it is not a fixed size for this container class
|
||||||
|
// Signature int func()
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@interface IsLargeCallback {
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue