Compare commits

..
21 Commits
Author SHA1 Message Date
Dream Master 1b0ecf0e80 update 2025-07-15 22:04:23 +07:00
NeOzay b2187bd961 fix and port the new Localization message system and update AE2 dependency. (#43) 2025-07-15 21:37:13 +07:00
ba9df5d3cd Added the Wireless Terminal to the new Baubles Terminal Slot. (#41)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin Robertz <[email protected]>
2025-06-21 00:43:22 +02:00
Martin Robertz 43ee6dab14 update 2025-06-20 23:59:49 +02:00
lordIcocain 8eae5ade43 make baubles optional (#40) 2025-05-25 15:20:00 +02:00
Martin Robertz c568f2dd29 update 2025-05-16 22:12:23 +02:00
Caedis 0755a0d5f5 Replace Baubles with Baubles Expanded (#38) 2025-05-13 14:18:01 +02:00
Martin Robertz 4e757686c6 update 2025-01-31 20:21:19 +01:00
Michael Doyle 4c491ba2cb [Feature] Shift to pause wireless crafting terminal item movement (#37) 2025-01-28 18:49:55 -06:00
Martin Robertz 2f00f8d5d8 update 2024-10-02 22:40:05 +02:00
Alexdoru 0a761be328 Merge pull request #36 from GTNewHorizons/log
Remove logging that logs time it takes to load each part of the mod
2024-10-02 16:21:37 +02:00
Alexdoru c8fee02cdc remove timing logging 2024-09-30 22:30:57 +02:00
Martin Robertz 9d1e6e9310 Merge pull request #34 from pashabou/master
setItemToCraft (crash fix)
2024-08-04 19:04:36 +07:00
Martin Robertz cbad80517a Merge branch 'master' into master 2024-08-04 19:00:32 +07:00
Martin Robertz 095924d6e5 Merge pull request #35 from Demiu/master
Adjust to AE2 api changes
2024-07-30 23:56:16 +07:00
Dream Master d109fcc774 update 2024-07-30 23:51:48 +07:00
pashabou 76aa7af49b Properly Setup GUI
Don't override away setting the item to craft
2024-07-26 23:40:11 -07:00
Martin Robertz a63db463a7 Merge branch 'master' into master 2024-07-27 09:16:05 +07:00
Demiu e605503e74 Adjust to AE2 api changes 2024-07-26 21:11:43 +02:00
Dream Master d26e3cf04b update 2024-07-25 17:11:34 +07:00
pashabou 12b3381ae5 setItemToCraft (crash fix)
Fixes GTNewHorizons/GT-New-Horizons-Modpack#16769 for change GTNewHorizons/Applied-Energistics-2-Unofficial#523
2024-07-23 01:15:14 -07:00
17 changed files with 102 additions and 118 deletions

No files matched your search

+6 -5
View File
@@ -1,10 +1,11 @@
// Add your dependencies here
dependencies {
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-346-GTNH:dev")
implementation("com.github.GTNewHorizons:Baubles:1.0.4:dev")
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-658-GTNH:dev")
implementation("com.github.GTNewHorizons:Baubles-Expanded:2.1.9-GTNH:dev")
compileOnly("curse.maven:cofh-core-69162:2388751")
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.5.25-GTNH:dev")
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.4.17-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderIO:2.7.1:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.7.64-GTNH:dev")
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.4.20-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:EnderIO:2.9.18:dev") { transitive = false }
}
+14 -3
View File
@@ -14,7 +14,7 @@ modId = ae2wct
modGroup = net.p455w0rd.wirelesscraftingterminal
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
@@ -85,6 +85,11 @@ accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
# Mixin classes will have access to "main" classes, but not the other way around.
separateMixinSourceSet =
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
@@ -117,9 +122,15 @@ minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
# list of strings, with the acceptable keys being(case does not matter):
# cursemaven
# modrinth
excludeWellKnownRepositories =
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
@@ -140,7 +151,7 @@ modrinthProjectId =
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
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-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+5 -3
View File
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -203,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Vendored
+2
View File
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.19'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
}
@@ -37,6 +37,7 @@ import appeng.api.config.TerminalFontSize;
import appeng.api.config.TerminalStyle;
import appeng.api.config.YesNo;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IDisplayRepo;
import appeng.api.util.IConfigManager;
import appeng.api.util.IConfigurableObject;
import appeng.client.ActionKey;
@@ -88,7 +89,7 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
public static int craftingGridOffsetX = 80;
public static int craftingGridOffsetY;
private static String memoryText = "";
private final ItemRepo repo;
private final IDisplayRepo repo;
private final int offsetX = 8;
private final IConfigManager configSrc;
private GuiTabButton craftingStatusBtn;
@@ -654,6 +655,18 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
}
}
@Override
public void handleKeyboardInput() {
super.handleKeyboardInput();
// Pause the terminal when holding shift
this.repo.setPaused(hasShiftDown());
}
private boolean hasShiftDown() {
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
}
protected boolean isPowered() {
return this.repo.hasPower();
}
@@ -3,7 +3,6 @@ package net.p455w0rd.wirelesscraftingterminal.common;
import java.io.File;
import net.minecraft.creativetab.CreativeTabs;
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
import net.p455w0rd.wirelesscraftingterminal.creativetab.CreativeTabWCT;
import net.p455w0rd.wirelesscraftingterminal.handlers.AchievementHandler;
@@ -57,7 +56,6 @@ public class WirelessCraftingTerminal {
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
long stopwatch = WCTLog.beginSection("PreInit");
WirelessCraftingTerminal.WCTState = LoaderState.PREINITIALIZATION;
WirelessCraftingTerminal.INSTANCE = this;
creativeTab = new CreativeTabWCT(CreativeTabs.getNextID(), Reference.MODID).setNoScrollbar();
@@ -66,29 +64,24 @@ public class WirelessCraftingTerminal {
FMLCommonHandler.instance().bus().register(proxy);
AEApi.instance().registries().wireless()
.registerWirelessHandler((IWirelessTermHandler) ItemEnum.WIRELESS_CRAFTING_TERMINAL.getItem());
WCTLog.endSection("PreInit", stopwatch);
}
@EventHandler
public void init(FMLInitializationEvent event) {
long stopwatch = WCTLog.beginSection("Init");
IntegrationRegistry.INSTANCE.init();
WirelessCraftingTerminal.WCTState = LoaderState.INITIALIZATION;
if (!Loader.isModLoaded("dreamcraft")) {
RecipeHandler.loadRecipes(!Reference.WCT_MINETWEAKER_OVERRIDE);
}
AchievementHandler.init();
WCTLog.endSection("Init", stopwatch);
}
@EventHandler
public void postInit(final FMLPostInitializationEvent event) {
long stopwatch = WCTLog.beginSection("PostInit");
IntegrationRegistry.INSTANCE.postInit();
NetworkRegistry.INSTANCE.registerGuiHandler(WirelessCraftingTerminal.INSTANCE, new WCTGuiHandler());
NetworkHandler.instance = new NetworkHandler("WCT");
WirelessCraftingTerminal.proxy.removeItemsFromNEI();
WCTLog.endSection("PostInit", stopwatch);
}
public static LoaderState getLoaderState() {
@@ -19,5 +19,6 @@ public class ContainerCraftAmount extends appeng.container.implementations.Conta
int y = (int) player.posY;
int z = (int) player.posZ;
WCTGuiHandler.launchGui(Reference.GUI_CRAFT_CONFIRM, player, player.worldObj, x, y, z);
setupConfirmationGUI(player);
}
}
@@ -809,7 +809,7 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
if (!isInRange()) {
if (!isBoosterInstalled() || !Reference.WCT_BOOSTER_ENABLED) {
if (this.isValidContainer()) {
this.getPlayerInv().player.addChatMessage(PlayerMessages.OutOfRange.get());
this.getPlayerInv().player.addChatMessage(PlayerMessages.OutOfRange.toChat());
}
this.setValidContainer(false);
}
@@ -823,7 +823,7 @@ public class ContainerWirelessCraftingTerminal extends AEBaseContainer
} else if (!hasAccess(SecurityPermissions.CRAFT, true) || !hasAccess(SecurityPermissions.EXTRACT, true)
|| !hasAccess(SecurityPermissions.INJECT, true)) {
if (this.isValidContainer()) {
this.getPlayerInv().player.addChatMessage(PlayerMessages.CommunicationError.get());
this.getPlayerInv().player.addChatMessage(PlayerMessages.CommunicationError.toChat());
}
this.setValidContainer(false);
} else {
@@ -10,11 +10,14 @@ import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTerminalItem;
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
import baubles.api.BaublesApi;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class RandomUtils {
public static boolean isBaublesLoaded = Loader.isModLoaded("Baubles");
@SideOnly(Side.CLIENT)
public static String color(String color) {
switch (color) {
@@ -62,20 +65,24 @@ public class RandomUtils {
break;
}
}
IInventory handler = BaublesApi.getBaubles(playerInv.player);
if (handler != null) {
invSize = handler.getSizeInventory();
for (int i = 0; i < invSize; ++i) {
ItemStack item = handler.getStackInSlot(i);
if (item == null) {
continue;
}
if (item.getItem() instanceof IWirelessCraftingTerminalItem) {
wirelessTerm = item;
break;
if (isBaublesLoaded) {
IInventory handler = BaublesApi.getBaubles(playerInv.player);
if (handler != null) {
invSize = handler.getSizeInventory();
for (int i = 0; i < invSize; ++i) {
ItemStack item = handler.getStackInSlot(i);
if (item == null) {
continue;
}
if (item.getItem() instanceof IWirelessCraftingTerminalItem) {
wirelessTerm = item;
break;
}
}
}
}
return wirelessTerm;
}
@@ -9,40 +9,15 @@ public class WCTLog {
public static final Logger log = LogManager.getLogger("Wireless Crafting Terminal");
/**
* Displays the section header.
*/
public static long beginSection(final String section) {
log.info(String.format("-=-=-=-=-=-=-=[START] %s=-=-=-=-=-=-=-", section));
return System.currentTimeMillis();
}
/**
* Logs a debug statement.
*
* @param format
* @param data
*/
public static void debug(final String format, final Object... data) {
log.debug(String.format(format, data));
}
/**
* Displays the section footer.
*/
public static void endSection(final String section, final long sectionStartTime) {
log.info(
String.format(
"-=-=-=-=-=-=-=[FINISH] %s in %dms=-=-=-=-=-=-=-",
section,
(System.currentTimeMillis() - sectionStartTime)));
}
/**
* Logs basic info.
*
* @param format
* @param data
*/
public static void info(final String format, final Object... data) {
log.info(String.format(format, data));
@@ -50,9 +25,6 @@ public class WCTLog {
/**
* Logs an error.
*
* @param format
* @param data
*/
public static void severe(final String format, final Object... data) {
log.error(String.format(format, data));
@@ -60,9 +32,6 @@ public class WCTLog {
/**
* Logs a warning.
*
* @param format
* @param data
*/
public static void warning(final String format, final Object... data) {
log.warn(String.format(format, data));
@@ -71,6 +71,7 @@ public class PacketCraftRequest extends WCTPacket {
if (player.openContainer instanceof ContainerCraftConfirm) {
final ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
ccc.setItemToCraft(cca.getItemToCraft());
ccc.setAutoStart(this.heldShift);
ccc.setJob(futureJob);
cca.detectAndSendChanges();
@@ -130,9 +130,9 @@ public class WirelessTerminalGuiObject
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public IItemList<IAEItemStack> getAvailableItems(final IItemList out) {
public IItemList<IAEItemStack> getAvailableItems(final IItemList out, int iteration) {
if (this.itemStorage != null) {
return this.itemStorage.getAvailableItems(out);
return this.itemStorage.getAvailableItems(out, iteration);
}
return out;
}
@@ -33,18 +33,20 @@ import appeng.api.config.SortOrder;
import appeng.api.config.ViewItems;
import appeng.api.features.IWirelessTermHandler;
import appeng.api.util.IConfigManager;
import appeng.core.AppEng;
import appeng.items.tools.powered.powersink.AERootPoweredItem;
import appeng.util.ConfigManager;
import appeng.util.IConfigManagerHost;
import appeng.util.Platform;
import baubles.api.BaubleType;
import baubles.api.IBauble;
import baubles.api.expanded.IBaubleExpanded;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@cpw.mods.fml.common.Optional.Interface(iface = "baubles.api.expanded.IBaubleExpanded", modid = "Baubles|Expanded")
public class ItemWirelessCraftingTerminal extends AERootPoweredItem
implements IWirelessCraftingTerminalItem, IWirelessTermHandler, IBauble {
implements IWirelessCraftingTerminalItem, IWirelessTermHandler, IBaubleExpanded {
public static final String LINK_KEY_STRING = "key";
public static double GLOBAL_POWER_MULTIPLIER = PowerMultiplier.CONFIG.multiplier;
@@ -89,61 +91,37 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
return false;
}
/**
* This method return the type of bauble this is. Type is used to determine the slots it can go into.
*
* @param itemstack
*/
@Override
public BaubleType getBaubleType(ItemStack itemstack) {
public String[] getBaubleTypes(ItemStack itemstack) {
return new String[] { AppEng.BAUBLESLOT };
}
@Override
@cpw.mods.fml.common.Optional.Method(modid = "Baubles")
public BaubleType getBaubleType(ItemStack itemStack) {
return BaubleType.RING;
}
/**
* This method is called once per tick if the bauble is being worn by a player
*
* @param itemstack
* @param player
*/
@Override
public void onWornTick(ItemStack itemstack, EntityLivingBase player) {}
@cpw.mods.fml.common.Optional.Method(modid = "Baubles")
public void onWornTick(ItemStack itemstack, EntityLivingBase player) { /**/ }
/**
* This method is called when the bauble is equipped by a player
*
* @param itemstack
* @param player
*/
@Override
public void onEquipped(ItemStack itemstack, EntityLivingBase player) {}
@cpw.mods.fml.common.Optional.Method(modid = "Baubles")
public void onEquipped(ItemStack itemstack, EntityLivingBase player) { /**/ }
/**
* This method is called when the bauble is unequipped by a player
*
* @param itemstack
* @param player
*/
@Override
public void onUnequipped(ItemStack itemstack, EntityLivingBase player) {}
@cpw.mods.fml.common.Optional.Method(modid = "Baubles")
public void onUnequipped(ItemStack itemstack, EntityLivingBase player) { /**/ }
/**
* can this bauble be placed in a bauble slot
*
* @param itemstack
* @param player
*/
@Override
@cpw.mods.fml.common.Optional.Method(modid = "Baubles")
public boolean canEquip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
/**
* Can this bauble be removed from a bauble slot
*
* @param itemstack
* @param player
*/
@Override
@cpw.mods.fml.common.Optional.Method(modid = "Baubles")
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
@@ -1,5 +1,7 @@
package net.p455w0rd.wirelesscraftingterminal.proxy;
import static net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils.isBaublesLoaded;
import java.util.List;
import java.util.Random;
@@ -74,19 +76,23 @@ public class CommonProxy {
} else {
playerInv = player.inventory;
}
IInventory handler = BaublesApi.getBaubles(player);
if (handler != null) {
for (int i = 0; i < handler.getSizeInventory(); ++i) {
ItemStack item = handler.getStackInSlot(i);
if (item == null) {
continue;
}
if (item.getItem() instanceof IWirelessCraftingTerminalItem) {
wirelessTerm = item;
break;
if (isBaublesLoaded) {
IInventory handler = BaublesApi.getBaubles(player);
if (handler != null) {
for (int i = 0; i < handler.getSizeInventory(); ++i) {
ItemStack item = handler.getStackInSlot(i);
if (item == null) {
continue;
}
if (item.getItem() instanceof IWirelessCraftingTerminalItem) {
wirelessTerm = item;
break;
}
}
}
}
if (wirelessTerm == null) {
int invSize = playerInv.getSizeInventory();
if (invSize <= 0) {