Compare commits

...
13 Commits
Author SHA1 Message Date
Martin Robertz 089d2fc3c2 Merge pull request #29 from GTNewHorizons/fix/magnet_npe_and_updates
Fix/magnet npe and updates
2023-07-30 17:43:57 +02:00
Firenoo 7a907225d6 Update dependencies 2023-07-30 08:25:27 -07:00
Firenoo bcd6fbbdf5 Update buildscript 2023-07-30 08:23:44 -07:00
Firenoo 9188911cce WCTGuiHandler: clean up some old code w/ Java 17 syntax 2023-07-30 08:23:38 -07:00
Firenoo 44d039a517 Fix NPE when magnet card is used w/o WCT in inventory 2023-07-30 08:22:54 -07:00
Martin Robertz b9ed4fadf1 Merge pull request #27 from GTNewHorizons/firenoo/update
Compat update
2023-05-25 19:34:24 +02:00
Martin Robertz f204823bd9 Update dependencies.gradle 2023-05-25 19:11:20 +02:00
Martin Robertz ed58556f48 Merge pull request #28 from GTNewHorizons/firenoo/update-spotless-fixes
Spotless apply for branch firenoo/update for #27
2023-05-25 19:09:49 +02:00
GitHub GTNH Actions 8f10d413be spotlessApply 2023-05-25 16:44:32 +00:00
Firenoo 9dcc47476c Update dependencies + Fix API incompats
The API has changed since the last update, update.
2023-05-25 08:42:23 -07:00
Firenoo cf14b69af4 Update buildscript + gradle
Signed-off-by: Firenoo <[email protected]>
2023-05-25 08:30:43 -07:00
Martin Robertz e00d328e78 Merge pull request #26 from Pilzinsel64/Pilzinsel64-patch-1
Use more uniquie key names
2023-03-19 21:38:04 +01:00
Pilzinsel64 6d9ac27edc Update KeybindHandler.java
Resolves conflict with other mods (specially AE2FC)
2023-03-19 16:04:06 +01:00
12 changed files with 583 additions and 263 deletions

No files matched your search

