remove itemstages blocking item crafting
This commit is contained in:
@@ -570,9 +570,9 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
|
|||||||
stack = ((SlotME) slot).getAEStack();
|
stack = ((SlotME) slot).getAEStack();
|
||||||
|
|
||||||
if (stack != null
|
if (stack != null
|
||||||
&& action == InventoryAction.PICKUP_OR_SET_DOWN
|
&& action == InventoryAction.PICKUP_OR_SET_DOWN
|
||||||
&& (stack.getStackSize() == 0 || GuiScreen.isAltKeyDown())
|
&& (stack.getStackSize() == 0 || GuiScreen.isAltKeyDown())
|
||||||
&& player.inventory.getItemStack().isEmpty()) {
|
&& player.inventory.getItemStack().isEmpty()) {
|
||||||
action = InventoryAction.AUTO_CRAFT;
|
action = InventoryAction.AUTO_CRAFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -935,6 +935,7 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain
|
|||||||
}
|
}
|
||||||
} else if (s instanceof AppEngSlot) {
|
} else if (s instanceof AppEngSlot) {
|
||||||
AppEngSlot appEngSlot = ((AppEngSlot) s);
|
AppEngSlot appEngSlot = ((AppEngSlot) s);
|
||||||
|
if (s.getStack().isEmpty()) return;
|
||||||
appEngSlot.setDisplay(true);
|
appEngSlot.setDisplay(true);
|
||||||
appEngSlot.setReturnAsSingleStack(true);
|
appEngSlot.setReturnAsSingleStack(true);
|
||||||
|
|
||||||
|
|||||||
@@ -97,26 +97,9 @@ public class SlotCraftingTerm extends AppEngCraftingSlot {
|
|||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't render the item client-side if the item stage for it is not unlocked yet
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getStack() {
|
public boolean shouldDisplay() {
|
||||||
if (Platform.isClient() && Loader.isModLoaded("itemstages")) {
|
return !getStack().isEmpty();
|
||||||
return itemstageStack();
|
|
||||||
}
|
|
||||||
return super.getStack();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
ItemStack itemstageStack() {
|
|
||||||
final ItemStack item = super.getStack();
|
|
||||||
final String itemsStage = ItemStages.getStage(item);
|
|
||||||
final String enchantStage = ItemStages.getEnchantStage(item);
|
|
||||||
final EntityPlayer player = Minecraft.getMinecraft().player;
|
|
||||||
|
|
||||||
if ((itemsStage != null && !GameStageHelper.hasStage(player, itemsStage))
|
|
||||||
|| (enchantStage != null && !GameStageHelper.hasStage(player, enchantStage)))
|
|
||||||
return ItemStack.EMPTY;
|
|
||||||
return super.getStack();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doClick(final InventoryAction action, final EntityPlayer who) {
|
public void doClick(final InventoryAction action, final EntityPlayer who) {
|
||||||
@@ -196,15 +179,6 @@ public class SlotCraftingTerm extends AppEngCraftingSlot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Loader.isModLoaded("itemstages")) {
|
|
||||||
final String itemsStage = ItemStages.getStage(recipe.getRecipeOutput());
|
|
||||||
final String enchantStage = ItemStages.getEnchantStage(recipe.getRecipeOutput());
|
|
||||||
|
|
||||||
if ((itemsStage != null && !GameStageHelper.hasStage(player, itemsStage))
|
|
||||||
|| (enchantStage != null && !GameStageHelper.hasStage(player, enchantStage)))
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return recipe;
|
return recipe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user