Skip to content

Commit

Permalink
Changes suggested by @WaitingIdly (thanks) and other misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xC4DE committed Dec 12, 2024
1 parent a11fa4c commit fb1737a
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com._0xc4de.ae2exttable.proxy.CommonProxy;

@Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.12.2]",
dependencies = "required-after:appliedenergistics2;")
dependencies = "required-after:appliedenergistics2;required:mixinbooter;required-after:extendedcrafting;")
public class AE2ExtendedCraftingTable {

public static final Logger LOGGER = LogManager.getLogger(Tags.MODID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion)
@IFMLLoadingPlugin.Name("AE2ExtendedCraftingTable-Core")
@Optional.Interface(iface = "zone.rong.mixinbooter.ILateMixinLoader", modid = "mixinbooter")
//@Optional.Interface(iface = "zone.rong.mixinbooter.ILateMixinLoader", modid = "mixinbooter")
public class AE2ExtendedCraftingTableCore implements IFMLLoadingPlugin, ILateMixinLoader {

public static final String MIXIN_PATH_FORMAT = "mixins.ae2exttable.json";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

public class GuiAdvancedCraftingTerminal extends GuiCraftingTerm {

private GuiImgButton clearBtn;

public GuiAdvancedCraftingTerminal(InventoryPlayer inventoryPlayer, final ITerminalHost te, ContainerAdvancedCraftingTerminal container) {
super(inventoryPlayer, te, container, ExtendedCraftingGUIConstants.ADVANCED_CRAFTING_TERMINAL);
setGuiType(AE2ExtendedGUIs.ADVANCED_CRAFTING_TERMINAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@

public class GuiBasicCraftingTerminal extends GuiCraftingTerm {

public final PartBasicCraftingTerminal te;

public GuiBasicCraftingTerminal(InventoryPlayer inventoryPlayer, final ITerminalHost te, ContainerBasicCraftingTerminal container) {
super(inventoryPlayer, te, container, ExtendedCraftingGUIConstants.BASIC_CRAFTING_TERMINAL);
setGuiType(AE2ExtendedGUIs.BASIC_CRAFTING_TERMINAL);
this.te = (PartBasicCraftingTerminal) te;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

public class GuiEliteCraftingTerminal extends GuiCraftingTerm {

private GuiImgButton clearBtn;

public GuiEliteCraftingTerminal(InventoryPlayer inventoryPlayer, final ITerminalHost te, ContainerEliteCraftingTerminal container) {
super(inventoryPlayer, te, container, ExtendedCraftingGUIConstants.ELITE_CRAFTING_TERMINAL);
setGuiType(AE2ExtendedGUIs.ELITE_CRAFTING_TERMINAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,11 @@

public class GuiUltimateCraftingTerminal extends GuiCraftingTerm {

private GuiImgButton clearBtn;

public GuiUltimateCraftingTerminal(InventoryPlayer inventoryPlayer, final ITerminalHost te, ContainerUltimateCraftingTerminal container) {
super(inventoryPlayer, te, container, ExtendedCraftingGUIConstants.ULTIMATE_CRAFTING_TERMINAL);
setGuiType(AE2ExtendedGUIs.ULTIMATE_CRAFTING_TERMINAL);
}

@Override
protected void actionPerformed(final GuiButton btn) {
super.actionPerformed(btn);

if (this.clearBtn == btn) {
Slot s = null;
final Container c = this.inventorySlots;
for (final Object j : c.inventorySlots) {
if (j instanceof SlotCraftingMatrix) {
s = (Slot) j;
}
}

if (s != null) {
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
NetworkHandler.instance().sendToServer(p);
}
}
}

@Override
public void initGui() {
super.initGui();
// guiLeft is the offset from the left side of the screen
// guiTop is the offset from the top of the screen (often small)
// ySize is how tall it is (like a yMAX) It can be simplified
// This means the offset for the button is essentially an x,y pair
this.buttonList.add(this.clearBtn = new GuiImgButton(this.guiLeft + this.getGuiConst().clearButtonOffset.x, this.guiTop + this.ySize - this.getGuiConst().clearButtonOffset.y, Settings.ACTIONS, ActionItems.STASH));
this.clearBtn.setHalfSize(true);
}

@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(offsetX, offsetY, mouseX, mouseY);

String displayName = Utils.localize(Tags.MODID + "." + this.getGuiType().toString().toLowerCase() + ".crafting");
this.fontRenderer.drawString(displayName, 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752);
}

@Override
protected String getBackground() {
return "textures/gui/ultimate_extended_crafting_terminal.png";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
import com._0xc4de.ae2exttable.client.gui.AE2ExtendedGUIs;
import com._0xc4de.ae2exttable.interfaces.ITerminalGui;
import com._0xc4de.ae2exttable.items.ItemRegistry;
import com._0xc4de.ae2exttable.items.wireless.ItemWirelessAdvancedTerminal;
import com._0xc4de.ae2exttable.items.wireless.ItemWirelessBasicTerminal;
import com._0xc4de.ae2exttable.items.wireless.ItemWirelessEliteTerminal;
import com._0xc4de.ae2exttable.items.wireless.ItemWirelessUltimateTerminal;
import com._0xc4de.ae2exttable.network.ExtendedTerminalNetworkHandler;
import com._0xc4de.ae2exttable.network.packets.PacketSwitchGui;
import net.minecraft.client.gui.GuiButton;
Expand Down Expand Up @@ -34,7 +37,7 @@ public class GuiCraftingStatusMixin {
private void onInit(final InventoryPlayer inventoryPlayer, final ITerminalHost te, CallbackInfo ci) {
if (te instanceof WirelessTerminalGuiObject wt) {
ItemStack item = wt.getItemStack();
if (item.getItem() instanceof ItemWirelessBasicTerminal bt) {
if (item.getItem() instanceof ITerminalGui bt) {
this.extendedOriginalGui = bt.getGuiType();
this.myIcon = item;
return;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[{
"modid": "${modid}",
"name": "${modname}",
"description": "An example mod for Minecraft 1.12.2 with Forge",
"version": "${version}",
"modid": "ae2exttable",
"name": "Extended Crafting Terminals for AE2",
"description": "Extended Crafting Tables implemented as Applied Energistics Crafting Terminals",
"version": "1.0.2",
"mcversion": "${mcversion}",
"logoFile": "",
"url": "",
"authorList": [],
"logoFile": "assets/ae2exttable/meta/logo.png",
"url": "https://github.com/0xC4DE/Extended-Crafting-Terminals-For-AE2",
"authorList": [0xC4DE],
"credits": "",
"dependencies": []
}]
}]

0 comments on commit fb1737a

Please sign in to comment.