Skip to content

Commit

Permalink
Merge branch 'master' into fluid_void_cell
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master authored Dec 21, 2024
2 parents f455f84 + 71d820e commit 8dc45ee
Show file tree
Hide file tree
Showing 16 changed files with 175 additions and 231 deletions.
27 changes: 15 additions & 12 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,31 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.6.44-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-471-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.6.51-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-502-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.8.1:dev')
api('com.github.GTNewHorizons:waila:1.8.2:dev')

implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.7:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.7:dev") {
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}

compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.18:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.22:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.0.3:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.16:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.20:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.54:dev') {
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.19:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.22:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.10:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}

compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.26-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.26-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.74:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.1-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.27-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.2:dev") { transitive = false }

runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.5.18:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.5.22:dev")
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
}


Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
Expand All @@ -19,7 +20,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
Expand All @@ -43,7 +43,6 @@
import appeng.api.config.TerminalStyle;
import appeng.api.config.YesNo;
import appeng.api.util.DimensionalCoord;
import appeng.api.util.WorldCoord;
import appeng.client.gui.IInterfaceTerminalPostUpdate;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiScrollbar;
Expand Down Expand Up @@ -71,6 +70,7 @@
import appeng.util.item.AEItemStack;
import cpw.mods.fml.common.Loader;