+503 -174
View File
File diff suppressed because it is too large. Load diff
+6 -7
View File
@@ -1,11 +1,10 @@
// Add your dependencies here
dependencies {
compile("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-99-GTNH:dev")
compile("com.github.GTNewHorizons:Baubles:1.0.1.14:dev")
compile("curse.maven:cofh-core-69162:2388751")
compile("com.github.GTNewHorizons:NotEnoughItems:2.2.27-GTNH:dev")
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.4:dev")
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.4.5-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderIO:2.3.1.43:dev") { transitive = false }
implementation("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-243-GTNH:dev")
implementation("com.github.GTNewHorizons:Baubles:1.0.1.16:dev")
implementation("curse.maven:cofh-core-69162:2388751")
implementation("com.github.GTNewHorizons:NotEnoughItems:2.3.79-GTNH:dev")
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.4.8-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderIO:2.4.24:dev") { transitive = false }
}
+4
View File
@@ -21,6 +21,10 @@ forgeVersion = 10.13.4.1614
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer
# Enables using modern java syntax (up to version 17) via Jabel, while still targetting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+2 -2
View File
@@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -30,7 +30,6 @@ import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import yalter.mousetweaks.api.IMTModGuiContainer;
import appeng.api.config.ActionItems;
import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings;
@@ -64,6 +63,7 @@ import codechicken.nei.TextField;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.ReflectionHelper;
import yalter.mousetweaks.api.IMTModGuiContainer;
@Optional.Interface(modid = "MouseTweaks", iface = "yalter.mousetweaks.api.IMTModGuiContainer")
public class GuiWirelessCraftingTerminal extends AEBaseGui
@@ -459,7 +459,7 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
@Override
public void updateScreen() {
this.devicePowered = containerWCT.isPowered();
this.repo.setPower(devicePowered);
this.repo.setPowered(devicePowered);
super.updateScreen();
if (this.init) {
@@ -708,7 +708,7 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
protected void renderToolTip(final ItemStack stack, final int x, final int y) {
public void renderToolTip(final ItemStack stack, final int x, final int y) {
final Slot s = this.getSlot(x, y);
if (s instanceof SlotME && stack != null) {
final int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
@@ -30,70 +30,61 @@ public class WCTGuiHandler implements IGuiHandler {
@Override
public Object getServerGuiElement(int guiId, EntityPlayer player, World world, int x, int y, int z) {
final IWirelessCraftingTermHandler wh = (IWirelessCraftingTermHandler) AEApi.instance().registries().wireless()
.getWirelessTerminalHandler(RandomUtils.getWirelessTerm(player.inventory));
if (wh != null) {
final WirelessTerminalGuiObject obj = new WirelessTerminalGuiObject(
wh,
RandomUtils.getWirelessTerm(player.inventory),
player,
world,
x,
y,
z);
if (obj != null) {
final IPortableCell terminal = obj;
if (guiId == Reference.GUI_WCT) {
return updateGui(
new ContainerWirelessCraftingTerminal(player, player.inventory),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
obj);
}
if (guiId == Reference.GUI_CRAFTING_STATUS) {
return updateGui(
new ContainerCraftingStatus(player.inventory, terminal),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
obj);
}
if (guiId == Reference.GUI_CRAFT_AMOUNT) {
return updateGui(
new ContainerCraftAmount(player, terminal),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
obj);
}
if (guiId == Reference.GUI_CRAFT_CONFIRM) {
return updateGui(
new ContainerCraftConfirm(player, terminal),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
obj);
}
}
}
if (guiId == Reference.GUI_MAGNET) {
return new ContainerMagnet(player, player.inventory);
}
return null;
final IWirelessCraftingTermHandler wh = (IWirelessCraftingTermHandler) AEApi.instance().registries().wireless()
.getWirelessTerminalHandler(RandomUtils.getWirelessTerm(player.inventory));
if (wh == null) {
return null;
}
final WirelessTerminalGuiObject term = new WirelessTerminalGuiObject(
wh,
RandomUtils.getWirelessTerm(player.inventory),
player,
world,
x,
y,
z);
return switch (guiId) {
case Reference.GUI_WCT -> updateGui(
new ContainerWirelessCraftingTerminal(player, player.inventory),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
term);
case Reference.GUI_CRAFTING_STATUS -> updateGui(
new ContainerCraftingStatus(player.inventory, term),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
term);
case Reference.GUI_CRAFT_AMOUNT -> updateGui(
new ContainerCraftAmount(player, term),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
term);
case Reference.GUI_CRAFT_CONFIRM -> updateGui(
new ContainerCraftConfirm(player, term),
world,
x,
y,
z,
ForgeDirection.UNKNOWN,
term);
default -> null;
};
}
@Override
@@ -30,9 +30,9 @@ public class KeybindHandler {
public static KeyBinding changeMagnetMode;
public static void registerKeybinds() {
openTerminal = new KeyBinding("key.OpenTerminal", Keyboard.CHAR_NONE, "key.categories.ae2wct");
openMagnetFilter = new KeyBinding("key.OpenMagnetFilter", Keyboard.CHAR_NONE, "key.categories.ae2wct");
changeMagnetMode = new KeyBinding("key.SwitchMagnetMode", Keyboard.CHAR_NONE, "key.categories.ae2wct");
openTerminal = new KeyBinding("ae2wct.OpenTerminal", Keyboard.CHAR_NONE, "key.categories.ae2wct");
openMagnetFilter = new KeyBinding("ae2wct.OpenMagnetFilter", Keyboard.CHAR_NONE, "key.categories.ae2wct");
changeMagnetMode = new KeyBinding("ae2wct.SwitchMagnetMode", Keyboard.CHAR_NONE, "key.categories.ae2wct");
ClientRegistry.registerKeyBinding(openTerminal);
ClientRegistry.registerKeyBinding(openMagnetFilter);
ClientRegistry.registerKeyBinding(changeMagnetMode);
@@ -29,6 +29,8 @@ import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
import org.apache.commons.lang3.text.WordUtils;
import org.lwjgl.input.Keyboard;
import com.google.common.base.Splitter;
import appeng.api.config.SecurityPermissions;
import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.api.networking.IGrid;
@@ -40,9 +42,6 @@ import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.data.IAEItemStack;
import appeng.util.Platform;
import com.google.common.base.Splitter;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -22,6 +22,8 @@ import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
import org.lwjgl.input.Keyboard;
import com.google.common.base.Optional;
import appeng.api.config.*;
import appeng.api.features.IWirelessTermHandler;
import appeng.api.util.IConfigManager;
@@ -31,9 +33,6 @@ import appeng.util.IConfigManagerHost;
import appeng.util.Platform;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import com.google.common.base.Optional;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -220,7 +219,7 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
@Override
public boolean canHandle(final ItemStack is) {
return is.getItem() instanceof IWirelessCraftingTerminalItem;
return is != null && is.getItem() instanceof IWirelessCraftingTerminalItem;
}
@Override
@@ -22,10 +22,9 @@ public class Reference {
public static boolean WCT_HASCHECKEDVERSION = false;
// Gui IDs
private static int ae2wctGuiIndex = 0;
public static final int GUI_WCT = ++ae2wctGuiIndex;
public static final int GUI_CRAFTING_STATUS = ++ae2wctGuiIndex;
public static final int GUI_CRAFT_AMOUNT = ++ae2wctGuiIndex;
public static final int GUI_CRAFT_CONFIRM = ++ae2wctGuiIndex;
public static final int GUI_MAGNET = ++ae2wctGuiIndex;
public static final int GUI_WCT = 0;
public static final int GUI_CRAFTING_STATUS = 1;
public static final int GUI_CRAFT_AMOUNT = 2;
public static final int GUI_CRAFT_CONFIRM = 3;
public static final int GUI_MAGNET = 4;
}