Fix JABBA-related issues with crafting station slots (#54)

* Fix shift-merging tools voiding items

fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392>

* Change 0-sized ItemStacks into null stacks in crafting station attached slots

Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425>

* Update buildscript

* spotlessApply
This commit is contained in:
Raven Szewczyk authored and GitHub committed 2022-09-22 20:51:23 +02:00
1 parent 18bfeaff32
commit 39be06c23b
571 files changed
+25959 -28223

No files matched your search

@@ -10,58 +10,47 @@ import net.minecraftforge.oredict.RecipeSorter;
import tconstruct.TConstruct;
import tconstruct.library.tools.ToolCore;
public class ShapelessToolRecipe extends ShapelessRecipes
{
public class ShapelessToolRecipe extends ShapelessRecipes {
static {
RecipeSorter.register(TConstruct.modID + ":" + "toolrecipe", ShapelessToolRecipe.class, RecipeSorter.Category.SHAPELESS, "");
RecipeSorter.register(
TConstruct.modID + ":" + "toolrecipe", ShapelessToolRecipe.class, RecipeSorter.Category.SHAPELESS, "");
}
public ShapelessToolRecipe(ItemStack par1ItemStack, List par2List)
{
public ShapelessToolRecipe(ItemStack par1ItemStack, List par2List) {
super(par1ItemStack, par2List);
}
@Override
public boolean matches (InventoryCrafting par1InventoryCrafting, World par2World)
{
public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) {
ArrayList arraylist = new ArrayList(this.recipeItems);
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
{
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
ItemStack itemstack = par1InventoryCrafting.getStackInRowAndColumn(j, i);
if (itemstack != null)
{
if (itemstack != null) {
boolean flag = false;
Iterator iterator = arraylist.iterator();
while (iterator.hasNext())
{
while (iterator.hasNext()) {
ItemStack itemstack1 = (ItemStack) iterator.next();
// TConstruct.logger.info("Rawr! "+itemstack1.getItemDamage());
if (itemstack.getItem() == itemstack1.getItem())
{
if (itemstack.getItem() instanceof ToolCore)
{
if (itemstack.getItem() == itemstack1.getItem()) {
if (itemstack.getItem() instanceof ToolCore) {
NBTTagCompound tags = itemstack.getTagCompound().getCompoundTag("InfiTool");
if (tags.getBoolean("Broken"))
return false;
if (tags.getBoolean("Broken")) return false;
flag = true;
}
else if((itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage()))
flag = true;
} else if ((itemstack1.getItemDamage() == Short.MAX_VALUE
|| itemstack.getItemDamage() == itemstack1.getItemDamage())) flag = true;
arraylist.remove(itemstack1);
break;
}
}
if (!flag)
{
if (!flag) {
return false;
}
}
@@ -70,5 +59,4 @@ public class ShapelessToolRecipe extends ShapelessRecipes
return arraylist.isEmpty();
}
}