// TODO why is this copy pasting all the UI code from AE2 instead of reusing it ???
public class GuiInterfaceWireless extends FCBaseMEGui implements IDropToFillTextField, IInterfaceTerminalPostUpdate {

public static final int HEADER_HEIGHT = 52;
Expand Down Expand Up @@ -220,9 +220,7 @@ public void initGui() {

offsetY = guiButtonAssemblersOnly.yPosition + 18;

if (AEConfig.instance.preserveSearchBar || isSubGui()) {
setSearchString();
}
setSearchString();

this.setScrollBar();
this.repositionSlots();
Expand Down Expand Up @@ -323,7 +321,7 @@ protected void actionPerformed(final GuiButton btn) {

if (btn == this.terminalStyleBox) {
AEConfig.instance.settings.putSetting(iBtn.getSetting(), next);
initGui();
super.scheduleGuiResize();
} else if (btn == searchStringSave) {
AEConfig.instance.preserveSearchBar = next == YesNo.YES;
}
Expand All @@ -344,9 +342,16 @@ public void onGuiClosed() {
}

public void setSearchString() {
searchFieldInputs.setText(searchFieldInputsText);
searchFieldOutputs.setText(searchFieldOutputsText);
searchFieldNames.setText(searchFieldNamesText);
boolean setString = AEConfig.instance.preserveSearchBar || isSubGui();
if (searchFieldInputs.getText().isEmpty() && setString) {
searchFieldInputs.setText(searchFieldInputsText);
}
if (searchFieldOutputs.getText().isEmpty() && setString) {
searchFieldOutputs.setText(searchFieldOutputsText);
}
if (searchFieldNames.getText().isEmpty() && setString) {
searchFieldNames.setText(searchFieldNamesText);
}
}

@Override
Expand Down Expand Up @@ -840,7 +845,8 @@ private void parsePacketCmd(PacketInterfaceTerminalUpdate.PacketEntry cmd) {
addCmd.name,
addCmd.rows,
addCmd.rowSize,
addCmd.online).setLocation(addCmd.x, addCmd.y, addCmd.z, addCmd.dim, addCmd.side)
addCmd.online,
addCmd.p2pOutput).setLocation(addCmd.x, addCmd.y, addCmd.z, addCmd.dim, addCmd.side)
.setIcons(addCmd.selfRep, addCmd.dispRep).setItems(addCmd.items);
masterList.addEntry(entry);
} else if (cmd instanceof PacketInterfaceTerminalUpdate.PacketRemove) {
Expand Down Expand Up @@ -1142,6 +1148,8 @@ public void refreshVisible() {
String output = GuiInterfaceWireless.this.searchFieldOutputs.getText().toLowerCase();

for (InterfaceWirelessEntry entry : entries) {
if (!entry.online || entry.p2pOutput) continue;

var moleAss = AEApi.instance().definitions().blocks().molecularAssembler().maybeStack(1);
entry.dispY = -9999;
if (onlyMolecularAssemblers
Expand Down Expand Up @@ -1232,13 +1240,14 @@ private class InterfaceWirelessEntry {
int guiHeight;
int dispY = -9999;
boolean online;
boolean p2pOutput;
private Boolean[] brokenRecipes;
int numItems = 0;
/** Should recipe be filtered out/grayed out? */
boolean[] filteredRecipes;
private int hoveredSlotIdx = -1;

InterfaceWirelessEntry(long id, String name, int rows, int rowSize, boolean online) {
InterfaceWirelessEntry(long id, String name, int rows, int rowSize, boolean online, boolean p2pOutput) {
this.id = id;
if (StatCollector.canTranslate(name)) {
this.dispName = StatCollector.translateToLocal(name);
Expand All @@ -1254,6 +1263,7 @@ private class InterfaceWirelessEntry {
this.rows = rows;
this.rowSize = rowSize;
this.online = online;
this.p2pOutput = p2pOutput;
this.optionsButton = new GuiFCImgButton(2, 0, "HIGHLIGHT", "YES");
this.optionsButton.setHalfSize(true);
this.renameButton = new GuiFCImgButton(2, 0, "EDIT", "YES");
Expand Down Expand Up @@ -1372,25 +1382,11 @@ public boolean mouseClicked(int mouseX, int mouseY, int btn) {
blockPos.getDimension(),
ForgeDirection.getOrientation(side)));
} else {
/* View in world */
WorldCoord blockPos2 = new WorldCoord(
(int) mc.thePlayer.posX,
(int) mc.thePlayer.posY,
(int) mc.thePlayer.posZ);
if (mc.theWorld.provider.dimensionId != dim) {
mc.thePlayer.addChatMessage(
new ChatComponentTranslation(PlayerMessages.InterfaceInOtherDim.getName(), dim));
} else {
BlockPosHighlighter.highlightBlock(
blockPos,
System.currentTimeMillis() + 500 * WorldCoord.getTaxicabDistance(blockPos, blockPos2));
mc.thePlayer.addChatMessage(
new ChatComponentTranslation(
PlayerMessages.InterfaceHighlighted.getName(),
blockPos.x,
blockPos.y,
blockPos.z));
}
BlockPosHighlighter.highlightBlocks(
mc.thePlayer,
Collections.singletonList(blockPos),
PlayerMessages.InterfaceHighlighted.getName(),
PlayerMessages.InterfaceInOtherDim.getName());
mc.thePlayer.closeScreen();
}
return true;
Expand Down
54 changes: 13 additions & 41 deletions src/main/java/com/glodblock/github/client/gui/GuiLevelTerminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
Expand All @@ -34,7 +35,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
Expand Down Expand Up @@ -65,7 +65,6 @@
import appeng.api.config.YesNo;
import appeng.api.storage.ITerminalHost;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.WorldCoord;
import appeng.client.gui.IGuiTooltipHandler;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiScrollbar;
Expand Down Expand Up @@ -349,8 +348,7 @@ protected void actionPerformed(final GuiButton btn) {

if (btn == terminalStyleBox) {
AEConfig.instance.settings.putSetting(iBtn.getSetting(), next);

reinitialize();
super.scheduleGuiResize();
}

iBtn.set(next);
Expand All @@ -359,11 +357,6 @@ protected void actionPerformed(final GuiButton btn) {
super.actionPerformed(btn);
}

private void reinitialize() {
buttonList.clear();
initGui();
}

@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
mc.getTextureManager().bindTexture(TEX_BG);
Expand Down Expand Up @@ -1327,8 +1320,6 @@ public AppEngInternalInventory getInventory() {
}

public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) {
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;

if (!section.visible || mouseButton < 0 || mouseButton > 2) {
return false;
}
Expand All @@ -1343,7 +1334,7 @@ public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) {
dim,
ForgeDirection.getOrientation(side),
"");
if (isCtrlKeyDown() && isShiftKeyDown() && hasInfinityBoosterCard(player)) {
if (isCtrlKeyDown() && isShiftKeyDown() && hasInfinityBoosterCard(mc.thePlayer)) {
FluidCraft.proxy.netHandler.sendToServer(
new CPacketLevelTerminalCommands(
Action.EDIT,
Expand All @@ -1361,23 +1352,12 @@ public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) {
blockPos.getDimension(),
blockPos.getSide()));
} else {
/* View in world */
WorldCoord blockPos2 = new WorldCoord((int) player.posX, (int) player.posY, (int) player.posZ);
if (mc.theWorld.provider.dimensionId != dim) {
player.addChatMessage(
new ChatComponentTranslation(PlayerMessages.InterfaceInOtherDim.getName(), dim));
} else {
BlockPosHighlighter.highlightBlock(
blockPos,
System.currentTimeMillis() + 500 * WorldCoord.getTaxicabDistance(blockPos, blockPos2));
player.addChatMessage(
new ChatComponentTranslation(
PlayerMessages.InterfaceHighlighted.getName(),
blockPos.x,
blockPos.y,
blockPos.z));
}
player.closeScreen();
BlockPosHighlighter.highlightBlocks(
mc.thePlayer,
Collections.singletonList(blockPos),
PlayerMessages.LevelEmitterHighlighted.getName(),
PlayerMessages.LevelEmitterInAnotherDim.getName());
mc.thePlayer.closeScreen();
}
return true;
}
Expand All @@ -1393,25 +1373,17 @@ public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) {

// send packet to server, request an update
InventoryAction action = switch (mouseButton) {
case 0 -> {
// pickup / set-down.
yield null;
}
case 1 -> {
yield null;
}
case 0 -> null; // pickup / set-down.
case 1 -> null;
case 2 -> {
// creative dupe:
if (player.capabilities.isCreativeMode) {
if (mc.thePlayer.capabilities.isCreativeMode) {
yield InventoryAction.CREATIVE_DUPLICATE;
} else {
yield InventoryAction.AUTO_CRAFT;
}
}
default -> {
// drop item:
yield null;
}
default -> null;// drop item:
};

if (action != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,28 @@ protected void addSwitchGuiBtns() {
this.buttonList.addAll(termBtns);
}

private boolean scheduleGuiResize;

@Override
protected void mouseClicked(int xCoord, int yCoord, int btn) {
super.mouseClicked(xCoord, yCoord, btn);
if (scheduleGuiResize) {
// in the GuiScreen class, the implementation of super.mouseClicked
// ends up looping on the button list and execute the action for any
// button below the mouse.
// Therefore, if we initGui() the terminal in the actionPerformed method below
// it will run the actionPerformed a second time for the new button
// that will end up being below the mouse (if any) after the initGui()
buttonList.clear();
initGui();
scheduleGuiResize = false;
}
}

protected final void scheduleGuiResize() {
scheduleGuiResize = true;
}

@Override
protected void actionPerformed(final GuiButton btn) {
if (btn instanceof GuiFCImgButton) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.inventory.Slot;

import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;

import com.glodblock.github.FluidCraft;
Expand Down Expand Up @@ -116,10 +117,11 @@ protected void actionPerformed(final GuiButton btn) {
"PatternTerminal.Combine",
this.combineDisableBtn == btn ? "1" : "0"));
} else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
final int eventButton = Mouse.getEventButton();
FluidCraft.proxy.netHandler.sendToServer(
new CPacketFluidPatternTermBtns(
"PatternTerminal.Double",
Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0") + (eventButton == 1 ? "1" : "0")));
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
FluidCraft.proxy.netHandler
.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "1"));
Expand Down
Loading

0 comments on commit 8dc45ee

Please sign in to comment.