add test stack for stack type (#1211)

Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
lc-1337andMartin Robertz authored and GitHub committed 2026-04-18 21:27:29 +02:00
1 parent 21fbbd0a3a
commit 3288f8f2e7
3 files changed
+24

No files matched your search

@@ -103,4 +103,6 @@ public interface IAEStackType<T extends IAEStack> {
*/
@SideOnly(Side.CLIENT)
IIcon getButtonIcon();
T getTestStack();
}
@@ -1,7 +1,9 @@
package appeng.util.item;
import java.io.IOException;
import java.util.Objects;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
@@ -201,4 +203,14 @@ public class AEFluidStackType implements IAEStackType<IAEFluidStack> {
}
};
}
@NotNull
private final IAEFluidStack testStack = Objects
.requireNonNull(this.getStackFromContainerItem(new ItemStack(Items.water_bucket, 1)));
@Override
@NotNull
public IAEFluidStack getTestStack() {
return this.testStack.copy();
}
}
@@ -2,6 +2,7 @@ package appeng.util.item;
import java.io.IOException;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
@@ -168,4 +169,13 @@ public class AEItemStackType implements IAEStackType<IAEItemStack> {
}
};
}
@NotNull
private final IAEItemStack testStack = AEItemStack.create(new ItemStack(Blocks.fire));
@Override
@NotNull
public IAEItemStack getTestStack() {
return this.testStack.copy();
}
}