Compare commits

..
11 Commits
Author SHA1 Message Date
Martin Robertz f10bdb5389 update ae2 version 2025-12-09 15:28:41 +01:00
Martin Robertz 77f938c65b Merge remote-tracking branch 'origin/universal-gui' into dev 2025-12-09 15:16:19 +01:00
Kogepan229 5740883e14 cleanup 2025-12-08 12:41:20 +09:00
Kogepan229 0c817f3da9 Fix terminal gui open 2025-11-25 00:03:25 +09:00
Martin Robertz a5960bad61 update 2025-11-04 20:37:22 +01:00
Martin Robertz e96a8452b9 update 2025-11-04 18:58:26 +01:00
lc-1337 eeeb37fce7 update interfaces path 2025-11-01 10:00:57 +02:00
Kogepan229 44f648549f Fix pin button position 2025-10-30 16:17:52 +09:00
Kogepan229 c6b3a66707 Fix view cell slots 2025-10-30 16:17:31 +09:00
Kogepan229 edb7622056 Delete unused things 2025-10-30 15:46:52 +09:00
Kogepan229 49646337b3 Universal Gui 2025-10-30 15:30:04 +09:00
6 changed files with 83 additions and 18 deletions

No files matched your search

+4 -4
View File
@@ -1,11 +1,11 @@
// Add your dependencies here
dependencies {
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-762-GTNH:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-753-GTNH-pre:dev")
implementation("com.github.GTNewHorizons:Baubles-Expanded:2.2.4-GTNH:dev")
implementation("com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev")
compileOnly("curse.maven:cofh-core-69162:2388751")
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.43-GTNH:dev")
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.26-GTNH:dev")
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.4.20-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.10:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.3:dev") { transitive = false }
}
@@ -22,9 +22,11 @@ import appeng.api.parts.ICraftingTerminal;
import appeng.client.gui.implementations.GuiMEMonitorable;
import appeng.client.gui.slots.VirtualMEPinSlot;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.slot.AppEngSlot;
import appeng.container.slot.SlotCraftingMatrix;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.core.localization.GuiText;
import appeng.helpers.InventoryAction;
import cpw.mods.fml.common.Optional;
import yalter.mousetweaks.api.IMTModGuiContainer;
@@ -42,6 +44,7 @@ public class GuiWirelessCraftingTerminal extends GuiMEMonitorable implements IMT
public static int craftingGridOffsetX = 80;
public static int craftingGridOffsetY;
private GuiTabButton craftingStatusBtn;
private GuiImgButton clearBtn;
private GuiTrashButton trashBtn;
@@ -59,6 +62,9 @@ public class GuiWirelessCraftingTerminal extends GuiMEMonitorable implements IMT
@Override
protected void actionPerformed(final GuiButton btn) {
// if (btn == this.craftingStatusBtn) {
// NetworkHandler.instance.sendToServer(new PacketSwitchGuis(Reference.GUI_CRAFTING_STATUS));
// } else
if (this.clearBtn == btn) {
Slot s = null;
final Container c = this.inventorySlots;
@@ -109,6 +115,15 @@ public class GuiWirelessCraftingTerminal extends GuiMEMonitorable implements IMT
this.buttonList.add(this.trashBtn = new GuiTrashButton(this.guiLeft + 98, this.guiTop + this.ySize - 104));
this.clearBtn.setHalfSize(true);
this.buttonList.add(
this.craftingStatusBtn = new GuiTabButton(
this.guiLeft + 169,
this.guiTop - 4,
2 + 11 * 16,
GuiText.CraftingStatus.getLocal(),
itemRender));
this.craftingStatusBtn.setHideEdge(13);
craftingGridOffsetX = Integer.MAX_VALUE;
craftingGridOffsetY = Integer.MAX_VALUE;
@@ -42,9 +42,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
+ '.' // revisionVersion
+ net.minecraftforge.common.ForgeVersion.buildVersion
+ ",);"
+ "required-after:"
+ "appliedenergistics2@[rv3-beta-754,);after:"
+ "NotEnoughItems;")
+ "required-after:appliedenergistics2@[rv3-beta-328,);after:NotEnoughItems;")
public class WirelessCraftingTerminal {
private static LoaderState WCTState = LoaderState.NOINIT;
@@ -151,13 +151,7 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
// Add armor slots
for (int i = 0; i < 4; ++i) {
armorSlot[i] = new SlotArmor(
this.player,
this.inventoryPlayer,
this.inventoryPlayer.getSizeInventory() - 1 - i,
(int) 8.5,
(i * 18) - 76,
i);
armorSlot[i] = new SlotArmor(this.player, this.inventoryPlayer, 39 - i, (int) 8.5, (i * 18) - 76, i);
this.addSlotToContainer(armorSlot[i]);
}
k = 0;
@@ -533,7 +527,7 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
}
@Override
public PrimaryGui createPrimaryGui() {
public PrimaryGui getPrimaryGui() {
ContainerOpenContext context = getOpenContext();
return new WCTPrimaryGui(
Reference.GUI_WCT,
@@ -1,7 +1,5 @@
package net.p455w0rd.wirelesscraftingterminal.common.utils;
import static appeng.util.Platform.baublesSlotsOffset;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -122,7 +120,7 @@ public class RandomUtils {
continue;
}
if (item.getItem() instanceof IWirelessCraftingTerminalItem) {
wirelessTerm = new IntObjectImmutablePair<>(i + baublesSlotsOffset, item);
wirelessTerm = new IntObjectImmutablePair<>(i + playerInv.getSizeInventory(), item);
break;
}
}
@@ -22,6 +22,8 @@ import net.p455w0rd.wirelesscraftingterminal.integration.IntegrationHelper;
import net.p455w0rd.wirelesscraftingterminal.integration.abstraction.INEI;
import net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler;
import appeng.api.AEApi;
import appeng.api.storage.data.IAEItemStack;
import appeng.container.slot.SlotCraftingMatrix;
import appeng.container.slot.SlotFakeCraftingMatrix;
import appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler;
@@ -112,6 +114,28 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
}
}
@Override
public List<String> handleTooltip(final GuiContainer arg0, final int arg1, final int arg2,
final List<String> current) {
return current;
}
@Override
public List<String> handleItemDisplayName(final GuiContainer arg0, final ItemStack arg1,
final List<String> current) {
return current;
}
@Override
public List<String> handleItemTooltip(final GuiContainer guiScreen, final ItemStack stack, final int mouseX,
final int mouseY, final List<String> currentToolTip) {
if (guiScreen instanceof GuiWirelessCraftingTerminal) {
return ((GuiWirelessCraftingTerminal) guiScreen).handleItemTooltip(stack, mouseX, mouseY, currentToolTip);
}
return currentToolTip;
}
static final int NEI_REGULAR_SLOT_OFFSET_X = 25;
static final int NEI_REGULAR_SLOT_OFFSET_Y = 6;
@@ -136,6 +160,42 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
public class WCTOverlayHandler implements IOverlayHandler {
/**
* Reduces regular slot offsets to 0, 1, or 2
*/
private static final int REGULAR_SLOT_INDEX_DIVISOR = 18;
/**
* Adds NEI ingredients to the WCT crafting grid.
*
* @param ingredient
* @param overlayItems
* @return
*/
private boolean addCraftingItems(final PositionedStack ingredient, final IAEItemStack[] overlayItems) {
// Calculate the slot positions
int slotX = (ingredient.relx - NEI.NEI_REGULAR_SLOT_OFFSET_X)
/ WCTOverlayHandler.REGULAR_SLOT_INDEX_DIVISOR;
int slotY = (ingredient.rely - NEI.NEI_REGULAR_SLOT_OFFSET_Y)
/ WCTOverlayHandler.REGULAR_SLOT_INDEX_DIVISOR;
// Calculate the slot index
int slotIndex = slotX + (slotY * 3);
// Add the item to the list
overlayItems[slotIndex] = AEApi.instance().storage().createItemStack(ingredient.item);
return true;
}
protected boolean addIngredientToItems(final PositionedStack ingredient, final IAEItemStack[] overlayItems) {
// Pass to regular handler
return this.addCraftingItems(ingredient, overlayItems);
}
protected void addItemsToGUI(final IAEItemStack[] overlayItems) {
// Send the list to the server
// Packet_S_WCT.sendSetCrafting_NEI(Minecraft.getMinecraft().thePlayer,
// overlayItems);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void overlayRecipe(final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex,