Compare commits

..

11 Commits

Author SHA1 Message Date
PrototypeTrousers 66ab022c95 package patterns 2023-02-08 21:18:51 -03:00
PrototypeTrousers ab1f519401 allow wireless pattern terminal to switch substitution modes 2023-02-08 21:17:56 -03:00
Roman Hubenkov d06a70ee22 Update ru_ru.lang (#218)
* Update ru_ru.lang
2023-02-08 13:58:54 -03:00
PrototypeTrousers 422f9faf76 fix jei and tall interface terminal button overlapping 2023-02-08 13:58:04 -03:00
PrototypeTrousers 96ab73001b fix craftables not working when wireless terminal not being held
remove wrong imports
add missing lang entries
2023-02-08 12:14:36 -03:00
PrototypeTrousers 854676a33c terminal fixes + better formatting 2023-02-06 18:38:44 -03:00
PrototypeTrousers 7f76723da5 Merge branch 'WiFi-Terminals' into AE2-Omnifactory 2023-02-06 13:28:27 -03:00
PrototypeTrousers 3fc7cf0247 Merge branch 'cell-tooltips' into AE2-Omnifactory 2023-02-06 13:28:23 -03:00
PrototypeTrousers b377dfdd69 Merge branch 'bogofix' into AE2-Omnifactory 2023-02-06 13:28:17 -03:00
PrototypeTrousers ff1091d252 add toolitps to cells 2023-02-06 13:26:59 -03:00
PrototypeTrousers 7ab89a0657 update bogosort compat 2023-02-05 23:03:34 -03:00
29 changed files with 403 additions and 155 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ aebuild=7
aegroup=appeng aegroup=appeng
aebasename=appliedenergistics2 aebasename=appliedenergistics2
extended=extended_life extended=extended_life
extendedversion=v0.54.20 extendedversion=v0.55.2
######################################################### #########################################################
# Versions # # Versions #
######################################################### #########################################################
+1 -1
View File
@@ -107,7 +107,7 @@ dependencies {
compileOnly "cofh:CoFHCore:${cofhcore_version}:deobf" compileOnly "cofh:CoFHCore:${cofhcore_version}:deobf"
compileOnly "CraftTweaker2:CraftTweaker2-API:${crafttweaker_version}" compileOnly "CraftTweaker2:CraftTweaker2-API:${crafttweaker_version}"
compileOnly "curse.maven:inventory-tweaks-223094:2482482" compileOnly "curse.maven:inventory-tweaks-223094:2482482"
compileOnly "curse.maven:inventory-bogo-sorter-632327:3975184" compileOnly "curse.maven:inventory-bogo-sorter-632327:4329854"
compileOnly "team.chisel.ctm:CTM:${ctm_version}" compileOnly "team.chisel.ctm:CTM:${ctm_version}"
compileOnly "de.ellpeck.actuallyadditions:ActuallyAdditions:1.12.2-r152.16:api" compileOnly "de.ellpeck.actuallyadditions:ActuallyAdditions:1.12.2-r152.16:api"
deobfCompile "net.sengir.forestry:forestry_${minecraft_version}:$forestry_version" deobfCompile "net.sengir.forestry:forestry_${minecraft_version}:$forestry_version"
@@ -0,0 +1,5 @@
package appeng.api.config;
public enum Packaging {
ENABLED, DISABLED;
}
@@ -37,82 +37,86 @@ import java.util.List;
/** /**
* do not implement provided by {@link ICraftingPatternItem} * do not implement provided by {@link ICraftingPatternItem}
* * <p>
* caching this INSTANCE will increase performance of validation and checks. * caching this INSTANCE will increase performance of validation and checks.
*/ */
public interface ICraftingPatternDetails public interface ICraftingPatternDetails {
{
/** /**
* @return source item. * @return source item.
*/ */
ItemStack getPattern(); ItemStack getPattern();
/** /**
* @param slotIndex specific slot index * @param slotIndex specific slot index
* @param itemStack item in slot * @param itemStack item in slot
* @param world crafting world * @param world crafting world
* * @return if an item can be used in the specific slot for this pattern.
* @return if an item can be used in the specific slot for this pattern. */
*/ boolean isValidItemForSlot(int slotIndex, ItemStack itemStack, World world);
boolean isValidItemForSlot( int slotIndex, ItemStack itemStack, World world );
/** /**
* @return if this pattern is a crafting pattern ( work bench ) * @return if this pattern is a crafting pattern ( work bench )
*/ */
boolean isCraftable(); boolean isCraftable();
/** /**
* @return a list of the inputs, will include nulls. * @return a list of the inputs, will include nulls.
*/ */
IAEItemStack[] getInputs(); IAEItemStack[] getInputs();
/** /**
* @return a list of the inputs, will be clean * @return a list of the inputs, will be clean
*/ */
IAEItemStack[] getCondensedInputs(); IAEItemStack[] getCondensedInputs();
/** /**
* @return a list of the outputs, will be clean * @return a list of the outputs, will be clean
*/ */
IAEItemStack[] getCondensedOutputs(); IAEItemStack[] getCondensedOutputs();
/** /**
* @return a list of the outputs, will include nulls. * @return a list of the outputs, will include nulls.
*/ */
IAEItemStack[] getOutputs(); IAEItemStack[] getOutputs();
/** /**
* @return if this pattern is enabled to support substitutions. * @return if this pattern is enabled to support substitutions.
*/ */
boolean canSubstitute(); boolean canSubstitute();
default List<IAEItemStack> getSubstituteInputs( int slot ) default List<IAEItemStack> getSubstituteInputs(int slot) {
{ return Collections.emptyList();
return Collections.emptyList(); }
}
/** /**
* Allow using this INSTANCE of the pattern details to preform the crafting action with performance enhancements. * Allow using this INSTANCE of the pattern details to preform the crafting action with performance enhancements.
* *
* @param craftingInv inventory * @param craftingInv inventory
* @param world crafting world * @param world crafting world
* * @return the crafted ( work bench ) item.
* @return the crafted ( work bench ) item. */
*/ ItemStack getOutput(InventoryCrafting craftingInv, World world);
ItemStack getOutput( InventoryCrafting craftingInv, World world );
/** /**
* Get the priority of this pattern * Get the priority of this pattern
* *
* @return the priority of this pattern * @return the priority of this pattern
*/ */
int getPriority(); int getPriority();
/** /**
* Set the priority the of this pattern. * Set the priority the of this pattern.
* *
* @param priority priority of pattern * @param priority priority of pattern
*/ */
void setPriority( int priority ); void setPriority(int priority);
/**
* @return if this pattern is a packaging pattern.
*/
default boolean isPackage() {
return false;
}
} }
+4 -4
View File
@@ -9,10 +9,10 @@ import static appeng.client.ClientHelper.KEY_CATEGORY;
public enum KeyBindings { public enum KeyBindings {
WT(new KeyBinding("open_wireless_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_T, KEY_CATEGORY)), WT(new KeyBinding("key.open_wireless_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_T, KEY_CATEGORY)),
WCT(new KeyBinding("open_wireless_crafting_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_E, KEY_CATEGORY)), WCT(new KeyBinding("key.open_wireless_crafting_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_E, KEY_CATEGORY)),
WPT(new KeyBinding("open_wireless_pattern_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_R, KEY_CATEGORY)), WPT(new KeyBinding("key.open_wireless_pattern_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_R, KEY_CATEGORY)),
WFT(new KeyBinding("open_wireless_fluid_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_F, KEY_CATEGORY)); WFT(new KeyBinding("key.open_wireless_fluid_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_F, KEY_CATEGORY));
private KeyBinding keyBinding; private KeyBinding keyBinding;
@@ -1,7 +1,7 @@
package appeng.client.gui.implementations; package appeng.client.gui.implementations;
import appeng.api.config.ActionItems; import appeng.api.config.ActionItems;
import appeng.api.config.ItemSubstitution; import appeng.api.config.Packaging;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiImgButton;
@@ -36,6 +36,9 @@ public class GuiExpandedProcessingPatternTerm extends GuiMEMonitorable implement
private static final String SUBSITUTION_DISABLE = "0"; private static final String SUBSITUTION_DISABLE = "0";
private static final String SUBSITUTION_ENABLE = "1"; private static final String SUBSITUTION_ENABLE = "1";
private static final String PACKAGING_DISABLE = "0";
private static final String PACKAGING_ENABLE = "1";
private static final String CRAFTMODE_CRFTING = "1"; private static final String CRAFTMODE_CRFTING = "1";
private static final String CRAFTMODE_PROCESSING = "0"; private static final String CRAFTMODE_PROCESSING = "0";
@@ -52,10 +55,14 @@ public class GuiExpandedProcessingPatternTerm extends GuiMEMonitorable implement
private GuiImgButton divThreeBtn; private GuiImgButton divThreeBtn;
private GuiImgButton minusOneBtn; private GuiImgButton minusOneBtn;
private GuiImgButton maxCountBtn; private GuiImgButton maxCountBtn;
private GuiImgButton packagingEnabledBtn;
private GuiImgButton packagingDisabledBtn;
public Map<IGhostIngredientHandler.Target<?>, Object> mapTargetSlot = new HashMap<>(); public Map<IGhostIngredientHandler.Target<?>, Object> mapTargetSlot = new HashMap<>();
private ContainerExpandedProcessingPatternTerm container;
public GuiExpandedProcessingPatternTerm(final InventoryPlayer inventoryPlayer, final ITerminalHost te) { public GuiExpandedProcessingPatternTerm(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
super(inventoryPlayer, te, new ContainerExpandedProcessingPatternTerm(inventoryPlayer, te)); super(inventoryPlayer, te, new ContainerExpandedProcessingPatternTerm(inventoryPlayer, te));
this.container = (ContainerExpandedProcessingPatternTerm) this.inventorySlots;
this.setReservedSpace(81); this.setReservedSpace(81);
} }
@@ -112,6 +119,13 @@ public class GuiExpandedProcessingPatternTerm extends GuiMEMonitorable implement
if (this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn) { if (this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn) {
NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); NetworkHandler.instance().sendToServer(new PacketValueConfig("PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE));
} }
if (this.packagingEnabledBtn == btn || this.packagingDisabledBtn == btn) {
NetworkHandler.instance()
.sendToServer(
new PacketValueConfig("PatternTerminal.Package", this.packagingEnabledBtn == btn ? PACKAGING_DISABLE : PACKAGING_ENABLE));
}
} catch (final IOException e) { } catch (final IOException e) {
AELog.error(e); AELog.error(e);
} }
@@ -121,29 +135,26 @@ public class GuiExpandedProcessingPatternTerm extends GuiMEMonitorable implement
public void initGui() { public void initGui() {
super.initGui(); super.initGui();
this.tabCraftButton = new GuiTabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.getLocal(), this.itemRender);
this.buttonList.add(this.tabCraftButton);
this.tabProcessButton = new GuiTabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.getLocal(), this.itemRender); this.tabProcessButton = new GuiTabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.getLocal(), this.itemRender);
this.buttonList.add(this.tabProcessButton); this.buttonList.add(this.tabProcessButton);
this.substitutionsEnabledBtn = new GuiImgButton(this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED); this.packagingEnabledBtn = new GuiImgButton(this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, Packaging.ENABLED);
this.substitutionsEnabledBtn.setHalfSize(true); this.packagingEnabledBtn.setHalfSize(true);
this.buttonList.add(this.substitutionsEnabledBtn); this.buttonList.add(this.packagingEnabledBtn);
this.substitutionsDisabledBtn = new GuiImgButton(this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED); this.packagingDisabledBtn = new GuiImgButton(this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, Packaging.DISABLED);
this.substitutionsDisabledBtn.setHalfSize(true); this.packagingDisabledBtn.setHalfSize(true);
this.buttonList.add(this.substitutionsDisabledBtn); this.buttonList.add(this.packagingDisabledBtn);
this.clearBtn = new GuiImgButton(this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE); this.clearBtn = new GuiImgButton(this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE);
this.clearBtn.setHalfSize(true); this.clearBtn.setHalfSize(true);
this.buttonList.add(this.clearBtn); this.buttonList.add(this.clearBtn);
this.x3Btn = new GuiImgButton(this.guiLeft + 131, this.guiTop + this.ySize - 158, Settings.ACTIONS, ActionItems.MULTIPLY_BY_THREE); this.x3Btn = new GuiImgButton(this.guiLeft + 131, this.guiTop + this.ySize - 154, Settings.ACTIONS, ActionItems.MULTIPLY_BY_THREE);
this.x3Btn.setHalfSize(true); this.x3Btn.setHalfSize(true);
this.buttonList.add(this.x3Btn); this.buttonList.add(this.x3Btn);
this.x2Btn = new GuiImgButton(this.guiLeft + 131, this.guiTop + this.ySize - 148, Settings.ACTIONS, ActionItems.MULTIPLY_BY_TWO); this.x2Btn = new GuiImgButton(this.guiLeft + 131, this.guiTop + this.ySize - 144, Settings.ACTIONS, ActionItems.MULTIPLY_BY_TWO);
this.x2Btn.setHalfSize(true); this.x2Btn.setHalfSize(true);
this.buttonList.add(this.x2Btn); this.buttonList.add(this.x2Btn);
@@ -151,11 +162,11 @@ public class GuiExpandedProcessingPatternTerm extends GuiMEMonitorable implement
this.plusOneBtn.setHalfSize(true); this.plusOneBtn.setHalfSize(true);
this.buttonList.add(this.plusOneBtn); this.buttonList.add(this.plusOneBtn);
this.divThreeBtn = new GuiImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 158, Settings.ACTIONS, ActionItems.DIVIDE_BY_THREE); this.divThreeBtn = new GuiImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 154, Settings.ACTIONS, ActionItems.DIVIDE_BY_THREE);
this.divThreeBtn.setHalfSize(true); this.divThreeBtn.setHalfSize(true);
this.buttonList.add(this.divThreeBtn); this.buttonList.add(this.divThreeBtn);
this.divTwoBtn = new GuiImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 148, Settings.ACTIONS, ActionItems.DIVIDE_BY_TWO); this.divTwoBtn = new GuiImgButton(this.guiLeft + 87, this.guiTop + this.ySize - 144, Settings.ACTIONS, ActionItems.DIVIDE_BY_TWO);
this.divTwoBtn.setHalfSize(true); this.divTwoBtn.setHalfSize(true);
this.buttonList.add(this.divTwoBtn); this.buttonList.add(this.divTwoBtn);
@@ -173,16 +184,21 @@ public class GuiExpandedProcessingPatternTerm extends GuiMEMonitorable implement
@Override @Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) { public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.tabCraftButton.visible = false;
this.tabProcessButton.visible = true; this.tabProcessButton.visible = true;
this.substitutionsEnabledBtn.visible = false;
this.substitutionsDisabledBtn.visible = false;
this.x2Btn.visible = true; this.x2Btn.visible = true;
this.x3Btn.visible = true; this.x3Btn.visible = true;
this.divTwoBtn.visible = true; this.divTwoBtn.visible = true;
this.divThreeBtn.visible = true; this.divThreeBtn.visible = true;
this.plusOneBtn.visible = true; this.plusOneBtn.visible = true;
this.minusOneBtn.visible = true; this.minusOneBtn.visible = true;
if (this.container.packaging) {
this.packagingEnabledBtn.visible = true;
this.packagingDisabledBtn.visible = false;
} else {
this.packagingEnabledBtn.visible = false;
this.packagingDisabledBtn.visible = true;
}
//this.maxCountBtn.visible = true; //this.maxCountBtn.visible = true;
super.drawFG(offsetX, offsetY, mouseX, mouseY); super.drawFG(offsetX, offsetY, mouseX, mouseY);
@@ -50,6 +50,7 @@ import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fml.common.Loader;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import java.awt.*; import java.awt.*;
@@ -75,6 +76,8 @@ public class GuiInterfaceTerminal extends AEBaseGui {
private final int offsetX = 21; private final int offsetX = 21;
private int maxRows = Integer.MAX_VALUE; private int maxRows = Integer.MAX_VALUE;
protected int jeiOffset = Loader.isModLoaded("jei") ? 24 : 0;
private int reservedSpace = 0; private int reservedSpace = 0;
private final HashMap<Long, ClientDCInternalInv> byId = new HashMap<>(); private final HashMap<Long, ClientDCInternalInv> byId = new HashMap<>();
@@ -177,9 +180,9 @@ public class GuiInterfaceTerminal extends AEBaseGui {
@Override @Override
public List<Rectangle> getJEIExclusionArea() { public List<Rectangle> getJEIExclusionArea() {
Rectangle craftingCPUArea = new Rectangle(this.guiLeft - 18, this.guiTop, 18, 18); Rectangle tallButton = new Rectangle(this.guiLeft - 18, this.guiTop + 24 + jeiOffset, 18, 18);
List<Rectangle> area = new ArrayList<>(); List<Rectangle> area = new ArrayList<>();
area.add(craftingCPUArea); area.add(tallButton);
return area; return area;
} }
@@ -195,7 +198,7 @@ public class GuiInterfaceTerminal extends AEBaseGui {
guiButtonHide = new GuiImgButton(guiLeft + 141, guiTop + 25, Settings.ACTIONS, this.partInterfaceTerminal.onlyInterfacesWithFreeSlots ? ActionItems.TOGGLE_SHOW_FULL_INTERFACES_OFF : ActionItems.TOGGLE_SHOW_FULL_INTERFACES_ON); guiButtonHide = new GuiImgButton(guiLeft + 141, guiTop + 25, Settings.ACTIONS, this.partInterfaceTerminal.onlyInterfacesWithFreeSlots ? ActionItems.TOGGLE_SHOW_FULL_INTERFACES_OFF : ActionItems.TOGGLE_SHOW_FULL_INTERFACES_ON);
this.buttonList.add(guiButtonHide); this.buttonList.add(guiButtonHide);
this.buttonList.add(this.terminalStyleBox = new GuiImgButton(this.guiLeft - 18, guiTop + 18, Settings.TERMINAL_STYLE, AEConfig.instance() this.buttonList.add(this.terminalStyleBox = new GuiImgButton(this.guiLeft - 18, guiTop + 24 + jeiOffset, Settings.TERMINAL_STYLE, AEConfig.instance()
.getConfigManager() .getConfigManager()
.getSetting(Settings.TERMINAL_STYLE))); .getSetting(Settings.TERMINAL_STYLE)));
@@ -21,6 +21,7 @@ package appeng.client.gui.implementations;
import appeng.api.config.ActionItems; import appeng.api.config.ActionItems;
import appeng.api.config.ItemSubstitution; import appeng.api.config.ItemSubstitution;
import appeng.api.config.Packaging;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.storage.ITerminalHost; import appeng.api.storage.ITerminalHost;
import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiImgButton;
@@ -60,6 +61,9 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
private static final String SUBSITUTION_DISABLE = "0"; private static final String SUBSITUTION_DISABLE = "0";
private static final String SUBSITUTION_ENABLE = "1"; private static final String SUBSITUTION_ENABLE = "1";
private static final String PACKAGING_DISABLE = "0";
private static final String PACKAGING_ENABLE = "1";
private static final String CRAFTMODE_CRFTING = "1"; private static final String CRAFTMODE_CRFTING = "1";
private static final String CRAFTMODE_PROCESSING = "0"; private static final String CRAFTMODE_PROCESSING = "0";
@@ -78,6 +82,8 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
private GuiImgButton divThreeBtn; private GuiImgButton divThreeBtn;
private GuiImgButton minusOneBtn; private GuiImgButton minusOneBtn;
private GuiImgButton maxCountBtn; private GuiImgButton maxCountBtn;
private GuiImgButton packagingEnabledBtn;
private GuiImgButton packagingDisabledBtn;
public Map<Target<?>, Object> mapTargetSlot = new HashMap<>(); public Map<Target<?>, Object> mapTargetSlot = new HashMap<>();
public GuiPatternTerm(final InventoryPlayer inventoryPlayer, final ITerminalHost te) { public GuiPatternTerm(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
@@ -149,6 +155,12 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
.sendToServer( .sendToServer(
new PacketValueConfig("PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE)); new PacketValueConfig("PatternTerminal.Substitute", this.substitutionsEnabledBtn == btn ? SUBSITUTION_DISABLE : SUBSITUTION_ENABLE));
} }
if (this.packagingEnabledBtn == btn || this.packagingDisabledBtn == btn) {
NetworkHandler.instance()
.sendToServer(
new PacketValueConfig("PatternTerminal.Package", this.packagingEnabledBtn == btn ? PACKAGING_DISABLE : PACKAGING_ENABLE));
}
} catch (final IOException e) { } catch (final IOException e) {
AELog.error(e); AELog.error(e);
} }
@@ -174,6 +186,14 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
this.substitutionsDisabledBtn.setHalfSize(true); this.substitutionsDisabledBtn.setHalfSize(true);
this.buttonList.add(this.substitutionsDisabledBtn); this.buttonList.add(this.substitutionsDisabledBtn);
this.packagingEnabledBtn = new GuiImgButton(this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, Packaging.ENABLED);
this.packagingEnabledBtn.setHalfSize(true);
this.buttonList.add(this.packagingEnabledBtn);
this.packagingDisabledBtn = new GuiImgButton(this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, Packaging.DISABLED);
this.packagingDisabledBtn.setHalfSize(true);
this.buttonList.add(this.packagingDisabledBtn);
this.clearBtn = new GuiImgButton(this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE); this.clearBtn = new GuiImgButton(this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE);
this.clearBtn.setHalfSize(true); this.clearBtn.setHalfSize(true);
this.buttonList.add(this.clearBtn); this.buttonList.add(this.clearBtn);
@@ -221,6 +241,8 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
this.divThreeBtn.visible = false; this.divThreeBtn.visible = false;
this.plusOneBtn.visible = false; this.plusOneBtn.visible = false;
this.minusOneBtn.visible = false; this.minusOneBtn.visible = false;
this.packagingEnabledBtn.visible = false;
this.packagingDisabledBtn.visible = false;
//this.maxCountBtn.visible = false; //this.maxCountBtn.visible = false;
if (this.container.substitute) { if (this.container.substitute) {
@@ -231,6 +253,13 @@ public class GuiPatternTerm extends GuiMEMonitorable implements IJEIGhostIngredi
this.substitutionsDisabledBtn.visible = true; this.substitutionsDisabledBtn.visible = true;
} }
} else { } else {
if (this.container.packaging) {
this.packagingEnabledBtn.visible = true;
this.packagingDisabledBtn.visible = false;
} else {
this.packagingEnabledBtn.visible = false;
this.packagingDisabledBtn.visible = true;
}
this.tabCraftButton.visible = false; this.tabCraftButton.visible = false;
this.tabProcessButton.visible = true; this.tabProcessButton.visible = true;
this.substitutionsEnabledBtn.visible = false; this.substitutionsEnabledBtn.visible = false;
@@ -125,6 +125,9 @@ public class GuiImgButton extends GuiButton implements ITooltip {
this.registerApp(4 + 3 * 16, Settings.ACTIONS, ItemSubstitution.ENABLED, ButtonToolTips.Substitutions, ButtonToolTips.SubstitutionsDescEnabled); this.registerApp(4 + 3 * 16, Settings.ACTIONS, ItemSubstitution.ENABLED, ButtonToolTips.Substitutions, ButtonToolTips.SubstitutionsDescEnabled);
this.registerApp(7 + 3 * 16, Settings.ACTIONS, ItemSubstitution.DISABLED, ButtonToolTips.Substitutions, ButtonToolTips.SubstitutionsDescDisabled); this.registerApp(7 + 3 * 16, Settings.ACTIONS, ItemSubstitution.DISABLED, ButtonToolTips.Substitutions, ButtonToolTips.SubstitutionsDescDisabled);
this.registerApp(8 + 3 * 16, Settings.ACTIONS, Packaging.ENABLED, ButtonToolTips.Packaging, ButtonToolTips.PackagingDescEnabled);
this.registerApp(9 + 3 * 16, Settings.ACTIONS, Packaging.DISABLED, ButtonToolTips.Packaging, ButtonToolTips.PackagingDescDisabled);
this.registerApp(16, Settings.VIEW_MODE, ViewItems.STORED, ButtonToolTips.View, ButtonToolTips.StoredItems); this.registerApp(16, Settings.VIEW_MODE, ViewItems.STORED, ButtonToolTips.View, ButtonToolTips.StoredItems);
this.registerApp(18, Settings.VIEW_MODE, ViewItems.ALL, ButtonToolTips.View, ButtonToolTips.StoredCraftable); this.registerApp(18, Settings.VIEW_MODE, ViewItems.ALL, ButtonToolTips.View, ButtonToolTips.StoredCraftable);
this.registerApp(19, Settings.VIEW_MODE, ViewItems.CRAFTABLE, ButtonToolTips.View, ButtonToolTips.Craftable); this.registerApp(19, Settings.VIEW_MODE, ViewItems.CRAFTABLE, ButtonToolTips.View, ButtonToolTips.Craftable);
@@ -12,14 +12,7 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList; import appeng.api.storage.data.IItemList;
import appeng.container.ContainerNull; import appeng.container.ContainerNull;
import appeng.container.guisync.GuiSync; import appeng.container.guisync.GuiSync;
import appeng.container.slot.AppEngSlot; import appeng.container.slot.*;
import appeng.container.slot.IOptionalSlotHost;
import appeng.container.slot.OptionalSlotFake;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.container.slot.SlotPatternTerm;
import appeng.container.slot.SlotPlayerHotBar;
import appeng.container.slot.SlotPlayerInv;
import appeng.container.slot.SlotRestrictedInput;
import appeng.core.sync.packets.PacketPatternSlot; import appeng.core.sync.packets.PacketPatternSlot;
import appeng.helpers.IContainerCraftingPacket; import appeng.helpers.IContainerCraftingPacket;
import appeng.items.storage.ItemViewCell; import appeng.items.storage.ItemViewCell;
@@ -74,6 +67,8 @@ public abstract class ContainerPatternEncoder extends ContainerMEMonitorable imp
public boolean craftingMode = true; public boolean craftingMode = true;
@GuiSync(96) @GuiSync(96)
public boolean substitute = false; public boolean substitute = false;
@GuiSync(95)
public boolean packaging = false;
protected ContainerPatternEncoder(InventoryPlayer ip, ITerminalHost monitorable, boolean bindInventory) { protected ContainerPatternEncoder(InventoryPlayer ip, ITerminalHost monitorable, boolean bindInventory) {
super(ip, monitorable, bindInventory); super(ip, monitorable, bindInventory);
@@ -254,8 +249,12 @@ public abstract class ContainerPatternEncoder extends ContainerMEMonitorable imp
encodedValue.setTag("in", tagIn); encodedValue.setTag("in", tagIn);
encodedValue.setTag("out", tagOut); encodedValue.setTag("out", tagOut);
encodedValue.setBoolean("crafting", this.isCraftingMode()); if (this.isCraftingMode()) {
encodedValue.setBoolean("substitute", this.isSubstitute()); encodedValue.setBoolean("crafting", this.isCraftingMode());
encodedValue.setBoolean("substitute", this.isSubstitute());
} else {
encodedValue.setBoolean("packaging", this.isPackaging());
}
output.setTagCompound(encodedValue); output.setTagCompound(encodedValue);
@@ -532,7 +531,39 @@ public abstract class ContainerPatternEncoder extends ContainerMEMonitorable imp
} }
public void setSubstitute(final boolean substitute) { public void setSubstitute(final boolean substitute) {
if (getPart() != null) {
getPart().setSubstitution(substitute);
} else if (iGuiItemObject != null) {
NBTTagCompound nbtTagCompound = iGuiItemObject.getItemStack().getTagCompound();
if (nbtTagCompound != null) {
nbtTagCompound.setBoolean("isSubstitute", substitute);
}
}
this.substitute = substitute; this.substitute = substitute;
if (getPart() != null) {
getPart().setSubstitution(substitute);
} else if (iGuiItemObject != null) {
NBTTagCompound nbtTagCompound = iGuiItemObject.getItemStack().getTagCompound();
if (nbtTagCompound != null) {
nbtTagCompound.setBoolean("isSubstitute", substitute);
}
}
}
public boolean isPackaging() {
return this.packaging;
}
public void setPackaging(boolean packaging) {
if (getPart() != null) {
getPart().setPackaging(packaging);
} else if (iGuiItemObject != null) {
NBTTagCompound nbtTagCompound = iGuiItemObject.getItemStack().getTagCompound();
if (nbtTagCompound != null) {
nbtTagCompound.setBoolean("isPackaging", packaging);
}
}
this.packaging = packaging;
} }
@Override @Override
@@ -544,6 +575,7 @@ public abstract class ContainerPatternEncoder extends ContainerMEMonitorable imp
this.setCraftingMode(this.getPart().isCraftingRecipe()); this.setCraftingMode(this.getPart().isCraftingRecipe());
this.updateOrderOfOutputSlots(); this.updateOrderOfOutputSlots();
} }
this.packaging = this.getPart().isPackaging();
this.substitute = this.getPart().isSubstitution(); this.substitute = this.getPart().isSubstitution();
} else if (iGuiItemObject != null) { } else if (iGuiItemObject != null) {
NBTTagCompound nbtTagCompound = iGuiItemObject.getItemStack().getTagCompound(); NBTTagCompound nbtTagCompound = iGuiItemObject.getItemStack().getTagCompound();
@@ -562,20 +594,23 @@ public abstract class ContainerPatternEncoder extends ContainerMEMonitorable imp
nbtTagCompound.setBoolean("isCraftingMode", false); nbtTagCompound.setBoolean("isCraftingMode", false);
iGuiItemObject.getItemStack().setTagCompound(nbtTagCompound); iGuiItemObject.getItemStack().setTagCompound(nbtTagCompound);
} }
nbtTagCompound = iGuiItemObject.getItemStack().getTagCompound();
if (nbtTagCompound != null) { if (nbtTagCompound.hasKey("isSubstitute")) {
if (nbtTagCompound.hasKey("isSubstitute")) { boolean substitute = nbtTagCompound.getBoolean("isSubstitute");
boolean substitute = nbtTagCompound.getBoolean("isSubstitute"); if (this.isSubstitute() != substitute) {
if (this.isSubstitute() != substitute) { this.setSubstitute(substitute);
this.setSubstitute(substitute);
}
} else {
nbtTagCompound.setBoolean("isSubstitute", false);
} }
} else { } else {
nbtTagCompound = new NBTTagCompound();
nbtTagCompound.setBoolean("isSubstitute", false); nbtTagCompound.setBoolean("isSubstitute", false);
iGuiItemObject.getItemStack().setTagCompound(nbtTagCompound); }
if (nbtTagCompound.hasKey("isPackaging")) {
boolean packaging = nbtTagCompound.getBoolean("isPackaging");
if (this.isPackaging() != packaging) {
this.setPackaging(packaging);
}
} else {
nbtTagCompound.setBoolean("isPackaging", false);
} }
} }
} }
@@ -224,7 +224,7 @@ public class ContainerWirelessPatternTerminal extends ContainerPatternEncoder im
this.output.writeToNBT(tag, "output"); this.output.writeToNBT(tag, "output");
this.pattern.writeToNBT(tag, "patterns"); this.pattern.writeToNBT(tag, "patterns");
this.upgrades.writeToNBT(tag, "upgrades"); this.upgrades.writeToNBT(tag, "upgrades");
tag.setBoolean("isPackaging", this.packaging);
this.wirelessTerminalGUIObject.saveChanges(tag); this.wirelessTerminalGUIObject.saveChanges(tag);
} }
} }
@@ -236,6 +236,7 @@ public class ContainerWirelessPatternTerminal extends ContainerPatternEncoder im
this.output.readFromNBT(data, "output"); this.output.readFromNBT(data, "output");
this.pattern.readFromNBT(data, "patterns"); this.pattern.readFromNBT(data, "patterns");
upgrades.readFromNBT(wirelessTerminalGUIObject.getItemStack().getTagCompound().getCompoundTag("upgrades")); upgrades.readFromNBT(wirelessTerminalGUIObject.getItemStack().getTagCompound().getCompoundTag("upgrades"));
this.packaging = data.getBoolean("isPackaging");
} }
} }
+5 -1
View File
@@ -72,7 +72,11 @@ public final class AppEng {
private static final String FORGE_CURRENT_VERSION = ForgeVersion.majorVersion + "." + ForgeVersion.minorVersion + "." + ForgeVersion.revisionVersion + "." + ForgeVersion.buildVersion; private static final String FORGE_CURRENT_VERSION = ForgeVersion.majorVersion + "." + ForgeVersion.minorVersion + "." + ForgeVersion.revisionVersion + "." + ForgeVersion.buildVersion;
private static final String FORGE_MAX_VERSION = (ForgeVersion.majorVersion + 1) + ".0.0.0"; private static final String FORGE_MAX_VERSION = (ForgeVersion.majorVersion + 1) + ".0.0.0";
public static final String MOD_DEPENDENCIES = "required-after:forge@[" + FORGE_CURRENT_VERSION + "," + FORGE_MAX_VERSION + ");after:ctm@[" + CTM.VERSION + ",);after:itemstages;after:recipestages"; public static final String MOD_DEPENDENCIES = "required-after:forge@[" + FORGE_CURRENT_VERSION + "," + FORGE_MAX_VERSION + ");" +
"after:ctm@[" + CTM.VERSION + ",);" +
"after:itemstages;" +
"after:recipestages;" +
"before:bogosorter@[1.2.2,);";
@Nonnull @Nonnull
private static final AppEng INSTANCE = new AppEng(); private static final AppEng INSTANCE = new AppEng();
@@ -4,14 +4,36 @@ package appeng.core.api;
import appeng.api.config.IncludeExclude; import appeng.api.config.IncludeExclude;
import appeng.api.storage.ICellInventory; import appeng.api.storage.ICellInventory;
import appeng.api.storage.ICellInventoryHandler; import appeng.api.storage.ICellInventoryHandler;
import appeng.api.storage.channels.IFluidStorageChannel;
import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
import appeng.api.util.IClientHelper; import appeng.api.util.IClientHelper;
import appeng.core.localization.GuiText; import appeng.core.localization.GuiText;
import appeng.fluids.items.FluidDummyItem;
import appeng.fluids.util.AEFluidStack;
import appeng.util.ReadableNumberConverter;
import appeng.util.item.AEItemStack;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.oredict.OreDictionary;
import org.lwjgl.input.Keyboard;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Collection;
import java.util.List; import java.util.List;
public class ApiClientHelper implements IClientHelper { public class ApiClientHelper implements IClientHelper {
private static final String[] NUMBER_FORMATS = new String[]{"#.000", "#.00", "#.0", "#"};
@Override @Override
public <T extends IAEStack<T>> void addCellInformation(ICellInventoryHandler<T> handler, List<String> lines) { public <T extends IAEStack<T>> void addCellInformation(ICellInventoryHandler<T> handler, List<String> lines) {
if (handler == null) { if (handler == null) {
@@ -27,16 +49,95 @@ public class ApiClientHelper implements IClientHelper {
.getLocal()); .getLocal());
} }
IItemList<?> itemList = cellInventory.getChannel().createList();
if (handler.isPreformatted()) { if (handler.isPreformatted()) {
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal(); final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal();
if (handler.isFuzzy()) { if (handler.isFuzzy()) {
lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Fuzzy.getLocal()); lines.add("[" + GuiText.Partitioned.getLocal() + "]" + " - " + list + ' ' + GuiText.Fuzzy.getLocal());
} else { } else {
lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal()); lines.add("[" + GuiText.Partitioned.getLocal() + "]" + " - " + list + ' ' + GuiText.Precise.getLocal());
}
if (Minecraft.getMinecraft().gameSettings.advancedItemTooltips || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
IItemHandler inv = cellInventory.getConfigInventory();
cellInventory.getAvailableItems((IItemList) itemList);
for (int i = 0; i < inv.getSlots(); i++) {
final ItemStack is = inv.getStackInSlot(i);
if (!is.isEmpty()) {
if (cellInventory.getChannel() instanceof IItemStorageChannel) {
if (!handler.isFuzzy()) {
final IAEItemStack ais = AEItemStack.fromItemStack(is);
IAEItemStack stocked = ((IItemList<IAEItemStack>) itemList).findPrecise(ais);
lines.add("[" + is.getDisplayName() + "]" + ": " + (stocked == null ? "0" : ReadableNumberConverter.INSTANCE.toWideReadableForm(stocked.getStackSize())));
} else {
final IAEItemStack ais = AEItemStack.fromItemStack(is);
Collection<IAEItemStack> stocked = ((IItemList<IAEItemStack>) itemList).findFuzzy(ais, handler.getCellInv().getFuzzyMode());
int[] ids = OreDictionary.getOreIDs(is);
long size = 0;
for (IAEItemStack ist : stocked) {
size += ist.getStackSize();
}
if (is.getItem().isDamageable()) {
lines.add("[" + is.getDisplayName() + "]" + ": " + size);
} else if (ids.length > 0) {
StringBuilder sb = new StringBuilder();
for (int j : ids) {
sb.append(OreDictionary.getOreName(j)).append(", ");
}
lines.add("[{" + sb.substring(0, sb.length() - 2) + "}]" + ": " + ReadableNumberConverter.INSTANCE.toWideReadableForm(size));
}
}
} else if (cellInventory.getChannel() instanceof IFluidStorageChannel) {
final AEFluidStack ais;
if (is.getItem() instanceof FluidDummyItem) {
ais = AEFluidStack.fromFluidStack(((FluidDummyItem) is.getItem()).getFluidStack(is));
} else {
ais = AEFluidStack.fromFluidStack(FluidUtil.getFluidContained(is));
}
IAEFluidStack stocked = ((IItemList<IAEFluidStack>) itemList).findPrecise(ais);
lines.add("[" + is.getDisplayName() + "]" + ": " + (stocked == null ? "0" : fluidStackSize(stocked.getStackSize())));
}
}
}
}
} else {
if (Minecraft.getMinecraft().gameSettings.advancedItemTooltips || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
cellInventory.getAvailableItems((IItemList) itemList);
for (IAEStack<?> s : itemList) {
if (s instanceof IAEItemStack) {
lines.add(((IAEItemStack) s).getDefinition().getDisplayName() + ": " + ReadableNumberConverter.INSTANCE.toWideReadableForm(s.getStackSize()));
} else if (s instanceof IAEFluidStack) {
lines.add(((IAEFluidStack) s).getFluidStack().getLocalizedName() + ": " + fluidStackSize(s.getStackSize()));
}
}
} }
} }
} }
private String fluidStackSize(long size) {
String unit;
if (size >= 1000) {
unit = "B";
} else {
unit = "mB";
}
final int log = (int) Math.floor(Math.log10(size)) / 2;
final int index = Math.max(0, Math.min(3, log));
final DecimalFormatSymbols symbols = new DecimalFormatSymbols();
symbols.setDecimalSeparator('.');
final DecimalFormat format = new DecimalFormat(NUMBER_FORMATS[index]);
format.setDecimalFormatSymbols(symbols);
format.setRoundingMode(RoundingMode.DOWN);
String formatted = format.format(size / 1000d);
return formatted.concat(unit);
}
} }
@@ -116,6 +116,11 @@ public enum ButtonToolTips {
SubstitutionsOff, SubstitutionsOff,
SubstitutionsDescEnabled, SubstitutionsDescEnabled,
SubstitutionsDescDisabled, SubstitutionsDescDisabled,
Packaging,
PackagingOn,
PackagingOff,
PackagingDescEnabled,
PackagingDescDisabled,
CraftOnly, CraftOnly,
CraftEither, CraftEither,
@@ -119,6 +119,7 @@ public enum GuiText {
And, And,
With, With,
Substitute, Substitute,
Package,
Yes, Yes,
No, No,
+6 -25
View File
@@ -232,24 +232,14 @@ public enum GuiBridge implements IGuiHandler {
public Object getServerGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) { public Object getServerGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) {
final AEPartLocation side = AEPartLocation.fromOrdinal(ordinal & 0x07); final AEPartLocation side = AEPartLocation.fromOrdinal(ordinal & 0x07);
final GuiBridge ID = values()[ordinal >> 4]; final GuiBridge ID = values()[ordinal >> 4];
final boolean stem = ((ordinal >> 3) & 1) == 1;
if (ID.type.isItem()) { if (ID.type.isItem()) {
ItemStack it = ItemStack.EMPTY; ItemStack it = ItemStack.EMPTY;
if (y == 0) { if (y == 0) {
if (stem) { if (x >= 0 && x < player.inventory.mainInventory.size()) {
it = player.inventory.getCurrentItem();
} else if (x >= 0 && x < player.inventory.mainInventory.size()) {
it = player.inventory.getStackInSlot(x); it = player.inventory.getStackInSlot(x);
} }
} else if (y == 1 && z == Integer.MIN_VALUE) { } else if (y == 1 && z == Integer.MIN_VALUE) {
if (stem) { it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
if (player.openContainer instanceof IInventorySlotAware) {
int slot = ((IInventorySlotAware) player.openContainer).getInventorySlot();
it = BaublesApi.getBaublesHandler(player).getStackInSlot(slot);
}
} else {
it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
}
} }
final Object myItem = this.getGuiObject(it, player, w, x, y, z); final Object myItem = this.getGuiObject(it, player, w, x, y, z);
if (myItem != null && ID.CorrectTileOrPart(myItem)) { if (myItem != null && ID.CorrectTileOrPart(myItem)) {
@@ -354,24 +344,15 @@ public enum GuiBridge implements IGuiHandler {
public Object getClientGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) { public Object getClientGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) {
final AEPartLocation side = AEPartLocation.fromOrdinal(ordinal & 0x07); final AEPartLocation side = AEPartLocation.fromOrdinal(ordinal & 0x07);
final GuiBridge ID = values()[ordinal >> 4]; final GuiBridge ID = values()[ordinal >> 4];
final boolean stem = ((ordinal >> 3) & 1) == 1;
if (ID.type.isItem()) { if (ID.type.isItem()) {
ItemStack it = ItemStack.EMPTY; ItemStack it = ItemStack.EMPTY;
if (y == 0) { if (y == 0) {
if (stem) { if (x >= 0 && x < player.inventory.mainInventory.size()) {
it = player.inventory.getCurrentItem();
} else if (x >= 0 && x < player.inventory.mainInventory.size()) {
it = player.inventory.getStackInSlot(x); it = player.inventory.getStackInSlot(x);
} }
} else if (y == 1 && z == Integer.MIN_VALUE) { }
if (stem) { if (y == 1 && z == Integer.MIN_VALUE) {
if (player.openContainer instanceof IInventorySlotAware) { it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
int slot = ((IInventorySlotAware) player.openContainer).getInventorySlot();
it = BaublesApi.getBaublesHandler(player).getStackInSlot(slot);
}
} else {
it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
}
} }
final Object myItem = this.getGuiObject(it, player, w, x, y, z); final Object myItem = this.getGuiObject(it, player, w, x, y, z);
if (myItem != null && ID.CorrectTileOrPart(myItem)) { if (myItem != null && ID.CorrectTileOrPart(myItem)) {
@@ -255,14 +255,16 @@ public class PacketJEIRecipe extends AppEngPacket {
if (this.output != null && ((con instanceof ContainerPatternEncoder && !((ContainerPatternEncoder) con).isCraftingMode()))) { if (this.output != null && ((con instanceof ContainerPatternEncoder && !((ContainerPatternEncoder) con).isCraftingMode()))) {
IItemHandler outputSlots = cct.getInventoryByName("output"); IItemHandler outputSlots = cct.getInventoryByName("output");
for (int i = 0; i < outputSlots.getSlots(); ++i) { if (outputSlots != null) {
ItemHandlerUtil.setStackInSlot(outputSlots, i, ItemStack.EMPTY); for (int i = 0; i < outputSlots.getSlots(); ++i) {
} ItemHandlerUtil.setStackInSlot(outputSlots, i, ItemStack.EMPTY);
for (int i = 0; i < this.output.size() && i < outputSlots.getSlots(); ++i) { }
if (this.output.get(i) == null || this.output.get(i) == ItemStack.EMPTY) { for (int i = 0; i < this.output.size() && i < outputSlots.getSlots(); ++i) {
continue; if (this.output.get(i) == null || this.output.get(i) == ItemStack.EMPTY) {
continue;
}
ItemHandlerUtil.setStackInSlot(outputSlots, i, this.output.get(i));
} }
ItemHandlerUtil.setStackInSlot(outputSlots, i, this.output.get(i));
} }
} }
} }
@@ -23,7 +23,6 @@ import appeng.api.AEApi;
import appeng.api.storage.channels.IItemStorageChannel; import appeng.api.storage.channels.IItemStorageChannel;
import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEItemStack;
import appeng.container.implementations.ContainerPatternEncoder; import appeng.container.implementations.ContainerPatternEncoder;
import appeng.container.implementations.ContainerPatternTerm;
import appeng.core.sync.AppEngPacket; import appeng.core.sync.AppEngPacket;
import appeng.core.sync.network.INetworkInfo; import appeng.core.sync.network.INetworkInfo;
import appeng.util.item.AEItemStack; import appeng.util.item.AEItemStack;
@@ -157,7 +157,9 @@ public class PacketValueConfig extends AppEngPacket {
} else if (this.Name.equals("PatternTerminal.MaximizeCount")) { } else if (this.Name.equals("PatternTerminal.MaximizeCount")) {
cpt.maximizeCount(); cpt.maximizeCount();
} else if (this.Name.equals("PatternTerminal.Substitute")) { } else if (this.Name.equals("PatternTerminal.Substitute")) {
cpt.getPart().setSubstitution(this.Value.equals("1")); cpt.setSubstitute(this.Value.equals("1"));
} else if (this.Name.equals("PatternTerminal.Package")) {
cpt.setPackaging(this.Value.equals("1"));
} }
} }
} else if (this.Name.startsWith("StorageBus.")) { } else if (this.Name.startsWith("StorageBus.")) {
@@ -68,6 +68,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
private final Set<TestLookup> failCache = new HashSet<>(); private final Set<TestLookup> failCache = new HashSet<>();
private final Set<TestLookup> passCache = new HashSet<>(); private final Set<TestLookup> passCache = new HashSet<>();
private final IAEItemStack pattern; private final IAEItemStack pattern;
private final boolean isPackaging;
private int priority = 0; private int priority = 0;
public PatternHelper(final ItemStack is, final World w) { public PatternHelper(final ItemStack is, final World w) {
@@ -80,6 +81,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
final NBTTagList inTag = encodedValue.getTagList("in", 10); final NBTTagList inTag = encodedValue.getTagList("in", 10);
final NBTTagList outTag = encodedValue.getTagList("out", 10); final NBTTagList outTag = encodedValue.getTagList("out", 10);
this.isCrafting = encodedValue.getBoolean("crafting"); this.isCrafting = encodedValue.getBoolean("crafting");
this.isPackaging = encodedValue.getBoolean("packaging");
crafting = new InventoryCrafting(new ContainerNull(), isCrafting ? 3 : 4, isCrafting ? 3 : 4); crafting = new InventoryCrafting(new ContainerNull(), isCrafting ? 3 : 4, isCrafting ? 3 : 4);
testFrame = new InventoryCrafting(new ContainerNull(), isCrafting ? 3 : 4, isCrafting ? 3 : 4); testFrame = new InventoryCrafting(new ContainerNull(), isCrafting ? 3 : 4, isCrafting ? 3 : 4);
@@ -207,6 +209,11 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
return this.patternItem; return this.patternItem;
} }
@Override
public boolean isPackage() {
return this.isPackaging;
}
@Override @Override
public synchronized boolean isValidItemForSlot(final int slotIndex, final ItemStack i, final World w) { public synchronized boolean isValidItemForSlot(final int slotIndex, final ItemStack i, final World w) {
if (!this.isCrafting) { if (!this.isCrafting) {
@@ -9,7 +9,7 @@ import java.util.Comparator;
public class InventoryBogoSortModule { public class InventoryBogoSortModule {
private static final boolean loaded = Loader.isModLoaded("bogosorter"); private static final boolean loaded = Loader.isModLoaded("bogosorter");
public static final Comparator<IAEItemStack> COMPARATOR = (o1, o2) -> SortHandler.ITEM_COMPARATOR.compare(o1.getDefinition(), o2.getDefinition()); public static final Comparator<IAEItemStack> COMPARATOR = (o1, o2) -> SortHandler.getClientItemComparator().compare(o1.getDefinition(), o2.getDefinition());
public static boolean isLoaded() { public static boolean isLoaded() {
@@ -136,6 +136,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
final boolean isCrafting = details.isCraftable(); final boolean isCrafting = details.isCraftable();
final boolean substitute = details.canSubstitute(); final boolean substitute = details.canSubstitute();
final boolean isPackage = details.isPackage();
final IAEItemStack[] in = details.getCondensedInputs(); final IAEItemStack[] in = details.getCondensedInputs();
final IAEItemStack[] out = details.getCondensedOutputs(); final IAEItemStack[] out = details.getCondensedOutputs();
@@ -169,6 +170,11 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
final String canSubstitute = substitute ? GuiText.Yes.getLocal() : GuiText.No.getLocal(); final String canSubstitute = substitute ? GuiText.Yes.getLocal() : GuiText.No.getLocal();
lines.add(substitutionLabel + canSubstitute); lines.add(substitutionLabel + canSubstitute);
} else {
final String packageLabel = GuiText.Package.getLocal() + " ";
final String canPackage = isPackage ? GuiText.Yes.getLocal() : GuiText.No.getLocal();
lines.add(packageLabel + canPackage);
} }
} }
@@ -546,6 +546,10 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
return; return;
} }
if (this.finalOutput.getStackSize() == 0) {
this.completeJob();
}
this.waiting = false; this.waiting = false;
if (this.waiting || this.tasks.isEmpty()) // nothing to do here... if (this.waiting || this.tasks.isEmpty()) // nothing to do here...
{ {
@@ -701,7 +705,11 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU {
for (final IAEItemStack out : details.getCondensedOutputs()) { for (final IAEItemStack out : details.getCondensedOutputs()) {
this.postChange(out, this.machineSrc); this.postChange(out, this.machineSrc);
this.waitingFor.add(out.copy()); if (!details.isPackage()) {
this.waitingFor.add(out.copy());
} else {
this.finalOutput.setStackSize(finalOutput.getStackSize() - out.getStackSize());
}
this.postCraftingStatusChange(out.copy()); this.postCraftingStatusChange(out.copy());
} }
@@ -23,6 +23,7 @@ public abstract class AbstractPartEncoder extends AbstractPartTerminal {
protected boolean craftingMode = true; protected boolean craftingMode = true;
protected boolean substitute = false; protected boolean substitute = false;
protected boolean packaging = false;
public AbstractPartEncoder(ItemStack is) { public AbstractPartEncoder(ItemStack is) {
super(is); super(is);
@@ -106,6 +107,14 @@ public abstract class AbstractPartEncoder extends AbstractPartTerminal {
return this.substitute; return this.substitute;
} }
public void setPackaging(boolean packaging) {
this.packaging = packaging;
}
public boolean isPackaging() {
return this.packaging;
}
public void setSubstitution(final boolean canSubstitute) { public void setSubstitution(final boolean canSubstitute) {
this.substitute = canSubstitute; this.substitute = canSubstitute;
} }
@@ -33,7 +33,6 @@ import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import static appeng.helpers.PatternHelper.CRAFTING_GRID_DIMENSION; import static appeng.helpers.PatternHelper.CRAFTING_GRID_DIMENSION;
import static appeng.helpers.PatternHelper.CRAFTING_OUTPUT_LIMIT;
public class PartPatternTerminal extends AbstractPartEncoder { public class PartPatternTerminal extends AbstractPartEncoder {
@@ -60,6 +59,7 @@ public class PartPatternTerminal extends AbstractPartEncoder {
super.readFromNBT(data); super.readFromNBT(data);
this.setCraftingRecipe(data.getBoolean("craftingMode")); this.setCraftingRecipe(data.getBoolean("craftingMode"));
this.setSubstitution(data.getBoolean("substitute")); this.setSubstitution(data.getBoolean("substitute"));
this.setPackaging(data.getBoolean("packaging"));
} }
@Override @Override
@@ -67,6 +67,7 @@ public class PartPatternTerminal extends AbstractPartEncoder {
super.writeToNBT(data); super.writeToNBT(data);
data.setBoolean("craftingMode", this.craftingMode); data.setBoolean("craftingMode", this.craftingMode);
data.setBoolean("substitute", this.substitute); data.setBoolean("substitute", this.substitute);
data.setBoolean("packaging", this.packaging);
} }
@Override @Override
+9 -2
View File
@@ -331,13 +331,20 @@ public class Platform {
x = tile.getPos().getX(); x = tile.getPos().getX();
y = tile.getPos().getY(); y = tile.getPos().getY();
z = tile.getPos().getZ(); z = tile.getPos().getZ();
} else {
if (p.openContainer instanceof IInventorySlotAware) {
x = ((IInventorySlotAware) p.openContainer).getInventorySlot();
y = ((IInventorySlotAware) p.openContainer).isBaubleSlot() ? 1 : 0;
} else {
x = p.inventory.currentItem;
}
} }
if ((type.getType().isItem() && tile == null) || type.hasPermissions(tile, x, y, z, side, p)) { if ((type.getType().isItem() && tile == null) || type.hasPermissions(tile, x, y, z, side, p)) {
if (tile == null && type.getType() == GuiHostType.ITEM) { if (tile == null && type.getType() == GuiHostType.ITEM) {
p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), x, y, z); p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), x, 0, 0);
} else if (tile == null || type.getType() == GuiHostType.ITEM) { } else if (tile == null || type.getType() == GuiHostType.ITEM) {
p.openGui(AppEng.instance(), type.ordinal() << 4 | (1 << 3), p.getEntityWorld(), x, y, z); p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), x, y, z);
} else { } else {
p.openGui(AppEng.instance(), type.ordinal() << 4 | (side.ordinal()), tile.getWorld(), x, y, z); p.openGui(AppEng.instance(), type.ordinal() << 4 | (side.ordinal()), tile.getWorld(), x, y, z);
} }
@@ -196,6 +196,7 @@ gui.appliedenergistics2.And=and
gui.appliedenergistics2.Creates=Creates gui.appliedenergistics2.Creates=Creates
gui.appliedenergistics2.With=with gui.appliedenergistics2.With=with
gui.appliedenergistics2.Substitute=Using Substitutions: gui.appliedenergistics2.Substitute=Using Substitutions:
gui.appliedenergistics2.Package=Treating inputs as package:
gui.appliedenergistics2.Yes=Yes gui.appliedenergistics2.Yes=Yes
gui.appliedenergistics2.No=No gui.appliedenergistics2.No=No
gui.appliedenergistics2.InWorldCrafting=AE2 In World Crafting gui.appliedenergistics2.InWorldCrafting=AE2 In World Crafting
@@ -260,6 +261,9 @@ gui.tooltips.appliedenergistics2.SubstitutionsDescEnabled=Allow substitutions of
gui.tooltips.appliedenergistics2.SubstitutionsDescDisabled=Prevent substitutions of input components. gui.tooltips.appliedenergistics2.SubstitutionsDescDisabled=Prevent substitutions of input components.
gui.tooltips.appliedenergistics2.SubstitutionsOn=Substitutions Enabled gui.tooltips.appliedenergistics2.SubstitutionsOn=Substitutions Enabled
gui.tooltips.appliedenergistics2.SubstitutionsOff=Substitutions Disabled gui.tooltips.appliedenergistics2.SubstitutionsOff=Substitutions Disabled
gui.tooltips.appliedenergistics2.Packaging=Packaging Pattern
gui.tooltips.appliedenergistics2.PackagingDescEnabled=Treat the inputs as a package. Do not wait for the result of this pattern when crafting.
gui.tooltips.appliedenergistics2.PackagingDescDisabled=Wait for the result of this pattern. This is the DEFAULT behavior.
gui.tooltips.appliedenergistics2.Encode=Encode Pattern gui.tooltips.appliedenergistics2.Encode=Encode Pattern
gui.tooltips.appliedenergistics2.EncodeDescription=Write the entered pattern to the current encoded pattern, or to available blank pattern. Hold Shift to transfer directly to your inventory gui.tooltips.appliedenergistics2.EncodeDescription=Write the entered pattern to the current encoded pattern, or to available blank pattern. Hold Shift to transfer directly to your inventory
gui.tooltips.appliedenergistics2.FuzzyMode=Fuzzy Comparison gui.tooltips.appliedenergistics2.FuzzyMode=Fuzzy Comparison
@@ -668,3 +672,7 @@ stat.ae2.TurnedCranks=Turned Cranks
//Keys //Keys
key.appliedenergistics2.category=Applied Energistics 2 key.appliedenergistics2.category=Applied Energistics 2
key.toggle_focus.desc=Toggle search box focus key.toggle_focus.desc=Toggle search box focus
key.open_wireless_terminal.desc=Open Wireless Terminal
key.open_wireless_crafting_terminal.desc=Open Wireless Crafting Terminal
key.open_wireless_pattern_terminal.desc=Open Wireless Pattern Terminal
key.open_wireless_fluid_terminal.desc=Open Wireless Fluid Terminal
@@ -462,6 +462,10 @@ item.appliedenergistics2.material.blank_pattern.name=Пустой шаблон
item.appliedenergistics2.material.calculation_processor.name=Вычислительный процессор item.appliedenergistics2.material.calculation_processor.name=Вычислительный процессор
item.appliedenergistics2.material.card_capacity.name=Карта ёмкости item.appliedenergistics2.material.card_capacity.name=Карта ёмкости
item.appliedenergistics2.material.card_pattern_expansion.name=Карта расширения шаблона item.appliedenergistics2.material.card_pattern_expansion.name=Карта расширения шаблона
item.appliedenergistics2.material.card_magnet.name=Магнитная карта
item.appliedenergistics2.material.card_magnet.usage=Щёлкните ПКМ пустой рукой по терминулу, чтобы включить или выключить
item.appliedenergistics2.material.card_magnet.partition=Можно настроить в верстаке для ячеек
item.appliedenergistics2.material.card_quantum_link.name=Карта квантовой связи
item.appliedenergistics2.material.card_fuzzy.name=Карта нечёткости item.appliedenergistics2.material.card_fuzzy.name=Карта нечёткости
item.appliedenergistics2.material.card_inverter.name=Карта инвертирования item.appliedenergistics2.material.card_inverter.name=Карта инвертирования
item.appliedenergistics2.material.card_redstone.name=Карта красного камня item.appliedenergistics2.material.card_redstone.name=Карта красного камня
@@ -586,6 +590,9 @@ item.appliedenergistics2.matter_cannon.name=Материальная пушка
item.appliedenergistics2.memory_card.name=Карта памяти item.appliedenergistics2.memory_card.name=Карта памяти
item.appliedenergistics2.color_applicator.name=Аппликатор цвета item.appliedenergistics2.color_applicator.name=Аппликатор цвета
item.appliedenergistics2.wireless_terminal.name=Беспроводной терминал item.appliedenergistics2.wireless_terminal.name=Беспроводной терминал
item.appliedenergistics2.wireless_crafting_terminal.name=Беспроводной терминал изготовления
item.appliedenergistics2.wireless_pattern_terminal.name=Беспроводной терминал шаблонов
item.appliedenergistics2.wireless_fluid_terminal.name=Беспроводной жидкостный терминал
item.appliedenergistics2.biometric_card.name=Биометрическая карта item.appliedenergistics2.biometric_card.name=Биометрическая карта
item.appliedenergistics2.debug_card.name=Отладочная карта разработчика item.appliedenergistics2.debug_card.name=Отладочная карта разработчика
@@ -661,3 +668,7 @@ stat.ae2.TurnedCranks=Сломано рукояток
//Keys //Keys
key.appliedenergistics2.category=Applied Energistics 2 key.appliedenergistics2.category=Applied Energistics 2
key.toggle_focus.desc=Переключить фокус окна поиска key.toggle_focus.desc=Переключить фокус окна поиска
key.open_wireless_terminal.desc=Открыть беспроводной терминал
key.open_wireless_crafting_terminal.desc=Открыть беспроводной терминал изготовления
key.open_wireless_pattern_terminal.desc=Открыть беспроводной терминал шаблонов
key.open_wireless_fluid_terminal.desc=Открыть беспроводной жидкостный терминал
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 34 KiB