mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 20:52:26 +00:00
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:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -5,89 +5,69 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.crafting.*;
|
||||
|
||||
public class CraftingRecipeHelper
|
||||
{
|
||||
public static void removeShapedRecipes (List<ItemStack> removelist)
|
||||
{
|
||||
for (ItemStack stack : removelist)
|
||||
removeShapedRecipe(stack);
|
||||
public class CraftingRecipeHelper {
|
||||
public static void removeShapedRecipes(List<ItemStack> removelist) {
|
||||
for (ItemStack stack : removelist) removeShapedRecipe(stack);
|
||||
}
|
||||
|
||||
public static void removeAnyRecipe (ItemStack resultItem)
|
||||
{
|
||||
public static void removeAnyRecipe(ItemStack resultItem) {
|
||||
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (int i = 0; i < recipes.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < recipes.size(); i++) {
|
||||
IRecipe tmpRecipe = recipes.get(i);
|
||||
ItemStack recipeResult = tmpRecipe.getRecipeOutput();
|
||||
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
|
||||
{
|
||||
if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) {
|
||||
recipes.remove(i--);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeShapedRecipe (ItemStack resultItem)
|
||||
{
|
||||
public static void removeShapedRecipe(ItemStack resultItem) {
|
||||
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (int i = 0; i < recipes.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < recipes.size(); i++) {
|
||||
IRecipe tmpRecipe = recipes.get(i);
|
||||
if (tmpRecipe instanceof ShapedRecipes)
|
||||
{
|
||||
if (tmpRecipe instanceof ShapedRecipes) {
|
||||
ShapedRecipes recipe = (ShapedRecipes) tmpRecipe;
|
||||
ItemStack recipeResult = recipe.getRecipeOutput();
|
||||
|
||||
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
|
||||
{
|
||||
if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) {
|
||||
recipes.remove(i--);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeShapelessRecipe (ItemStack resultItem)
|
||||
{
|
||||
public static void removeShapelessRecipe(ItemStack resultItem) {
|
||||
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
|
||||
for (int i = 0; i < recipes.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < recipes.size(); i++) {
|
||||
IRecipe tmpRecipe = recipes.get(i);
|
||||
if (tmpRecipe instanceof ShapelessRecipes)
|
||||
{
|
||||
if (tmpRecipe instanceof ShapelessRecipes) {
|
||||
ShapelessRecipes recipe = (ShapelessRecipes) tmpRecipe;
|
||||
ItemStack recipeResult = recipe.getRecipeOutput();
|
||||
|
||||
if (ItemStack.areItemStacksEqual(resultItem, recipeResult))
|
||||
{
|
||||
if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) {
|
||||
recipes.remove(i--);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void addShapedRecipeFirst (List recipeList, ItemStack itemstack, Object... objArray)
|
||||
{
|
||||
public static void addShapedRecipeFirst(List recipeList, ItemStack itemstack, Object... objArray) {
|
||||
String var3 = "";
|
||||
int var4 = 0;
|
||||
int var5 = 0;
|
||||
int var6 = 0;
|
||||
|
||||
if (objArray[var4] instanceof String[])
|
||||
{
|
||||
if (objArray[var4] instanceof String[]) {
|
||||
String[] var7 = ((String[]) objArray[var4++]);
|
||||
|
||||
for (int var8 = 0; var8 < var7.length; ++var8)
|
||||
{
|
||||
for (int var8 = 0; var8 < var7.length; ++var8) {
|
||||
String var9 = var7[var8];
|
||||
++var6;
|
||||
var5 = var9.length();
|
||||
var3 = var3 + var9;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (objArray[var4] instanceof String)
|
||||
{
|
||||
} else {
|
||||
while (objArray[var4] instanceof String) {
|
||||
String var11 = (String) objArray[var4++];
|
||||
++var6;
|
||||
var5 = var11.length();
|
||||
@@ -97,21 +77,15 @@ public class CraftingRecipeHelper
|
||||
|
||||
HashMap var12;
|
||||
|
||||
for (var12 = new HashMap(); var4 < objArray.length; var4 += 2)
|
||||
{
|
||||
for (var12 = new HashMap(); var4 < objArray.length; var4 += 2) {
|
||||
Character var13 = (Character) objArray[var4];
|
||||
ItemStack var14 = null;
|
||||
|
||||
if (objArray[var4 + 1] instanceof Item)
|
||||
{
|
||||
if (objArray[var4 + 1] instanceof Item) {
|
||||
var14 = new ItemStack((Item) objArray[var4 + 1]);
|
||||
}
|
||||
else if (objArray[var4 + 1] instanceof Block)
|
||||
{
|
||||
} else if (objArray[var4 + 1] instanceof Block) {
|
||||
var14 = new ItemStack((Block) objArray[var4 + 1], 1, Short.MAX_VALUE);
|
||||
}
|
||||
else if (objArray[var4 + 1] instanceof ItemStack)
|
||||
{
|
||||
} else if (objArray[var4 + 1] instanceof ItemStack) {
|
||||
var14 = (ItemStack) objArray[var4 + 1];
|
||||
}
|
||||
|
||||
@@ -120,16 +94,12 @@ public class CraftingRecipeHelper
|
||||
|
||||
ItemStack[] var15 = new ItemStack[var5 * var6];
|
||||
|
||||
for (int var16 = 0; var16 < var5 * var6; ++var16)
|
||||
{
|
||||
for (int var16 = 0; var16 < var5 * var6; ++var16) {
|
||||
char var10 = var3.charAt(var16);
|
||||
|
||||
if (var12.containsKey(Character.valueOf(var10)))
|
||||
{
|
||||
if (var12.containsKey(Character.valueOf(var10))) {
|
||||
var15[var16] = ((ItemStack) var12.get(Character.valueOf(var10))).copy();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
var15[var16] = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user