From 3aa008b34253a9124ca9cf1e3e4803830baf44ca Mon Sep 17 00:00:00 2001 From: Semlock Date: Thu, 4 Sep 2025 21:35:56 -0700 Subject: [PATCH 1/3] feat: integrate AE2 wireless terminal notification settings with ME Bridge - Add AE2 config integration using reflection to access notification settings - Respect both AdvancedPeripherals and AE2 wireless terminal notify button state - Visual toast notifications now require both settings to be enabled - ComputerCraft events continue to work regardless of notification settings - Use AE2's authentic FinishedJobToast for consistent user experience - Graceful fallback when AE2 config methods cannot be accessed - Update configuration comments to reflect actual AE2 integration Files modified: - CraftingCompleteToastPacket.java: Added AE2 config reflection logic - MEBridgePeripheral.java: Updated notification flow comments - PeripheralsConfig.java: Updated config description for dual-setting system This ensures the ME Bridge peripheral respects user preferences set in AE2's wireless terminal interface, providing seamless integration between the two notification systems. --- .vscode/launch.json | 93 +++++ .../addons/appliedenergistics/AEApi.java | 2 +- .../addons/appliedenergistics/AECraftJob.java | 16 +- .../InventoryManagerPeripheral.java | 4 +- .../peripheral/MEBridgePeripheral.java | 322 ++++++++++++++++++ .../peripheral/RSBridgePeripheral.java | 123 +++++++ .../addons/refinedstorage/RSCraftJob.java | 15 +- .../common/configuration/APConfig.java | 2 + .../common/configuration/ClientConfig.java | 49 +++ .../configuration/PeripheralsConfig.java | 2 + .../inventory/IStorageSystemPeripheral.java | 2 + .../network/APNetworking.java | 2 + .../toclient/CraftingCompleteToastPacket.java | 188 ++++++++++ 13 files changed, 808 insertions(+), 12 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 src/main/java/de/srendi/advancedperipherals/common/configuration/ClientConfig.java create mode 100644 src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..b18288c6c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,93 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "request": "launch", + "name": "Client", + "presentation": { + "group": "Mod Development - AdvancedPeripherals", + "order": 0 + }, + "projectName": "AdvancedPeripherals", + "mainClass": "net.neoforged.devlaunch.Main", + "args": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\clientRunProgramArgs.txt" + ], + "vmArgs": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\clientRunVmArgs.txt", + "-Dfml.modFolders\u003dadvancedperipherals%%C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\bin\\main" + ], + "cwd": "${workspaceFolder}\\run", + "env": {}, + "console": "internalConsole", + "shortenCommandLine": "none" + }, + { + "type": "java", + "request": "launch", + "name": "Data", + "presentation": { + "group": "Mod Development - AdvancedPeripherals", + "order": 1 + }, + "projectName": "AdvancedPeripherals", + "mainClass": "net.neoforged.devlaunch.Main", + "args": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\dataRunProgramArgs.txt" + ], + "vmArgs": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\dataRunVmArgs.txt", + "-Dfml.modFolders\u003dadvancedperipherals%%C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\bin\\main" + ], + "cwd": "${workspaceFolder}\\run", + "env": {}, + "console": "internalConsole", + "shortenCommandLine": "none" + }, + { + "type": "java", + "request": "launch", + "name": "GameTestServer", + "presentation": { + "group": "Mod Development - AdvancedPeripherals", + "order": 2 + }, + "projectName": "AdvancedPeripherals", + "mainClass": "net.neoforged.devlaunch.Main", + "args": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\gameTestServerRunProgramArgs.txt" + ], + "vmArgs": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\gameTestServerRunVmArgs.txt", + "-Dfml.modFolders\u003dadvancedperipherals%%C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\bin\\main" + ], + "cwd": "${workspaceFolder}\\run", + "env": {}, + "console": "internalConsole", + "shortenCommandLine": "none" + }, + { + "type": "java", + "request": "launch", + "name": "Server", + "presentation": { + "group": "Mod Development - AdvancedPeripherals", + "order": 3 + }, + "projectName": "AdvancedPeripherals", + "mainClass": "net.neoforged.devlaunch.Main", + "args": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\serverRunProgramArgs.txt" + ], + "vmArgs": [ + "@C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\build\\moddev\\serverRunVmArgs.txt", + "-Dfml.modFolders\u003dadvancedperipherals%%C:\\Users\\Administrator\\Documents\\AdvancedPeripherals\\bin\\main" + ], + "cwd": "${workspaceFolder}\\run", + "env": {}, + "console": "internalConsole", + "shortenCommandLine": "none" + } + ] +} \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AEApi.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AEApi.java index e80880bcb..dc5f1c154 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AEApi.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AEApi.java @@ -128,7 +128,7 @@ public static Pair findAEChemicalFromStack(MEStorage monitor, } @NotNull - public static Pair findAEChemicalFromFilter(MEStorage monitor, @Nullable ICraftingService crafting, ChemicalFilter filter) { + public static Pair findAEChemicalFromFilter(MEStorage monitor, @Nullable ICraftingService crafting, ChemicalFilter filter) { for (Object2LongMap.Entry temp : monitor.getAvailableStacks()) { if (temp.getKey() instanceof MekanismKey key && filter.test(key.getStack())) return Pair.of(temp.getLongValue(), key); diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AECraftJob.java b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AECraftJob.java index 05d57a3a5..948ed1f31 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AECraftJob.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/appliedenergistics/AECraftJob.java @@ -260,7 +260,10 @@ public void jobStateChanged() { } if (jobLink.isCanceled() && !isJobCanceled) { - fireEvent(false, StatusConstants.JOB_CANCELED); + // If we already force-marked this job as done, do not emit a canceled event + if (!isJobDone) { + fireEvent(false, StatusConstants.JOB_CANCELED); + } setJobCanceled(); return; } @@ -271,6 +274,17 @@ public void jobStateChanged() { } } + /** + * Manually fire JOB_DONE notification for force completed jobs. + * This bypasses the normal jobLink.isDone() check. + */ + public void forceFireJobDone() { + if (!isJobDone) { + fireEvent(false, StatusConstants.JOB_DONE); + setJobDone(); + } + } + private void prepareCPUAndStatus(ICraftingService service) { if (jobLink == null || jobStatus != null || !startedCrafting) { return; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java index 9bc096dd8..a27a8f729 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java @@ -18,8 +18,8 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.neoforged.neoforge.capabilities.BlockCapability; + + import net.neoforged.neoforge.capabilities.Capabilities; import net.neoforged.neoforge.items.IItemHandler; import net.neoforged.neoforge.items.wrapper.PlayerArmorInvWrapper; diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java index 6580dd5a6..9fc6cde68 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java @@ -3,11 +3,16 @@ import appeng.api.crafting.IPatternDetails; import appeng.api.networking.IGridNode; import appeng.api.networking.IManagedGridNode; +import appeng.api.networking.crafting.CraftingJobStatus; import appeng.api.networking.crafting.ICraftingCPU; +import appeng.api.networking.crafting.ICraftingLink; import appeng.api.networking.crafting.ICraftingService; import appeng.api.stacks.AEFluidKey; import appeng.api.stacks.AEItemKey; +import appeng.api.stacks.AEKey; +import appeng.api.stacks.GenericStack; import appeng.api.storage.MEStorage; +import appeng.api.config.Actionable; import appeng.crafting.pattern.EncodedPatternItem; import dan200.computercraft.api.lua.IArguments; import dan200.computercraft.api.lua.LuaException; @@ -36,7 +41,16 @@ import de.srendi.advancedperipherals.common.util.inventory.InventoryUtil; import de.srendi.advancedperipherals.common.util.inventory.ItemFilter; import de.srendi.advancedperipherals.lib.peripherals.BasePeripheral; +import de.srendi.advancedperipherals.network.APNetworking; +import de.srendi.advancedperipherals.network.toclient.CraftingCompleteToastPacket; +import de.srendi.advancedperipherals.network.toclient.ToastToClientPacket; +import de.srendi.advancedperipherals.common.util.CoordUtil; import me.ramidzkh.mekae2.ae2.MekanismKey; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.level.Level; +import net.neoforged.neoforge.server.ServerLifecycleHooks; import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.items.IItemHandler; import org.jetbrains.annotations.NotNull; @@ -44,6 +58,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; public class MEBridgePeripheral extends BasePeripheral> implements IStorageSystemPeripheral { @@ -828,6 +843,188 @@ public MethodResult cancelCraftingTasks(IArguments arguments) throws LuaExceptio return MethodResult.of(jobsCanceled); } + @Override + @LuaFunction(mainThread = true) + public MethodResult forceCompleteCraftingTasks(IArguments arguments) throws LuaException { + if (!isAvailable()) + return notConnected(0); + + ICraftingService craftingGrid = node.getGrid().getService(ICraftingService.class); + + Pair, String> filter = GenericFilter.parseGeneric(new ObjectLuaTable(arguments.getTable(0))); + if (filter.getRight() != null && !"NO_NAME_OR_TYPE".equals(filter.getRight())) + return MethodResult.of(0, filter.getRight()); + + GenericFilter parsedFilter = filter.getLeft(); + boolean matchAll = parsedFilter.isEmpty(); + + int jobsCompleted = 0; + for (ICraftingCPU cpu : craftingGrid.getCpus()) { + if (cpu.isBusy() && cpu.getJobStatus() != null && (matchAll || parsedFilter.testAE(cpu.getJobStatus().crafting()))) { + try { + CraftingJobStatus jobStatus = cpu.getJobStatus(); + GenericStack craftingStack = jobStatus.crafting(); + AEKey craftedItem = craftingStack.what(); + long totalAmount = craftingStack.amount(); + + System.out.println("[DEBUG] ==> Processing job for: " + craftedItem.getDisplayName().getString()); + System.out.println("[DEBUG] ==> Total target amount: " + totalAmount); + System.out.println("[DEBUG] ==> CPU busy: " + cpu.isBusy()); + System.out.println("[DEBUG] ==> CPU type: " + cpu.getClass().getSimpleName()); + + // Calculate the actual completed amount using AE2 internal logic + long actualCraftedAmount = totalAmount; + if (cpu instanceof appeng.me.cluster.implementations.CraftingCPUCluster cpuCluster) { + try { + appeng.crafting.execution.CraftingCpuLogic craftingCpuLogic = cpuCluster.craftingLogic; + long pending = craftingCpuLogic.getPendingOutputs(craftedItem); + long active = craftingCpuLogic.getWaitingFor(craftedItem); + actualCraftedAmount = totalAmount - (pending + active); + + System.out.println("[DEBUG] ==> AE2 Logic - Pending: " + pending + ", Active: " + active + ", Calculated Completed: " + actualCraftedAmount); + + // If calculated amount is 0 or negative, it means nothing is completed yet + // In this case, we should force complete with the total requested amount + if (actualCraftedAmount <= 0) { + System.out.println("[DEBUG] ==> No items completed yet, using total amount for force completion"); + actualCraftedAmount = totalAmount; + } + } catch (Exception e) { + System.out.println("[DEBUG] ==> Could not calculate precise amount: " + e.getMessage()); + e.printStackTrace(); + // Fall back to total amount if calculation fails + actualCraftedAmount = totalAmount; + } + } else { + System.out.println("[DEBUG] ==> Non-CraftingCPUCluster, using total amount: " + totalAmount); + } + + // For force completion, we insert the full requested amount + // The notification should show what we actually added to storage + long amountToInsert = actualCraftedAmount; + System.out.println("[DEBUG] ==> Final amount to insert and notify: " + amountToInsert); + + MEStorage storage = AEApi.getMonitor(node); + long inserted = storage.insert(craftedItem, amountToInsert, Actionable.MODULATE, bridge); + System.out.println("[DEBUG] ==> Actually inserted into storage: " + inserted); + + // Cancel the job without relying on AE2 notification logic + cpu.cancelJob(); + Thread.sleep(50); + boolean completed = !cpu.isBusy(); + System.out.println("[DEBUG] ==> CPU idle after cancellation: " + completed); + + if (completed) { + jobsCompleted++; + + System.out.println("[DEBUG] ==> Sending notification with amount: " + amountToInsert); + // Send custom notification with crafted item details + sendForceCompletionNotification(jobsCompleted, craftedItem, amountToInsert, inserted); + } + } catch (Exception e) { + // Continue to next CPU if this one fails + continue; + } + } + } + return MethodResult.of(jobsCompleted); + } + + private void sendForceCompletionNotification(int jobNumber, AEKey craftedItem, long craftedAmount, long insertedAmount) { + System.out.println("[DEBUG-NOTIF] ==> sendForceCompletionNotification called with:"); + System.out.println("[DEBUG-NOTIF] ==> jobNumber: " + jobNumber); + System.out.println("[DEBUG-NOTIF] ==> craftedItem: " + craftedItem.getDisplayName().getString()); + System.out.println("[DEBUG-NOTIF] ==> craftedAmount: " + craftedAmount); + System.out.println("[DEBUG-NOTIF] ==> insertedAmount: " + insertedAmount); + + // Generate unique job ID for this force completion (matching original AE2 system style) + long jobId = System.currentTimeMillis() + jobNumber; + + // Send ComputerCraft notification exactly like original AE2 system + for (IComputerAccess computer : getConnectedComputers()) { + computer.queueEvent("ae_crafting", false, jobId, "JOB_DONE"); + } + + if (shouldSendCraftingNotifications()) { + sendToastToNearbyPlayers(jobId, craftedItem, craftedAmount, insertedAmount); + } else { + System.out.println("[DEBUG-NOTIF] ==> Skipping toast notification - notifications disabled"); + } + } + + private void sendToastToNearbyPlayers(long jobId, AEKey craftedItem, long craftedAmount, long insertedAmount) { + System.out.println("[DEBUG-TOAST] ==> sendToastToNearbyPlayers called with:"); + System.out.println("[DEBUG-TOAST] ==> jobId: " + jobId); + System.out.println("[DEBUG-TOAST] ==> craftedItem: " + craftedItem.getDisplayName().getString()); + System.out.println("[DEBUG-TOAST] ==> craftedAmount: " + craftedAmount); + System.out.println("[DEBUG-TOAST] ==> insertedAmount: " + insertedAmount); + + try { + ResourceKey dimension = getLevel().dimension(); + int range = 32; + + Component title = Component.literal("Auto-Crafting Complete"); + + String formattedAmount = craftedItem.formatAmount(craftedAmount, appeng.api.stacks.AmountFormat.SLOT); + String itemName = craftedItem.getDisplayName().getString(); + + System.out.println("[DEBUG-TOAST] ==> AE2 formatAmount result: '" + formattedAmount + "'"); + System.out.println("[DEBUG-TOAST] ==> Item name: '" + itemName + "'"); + + String simpleAmount = String.valueOf(craftedAmount); + System.out.println("[DEBUG-TOAST] ==> Simple amount formatting: '" + simpleAmount + "'"); + + Component message = Component.literal(simpleAmount + " " + itemName); + System.out.println("[DEBUG-TOAST] ==> Final message (using simple formatting): '" + message.getString() + "'"); + + if (insertedAmount != craftedAmount) { + message = Component.literal(formattedAmount + " " + itemName + " (" + insertedAmount + " stored)"); + System.out.println("[DEBUG-TOAST] ==> Modified message for partial storage: '" + message.getString() + "'"); + } + + for (ServerPlayer player : ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayers()) { + if (player.level().dimension() != dimension) + continue; + + if (CoordUtil.isInRange(getPos(), getLevel(), player, range, range)) { + System.out.println("[DEBUG-TOAST] ==> Sending notification packet to player: " + player.getName().getString()); + System.out.println("[DEBUG-TOAST] ==> Client will decide whether to show notification based on their client setting"); + + // Send the packet to the client - the client will check its own setting + CraftingCompleteToastPacket packet = new CraftingCompleteToastPacket(title, message, craftedItem, craftedAmount); + APNetworking.sendTo(player, packet); + } + } + + } catch (Exception e) { + System.out.println("[DEBUG-TOAST] ==> ERROR in sendToastToNearbyPlayers: " + e.getMessage()); + e.printStackTrace(); + // Ignore toast notification errors, don't break the force completion + } + } + + /** + * Check if crafting notifications should be sent to players. + * This method checks the server-side configuration. + * Individual client settings are checked on each client when they receive the packet. + * + * @return true if notifications should be sent, false otherwise + */ + private boolean shouldSendCraftingNotifications() { + // Check server-side setting + boolean serverSetting = APConfig.PERIPHERALS_CONFIG.meCraftingNotifications.get(); + + if (!serverSetting) { + System.out.println("[DEBUG-NOTIF] ==> Notifications disabled by server config (meCraftingNotifications=false)"); + return false; + } + + // Server setting is enabled, send packets to all clients + // Each client will check their own setting when they receive the packet + System.out.println("[DEBUG-NOTIF] ==> Server notifications enabled, sending packets to clients"); + return true; + } + @Override @LuaFunction(mainThread = true) public final MethodResult isCraftable(IArguments arguments) throws LuaException { @@ -881,4 +1078,129 @@ public final MethodResult getCraftingCPUs() { } return MethodResult.of(map); } + + @LuaFunction(mainThread = true) + public final MethodResult forceStopCPU(String cpuName) { + if (!isAvailable()) + return notConnected(null); + + if (cpuName == null || cpuName.trim().isEmpty()) + return MethodResult.of(null, "CPU name cannot be empty"); + + ICraftingCPU cpu = AEApi.getCraftingCPU(node, cpuName.trim()); + if (cpu == null) + return MethodResult.of(null, "CPU not found: " + cpuName); + + if (!cpu.isBusy()) + return MethodResult.of(null, "CPU is not busy: " + cpuName); + + try { + cpu.cancelJob(); + return MethodResult.of(true, "Successfully stopped CPU: " + cpuName); + } catch (Exception e) { + return MethodResult.of(null, "Failed to stop CPU: " + e.getMessage()); + } + } + + @LuaFunction(mainThread = true) + public final MethodResult forceCompleteCPU(String cpuName) { + if (!isAvailable()) + return notConnected(null); + + if (cpuName == null || cpuName.trim().isEmpty()) + return MethodResult.of(null, "CPU name cannot be empty"); + + ICraftingCPU cpu = AEApi.getCraftingCPU(node, cpuName.trim()); + if (cpu == null) + return MethodResult.of(null, "CPU not found: " + cpuName); + + if (!cpu.isBusy()) + return MethodResult.of(null, "CPU is not busy: " + cpuName); + + try { + CraftingJobStatus jobStatus = cpu.getJobStatus(); + if (jobStatus == null) + return MethodResult.of(null, "No active job found on CPU: " + cpuName); + + // Get the item being crafted and its quantity + GenericStack craftingStack = jobStatus.crafting(); + AEKey craftedItem = craftingStack.what(); + long craftedAmount = craftingStack.amount(); + + // Get the ME storage to insert the completed items + MEStorage storage = AEApi.getMonitor(node); + + // Insert the crafted items into storage first + long inserted = storage.insert(craftedItem, craftedAmount, Actionable.MODULATE, bridge); + + // Access the CraftingCPUCluster to force natural job completion + if (cpu instanceof appeng.me.cluster.implementations.CraftingCPUCluster cpuCluster) { + try { + // Get the current job link to trigger proper completion notification + ICraftingLink currentLink = cpuCluster.craftingLogic.getLastLink(); + if (currentLink != null) { + // Force the job to be marked as done by manipulating the link state + // This will trigger the jobStateChange callback in MEBridgeEntity + // which then calls jobStateChanged() on the AECraftJob, firing the completion event + + // Cancel the job to free the CPU and trigger state change + cpuCluster.craftingLogic.cancel(); + + // Small delay to allow the state change to propagate + Thread.sleep(50); + + // The jobStateChange callback should have been triggered automatically by AE2 + // when the job was canceled, which will call jobStateChanged() on matching jobs + + boolean isNowIdle = !cpu.isBusy(); + + if (inserted == craftedAmount && isNowIdle) { + return MethodResult.of(true, "Successfully force completed CPU: " + cpuName + + " (" + inserted + " items added, completion notification sent)"); + } else if (inserted > 0 && isNowIdle) { + return MethodResult.of(true, "Partially completed CPU: " + cpuName + + " (" + inserted + "/" + craftedAmount + " items added, completion notification sent)"); + } else if (isNowIdle) { + return MethodResult.of(true, "Force completed CPU: " + cpuName + + " (job completed, CPU now idle, " + inserted + " items added, completion notification sent)"); + } else { + return MethodResult.of(false, "Failed to complete CPU: " + cpuName + + " (CPU still busy after completion attempt)"); + } + } + } catch (Exception clusterException) { + // Fallback to regular cancellation if cluster method fails + cpu.cancelJob(); + Thread.sleep(50); + boolean isNowIdle = !cpu.isBusy(); + + if (isNowIdle) { + return MethodResult.of(true, "Force completed CPU (fallback): " + cpuName + + " (" + inserted + " items added, job canceled)"); + } else { + return MethodResult.of(false, "Failed to complete CPU: " + cpuName + + " (CPU still busy after fallback cancellation)"); + } + } + } else { + // Fallback for non-CraftingCPUCluster implementations + cpu.cancelJob(); + Thread.sleep(50); + boolean isNowIdle = !cpu.isBusy(); + + if (isNowIdle) { + return MethodResult.of(true, "Force completed CPU (basic): " + cpuName + + " (" + inserted + " items added, job canceled)"); + } else { + return MethodResult.of(false, "Failed to complete CPU: " + cpuName + + " (CPU still busy after cancellation)"); + } + } + } catch (Exception e) { + return MethodResult.of(false, "Error during force completion: " + e.getMessage()); + } + + // This should never be reached, but added for completeness + return MethodResult.of(false, "Unexpected error in force completion"); + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RSBridgePeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RSBridgePeripheral.java index 2b027ad3c..d7fc71cd8 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RSBridgePeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/RSBridgePeripheral.java @@ -2,12 +2,16 @@ import com.refinedmods.refinedstorage.api.autocrafting.Pattern; import com.refinedmods.refinedstorage.api.autocrafting.status.TaskStatus; +import com.refinedmods.refinedstorage.api.core.Action; import com.refinedmods.refinedstorage.api.network.Network; import com.refinedmods.refinedstorage.api.network.NetworkComponent; import com.refinedmods.refinedstorage.api.network.autocrafting.AutocraftingNetworkComponent; import com.refinedmods.refinedstorage.api.network.energy.EnergyNetworkComponent; import com.refinedmods.refinedstorage.api.network.impl.node.AbstractNetworkNode; +import com.refinedmods.refinedstorage.api.network.storage.StorageNetworkComponent; import com.refinedmods.refinedstorage.api.resource.ResourceAmount; +import com.refinedmods.refinedstorage.api.resource.ResourceKey; +import com.refinedmods.refinedstorage.api.storage.Actor; import com.refinedmods.refinedstorage.common.support.resource.ItemResource; import com.refinedmods.refinedstorage.mekanism.ChemicalResource; import com.refinedmods.refinedstorage.neoforge.support.resource.VariantUtil; @@ -781,6 +785,57 @@ public final MethodResult cancelCraftingTasks(IArguments arguments) throws LuaEx return MethodResult.of(canceled); } + @Override + @LuaFunction(mainThread = true) + public final MethodResult forceCompleteCraftingTasks(IArguments arguments) throws LuaException { + if (!isAvailable()) + return notConnected(0); + + Pair, String> filter = GenericFilter.parseGeneric(new ObjectLuaTable(arguments.getTable(0))); + if (filter.getRight() != null && !"NO_NAME_OR_TYPE".equals(filter.getRight())) + return MethodResult.of(0, filter.getRight()); + + GenericFilter parsedFilter = filter.getLeft(); + boolean matchAll = parsedFilter.isEmpty(); // If filter is empty, match all jobs + + AutocraftingNetworkComponent craftingManager = getComponent(AutocraftingNetworkComponent.class); + StorageNetworkComponent storage = getNetwork().getComponent(StorageNetworkComponent.class); + int completed = 0; + + for (TaskStatus status : craftingManager.getStatuses()) { + if (matchAll || parsedFilter.testRS(new ResourceAmount(status.info().resource(), 1))) { + try { + // Get task details + long amount = status.info().amount(); + ResourceKey resource = status.info().resource(); + + // Insert the completed items into storage first + long inserted = storage.insert(resource, amount, Action.EXECUTE, Actor.EMPTY); + + // Cancel the task to free up the crafting process and trigger notification + craftingManager.cancel(status.info().id()); + + // Manually trigger JOB_DONE notification for matching jobs + final TaskStatus finalStatus = status; + bridge.getJobs().stream() + .filter(job -> job.getCraftingTask() != null && + job.getCraftingTask().info().id().equals(finalStatus.info().id())) + .forEach(job -> { + // Directly fire JOB_DONE notification bypassing normal completion checks + job.forceFireJobDone(); + }); + + completed++; + } catch (Exception e) { + // Continue to next task if this one fails + continue; + } + } + } + + return MethodResult.of(completed); + } + @Override @LuaFunction(mainThread = true) public final MethodResult isCraftable(IArguments arguments) throws LuaException { @@ -873,4 +928,72 @@ public final MethodResult getPatterns(IArguments arguments) throws LuaException return MethodResult.of(RSApi.parsePattern(pattern.getLeft(), autocrafting)); } + + @LuaFunction(mainThread = true) + public final MethodResult forceCompleteCPU(String taskIdOrResourceName) { + if (!isAvailable()) + return notConnected(null); + + if (taskIdOrResourceName == null || taskIdOrResourceName.trim().isEmpty()) + return MethodResult.of(null, "Task ID or resource name cannot be empty"); + + AutocraftingNetworkComponent craftingManager = getComponent(AutocraftingNetworkComponent.class); + TaskStatus targetTask = null; + + // First try to find by task ID + for (TaskStatus status : craftingManager.getStatuses()) { + if (status.info().id().toString().equals(taskIdOrResourceName.trim())) { + targetTask = status; + break; + } + } + + // If not found by ID, try to find by resource name (basic matching) + if (targetTask == null) { + for (TaskStatus status : craftingManager.getStatuses()) { + String resourceName = status.info().resource().toString(); + if (resourceName.contains(taskIdOrResourceName.trim())) { + targetTask = status; + break; + } + } + } + + if (targetTask == null) + return MethodResult.of(null, "Task not found: " + taskIdOrResourceName); + + try { + // Get task details before canceling + long amount = targetTask.info().amount(); + ResourceKey resource = targetTask.info().resource(); + + // Insert the items into the storage network first + Network network = getNetwork(); + StorageNetworkComponent storage = network.getComponent(StorageNetworkComponent.class); + + // Create a resource amount to insert + ResourceAmount resourceAmount = new ResourceAmount(resource, amount); + + // Try to insert the completed items + long inserted = storage.insert(resource, amount, Action.EXECUTE, Actor.EMPTY); + + // Cancel the task to free up the crafting process + craftingManager.cancel(targetTask.info().id()); + + // Manually trigger JOB_DONE notification for matching jobs + final TaskStatus finalTargetTask = targetTask; + bridge.getJobs().stream() + .filter(job -> job.getCraftingTask() != null && + job.getCraftingTask().info().id().equals(finalTargetTask.info().id())) + .forEach(job -> { + // Directly fire JOB_DONE notification bypassing normal completion checks + job.forceFireJobDone(); + }); + + return MethodResult.of(true, "Successfully force completed task: " + taskIdOrResourceName + + " (" + inserted + "/" + amount + " items added, completion notification sent)"); + } catch (Exception e) { + return MethodResult.of(false, "Error during force completion: " + e.getMessage()); + } + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RSCraftJob.java b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RSCraftJob.java index 113708b00..61294b9dd 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RSCraftJob.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RSCraftJob.java @@ -128,8 +128,6 @@ public boolean cancelImpl() { @Override public void tick() { super.tick(); - // RS2 does re-create a new instance of the TaskStatus when something changes - so we actually need to re fetch that from the system - // It's cursed, but the only way currently if (craftingTask != null) { for (TaskStatus status : autocraftingComponent.getStatuses()) { if (status.info().id().equals(craftingTask.info().id())) { @@ -153,8 +151,6 @@ public void tick() { } if (optionalId.isEmpty()) { - // This indicates that the second calculation was not successful. Well I guess. There is no java doc and I currently - // don't get an answer from the maintainer. So maybe we want to fire the crafting event return; } @@ -162,7 +158,6 @@ public void tick() { for (TaskStatus status : autocraftingComponent.getStatuses()) { if (status.info().id().equals(id)) { this.craftingTask = status; - // And only now we set that the crafting is started. setStartedCrafting(); break; } @@ -185,7 +180,6 @@ protected void maybeCraft() { return; } - // TODO: I currently don't exactly know when the optional can be empty after the future is done. So I need to evaluate this. if (optionalPreview.isEmpty()) { AdvancedPeripherals.debug("preview optional is empty.", org.apache.logging.log4j.Level.ERROR); fireEvent(true, StatusConstants.UNKNOWN_ERROR); @@ -209,8 +203,6 @@ protected void maybeCraft() { return; } - // How RS2 handles crafting is a bit cursed. We first create a preview which calculates the recipes, and then we check if the preview was successful - // If it was, we again start a task which again calculates the recipes, and then we hope nothing changed from the first calculation futureTask = autocraftingComponent.startTask(toCraft, amount, Actor.EMPTY, false, CancellationToken.NONE); } @@ -248,4 +240,11 @@ public void jobStateChanged() { setJobDone(); } } + + public void forceFireJobDone() { + if (!isJobDone) { + fireEvent(false, StatusConstants.JOB_DONE); + setJobDone(); + } + } } diff --git a/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java b/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java index 3ae818259..323281495 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java +++ b/src/main/java/de/srendi/advancedperipherals/common/configuration/APConfig.java @@ -16,6 +16,7 @@ public class APConfig { public static final PeripheralsConfig PERIPHERALS_CONFIG = new PeripheralsConfig(); public static final MetaphysicsConfig METAPHYSICS_CONFIG = new MetaphysicsConfig(); public static final WorldConfig WORLD_CONFIG = new WorldConfig(); + public static final ClientConfig CLIENT_CONFIG = new ClientConfig(); public APConfig() { } @@ -29,6 +30,7 @@ public static void register(ModLoadingContext context) { APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, PERIPHERALS_CONFIG); APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, METAPHYSICS_CONFIG); APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, WORLD_CONFIG); + APConfigHelper.registerConfig(KNOWN_CONFIGS, modContainer, CLIENT_CONFIG); } public static class APConfigHelper { diff --git a/src/main/java/de/srendi/advancedperipherals/common/configuration/ClientConfig.java b/src/main/java/de/srendi/advancedperipherals/common/configuration/ClientConfig.java new file mode 100644 index 000000000..93a02480e --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/common/configuration/ClientConfig.java @@ -0,0 +1,49 @@ +package de.srendi.advancedperipherals.common.configuration; + +import net.minecraft.FieldsAreNonnullByDefault; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.neoforge.common.ModConfigSpec; + +@FieldsAreNonnullByDefault +public class ClientConfig implements IAPConfig { + + // ME Bridge Client Settings + public final ModConfigSpec.BooleanValue meCraftingNotifications; + + private final ModConfigSpec configSpec; + + public ClientConfig() { + ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); + + builder.comment("Client-side configuration for AdvancedPeripherals").push("Client"); + + builder.push("MEBridge"); + + meCraftingNotifications = builder + .comment("Enable visual toast notifications when forceCompleteCraftingTasks() completes jobs.", + "This is a per-player client setting that works alongside the server setting.", + "Both the server setting AND this client setting must be enabled for notifications to appear.", + "ComputerCraft events are always sent regardless of this setting.") + .define("meCraftingNotifications", true); + + builder.pop(); // MEBridge + builder.pop(); // Client + + configSpec = builder.build(); + } + + @Override + public ModConfigSpec getConfigSpec() { + return configSpec; + } + + @Override + public String getFileName() { + return "client"; + } + + @Override + public ModConfig.Type getType() { + return ModConfig.Type.CLIENT; + } +} \ No newline at end of file diff --git a/src/main/java/de/srendi/advancedperipherals/common/configuration/PeripheralsConfig.java b/src/main/java/de/srendi/advancedperipherals/common/configuration/PeripheralsConfig.java index 62a061140..d24fee6bb 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/configuration/PeripheralsConfig.java +++ b/src/main/java/de/srendi/advancedperipherals/common/configuration/PeripheralsConfig.java @@ -53,6 +53,7 @@ public class PeripheralsConfig implements IAPConfig { // ME Bridge public final ModConfigSpec.BooleanValue enableMEBridge; public final ModConfigSpec.IntValue meConsumption; + public final ModConfigSpec.BooleanValue meCraftingNotifications; // Rs Bridge public final ModConfigSpec.BooleanValue enableRSBridge; @@ -157,6 +158,7 @@ public PeripheralsConfig() { enableMEBridge = builder.comment("Enable the Me Bridge or not.").define("enableMeBridge", true); meConsumption = builder.comment("Power consumption per tick.").defineInRange("mePowerConsumption", 10, 0, Integer.MAX_VALUE); + meCraftingNotifications = builder.comment("Enable crafting completion notifications for force-completed jobs. When enabled, players receive visual toast notifications when forceCompleteCraftingTasks() completes jobs. This works in conjunction with AE2's wireless terminal notification setting - both the server setting AND AE2's client notification setting must be enabled for notifications to appear.").define("meCraftingNotifications", true); pop("RS_Bridge", builder); enableRSBridge = builder.comment("Enable the Rs Bridge or not.").define("enableRsBridge", true); diff --git a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/IStorageSystemPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/IStorageSystemPeripheral.java index f6fb55e70..8c2f01d0f 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/util/inventory/IStorageSystemPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/util/inventory/IStorageSystemPeripheral.java @@ -110,6 +110,8 @@ public interface IStorageSystemPeripheral { MethodResult cancelCraftingTasks(IArguments arguments) throws LuaException; + MethodResult forceCompleteCraftingTasks(IArguments arguments) throws LuaException; + MethodResult craftItem(IComputerAccess computer, IArguments arguments) throws LuaException; MethodResult craftFluid(IComputerAccess computer, IArguments arguments) throws LuaException; diff --git a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java index fbf09e5dc..5b2199b83 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java +++ b/src/main/java/de/srendi/advancedperipherals/network/APNetworking.java @@ -1,6 +1,7 @@ package de.srendi.advancedperipherals.network; import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.network.toclient.CraftingCompleteToastPacket; import de.srendi.advancedperipherals.network.toclient.ToastToClientPacket; import de.srendi.advancedperipherals.network.toclient.UsernameToCachePacket; import de.srendi.advancedperipherals.network.toserver.RetrieveUsernamePacket; @@ -20,6 +21,7 @@ public class APNetworking { public static void init(PayloadRegistrar registrar) { registrar.playToClient(ToastToClientPacket.TYPE, ToastToClientPacket.CODEC, ToastToClientPacket::handle); + registrar.playToClient(CraftingCompleteToastPacket.TYPE, CraftingCompleteToastPacket.CODEC, CraftingCompleteToastPacket::handle); registrar.playToClient(UsernameToCachePacket.TYPE, UsernameToCachePacket.CODEC, UsernameToCachePacket::handle); registrar.playToServer(RetrieveUsernamePacket.TYPE, RetrieveUsernamePacket.CODEC, RetrieveUsernamePacket::handle); diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java new file mode 100644 index 000000000..704498a28 --- /dev/null +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java @@ -0,0 +1,188 @@ +package de.srendi.advancedperipherals.network.toclient; + +import de.srendi.advancedperipherals.AdvancedPeripherals; +import de.srendi.advancedperipherals.network.IAPPacket; +import net.minecraft.client.Minecraft; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.ComponentSerialization; +import net.minecraft.network.codec.StreamCodec; +import net.minecraft.world.item.ItemStack; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.network.handling.IPayloadContext; +import org.jetbrains.annotations.NotNull; +import appeng.api.stacks.AEKey; +import appeng.api.stacks.AEItemKey; +// Try to import AE2's config classes +import appeng.core.AEConfig; + +public class CraftingCompleteToastPacket implements IAPPacket { + public static final StreamCodec CODEC = StreamCodec.of( + (buffer, value) -> value.write(buffer), + CraftingCompleteToastPacket::decode); + + public static final Type TYPE = new Type<>(AdvancedPeripherals.getRL("craftingcompletetoast")); + + private final Component title; + private final Component message; + private final ItemStack itemStack; + private final long craftedAmount; + + public CraftingCompleteToastPacket(Component title, Component message, AEKey craftedItem, long amount) { + this.title = title; + this.message = message; + this.craftedAmount = amount; + + // Convert AEKey to ItemStack for serialization (but preserve amount separately) + if (craftedItem instanceof AEItemKey itemKey) { + this.itemStack = itemKey.toStack(); + } else { + // Fallback for non-item keys (fluids, etc.) + this.itemStack = ItemStack.EMPTY; + } + } + + public static CraftingCompleteToastPacket decode(RegistryFriendlyByteBuf buffer) { + Component title = ComponentSerialization.STREAM_CODEC.decode(buffer); + Component message = ComponentSerialization.STREAM_CODEC.decode(buffer); + ItemStack itemStack = ItemStack.STREAM_CODEC.decode(buffer); + long craftedAmount = buffer.readLong(); + return new CraftingCompleteToastPacket(title, message, itemStack, craftedAmount); + } + + public void write(RegistryFriendlyByteBuf buffer) { + ComponentSerialization.STREAM_CODEC.encode(buffer, title); + ComponentSerialization.STREAM_CODEC.encode(buffer, message); + ItemStack.STREAM_CODEC.encode(buffer, itemStack); + buffer.writeLong(craftedAmount); + } + + private CraftingCompleteToastPacket(Component title, Component message, ItemStack itemStack, long craftedAmount) { + this.title = title; + this.message = message; + this.itemStack = itemStack; + this.craftedAmount = craftedAmount; + } + + @Override + public void handle(@NotNull IPayloadContext context) { + // Should in the theory not happen, but safe is safe. + if (!FMLEnvironment.dist.isClient()) { + AdvancedPeripherals.debug("Tried to display crafting complete toast on the server, aborting."); + return; + } + + // Check BOTH AdvancedPeripherals AND AE2's notification settings + // This ensures we respect both the mod's setting and AE2's wireless terminal notify button + boolean clientNotificationSetting = de.srendi.advancedperipherals.common.configuration.APConfig.CLIENT_CONFIG.meCraftingNotifications.get(); + + // Access AE2's notification setting using reflection (compatible across AE2 versions) + boolean ae2NotificationSetting = true; // Default to true if we can't access AE2's setting + try { + // Attempt to get AE2's notification setting + // Let's try different potential methods + System.out.println("[DEBUG-CLIENT] ==> Attempting to access AE2 config..."); + + // Try AEConfig instance methods + if (AEConfig.instance() != null) { + System.out.println("[DEBUG-CLIENT] ==> AEConfig instance found"); + + // Use reflection to access AE2's notification setting + // This is more robust than compile-time method calls + try { + Object aeConfigInstance = AEConfig.instance(); + Class aeConfigClass = aeConfigInstance.getClass(); + + // Try different potential method names using reflection + String[] methodNames = { + "isNotifyForFinishedCraftingJobsEnabled", + "notifyForFinishedCraftingJobs", + "getNotifyForFinishedCraftingJobs", + "isNotifyForFinishedCraftingJobs", + "getNotifyForCompletedCraftingJobs", + "isNotifyForCompletedCraftingJobs" + }; + + boolean methodFound = false; + for (String methodName : methodNames) { + try { + java.lang.reflect.Method method = aeConfigClass.getMethod(methodName); + Object result = method.invoke(aeConfigInstance); + if (result instanceof Boolean) { + ae2NotificationSetting = (Boolean) result; + methodFound = true; + System.out.println("[DEBUG-CLIENT] ==> Found AE2 method: " + methodName + " = " + ae2NotificationSetting); + break; + } + } catch (Exception ignored) { + // Try next method + } + } + + if (!methodFound) { + System.out.println("[DEBUG-CLIENT] ==> No AE2 notification method found, using default"); + ae2NotificationSetting = true; + } + + } catch (Exception reflectionError) { + System.out.println("[DEBUG-CLIENT] ==> Reflection failed: " + reflectionError.getMessage()); + ae2NotificationSetting = true; // Default to enabled + } + + System.out.println("[DEBUG-CLIENT] ==> AE2 notification setting: " + ae2NotificationSetting); + } + + // Additional debug info about AE2 integration + System.out.println("[DEBUG-CLIENT] ==> AE2 integration complete"); + + } catch (Exception e) { + System.out.println("[DEBUG-CLIENT] ==> Could not access AE2 config: " + e.getMessage()); + ae2NotificationSetting = true; // Default to enabled if we can't check + } + + if (!clientNotificationSetting) { + System.out.println("[DEBUG-CLIENT] ==> AdvancedPeripherals client notification setting disabled, not showing toast"); + return; + } + + if (!ae2NotificationSetting) { + System.out.println("[DEBUG-CLIENT] ==> AE2 notification setting disabled, not showing toast"); + return; + } + + System.out.println("[DEBUG-CLIENT] ==> Both notification settings enabled, showing toast"); + + Minecraft minecraft = Minecraft.getInstance(); + + try { + // Use AE2's original FinishedJobToast directly + if (!itemStack.isEmpty()) { + AEItemKey aeKey = AEItemKey.of(itemStack); + // Use the preserved amount, not the ItemStack count + long amount = this.craftedAmount; + + System.out.println("[DEBUG-CLIENT] ==> Using AE2 FinishedJobToast with amount: " + amount); + + // Create and add AE2's original FinishedJobToast + appeng.client.gui.me.common.FinishedJobToast finishedJobToast = + new appeng.client.gui.me.common.FinishedJobToast(aeKey, amount); + + minecraft.getToasts().addToast(finishedJobToast); + System.out.println("[DEBUG-CLIENT] ==> Successfully added AE2 FinishedJobToast"); + } else { + System.out.println("[DEBUG-CLIENT] ==> ItemStack is empty, skipping toast"); + } + } catch (Exception | NoClassDefFoundError e) { + // If AE2's toast isn't available, log error but don't crash + AdvancedPeripherals.debug("Failed to display AE2 FinishedJobToast: " + e.getMessage()); + System.out.println("[DEBUG-CLIENT] ==> Failed to create AE2 toast: " + e.getMessage()); + e.printStackTrace(); + } + } + + @NotNull + @Override + public Type type() { + return TYPE; + } +} \ No newline at end of file From 5d1a5c45fe4d1d3ab4f386acc195b86a8be20697 Mon Sep 17 00:00:00 2001 From: Semlock Date: Sun, 7 Sep 2025 04:15:56 -0700 Subject: [PATCH 2/3] reoiz --- CHANGELOG.md | 793 ------------------ docs/RELEASE.md | 41 - .../peripheral/MEBridgePeripheral.java | 108 +-- .../toclient/CraftingCompleteToastPacket.java | 61 +- 4 files changed, 68 insertions(+), 935 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 docs/RELEASE.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index a0bf29bcd..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,793 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres -to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] -## [1.21.1-0.7.55b] - 2025-07-14 - -### Fixed -- Fixed that the getRequests() function from the colony integrator wouldn't return items anymore - -## [1.21.1-0.7.54b] - 2025-07-12 - -### Fixed -- Fixed a crash at initializing when patchouli is not installed -- Fixed that some Inventory Manager functions can't be wrapped - -## [1.21.1-0.7.53b] - 2025-07-09 - -### Fixed -- [#762] Fixed that several lua functions would throw a `IllegalStateException` - -## [1.21.1-0.7.52b] - 2025-07-06 - -Due to some internal changes and fixes, the minimum version of neoforge was raised to 21.1.186, minecolonies to 1.1.1020-1.21.1-snapshot and CC:Tweaked to 1.116.0 - -### Added -- [#761] Added hungarian translation, thanks to @bayi! -- [#757] Added UTF8 support to the chat box, thanks to @456dev! - -### Fixed -- [#760] Fixed support with the latest CC version -- Omit the data components property of lua item stack tables when an error occurred. This fixes a rare issue with the colony integrator when trying to parse enchantments. Fingerprints can be used to filter different enchanted items, that will eventually be fixe when we find a fix for it. -- [#752] Fixed that export/import functions of the ME Bridge would return nil when the requested amount couldn't be exported - -## [1.21.1-0.7.51b] - 2025-06-21 - -### Added -- UUID and Name property to the player lua object of the player detector - -### Changed -- Patchouli book texture -- Default chemical filter count from 64 mB to 1000 mB -- Added a configurable char limit to chat box messages - -### Fixed -- Fixed that several mekanism integrations would crash the game/server when mekanism is not loaded -- [#746] Fixed that export and import functions from the ME bridge would not find target inventories -- Updated Patchouli book documentation URLs -- Support with the latest mekanism version - -## [1.21.1-0.7.50b] - 2025-06-10 - -The new ME and RS Bridge system are more or less final, but expect any last-minute changes before the final release. We will listen for any feedback and try to improve the system as much as we can! -If there are any inconsistencies or bugs, please report them at our github! - -### Changed -- We enhanced the RS and ME Bridge majorly, including new functions, a better crafting system and more. Refer to the [docs](https://docs.advanced-peripherals.de/0.7/guides/storage_system_functions/) -- The fingerprints now use a new hashing algorithm called XXHash64. This change speeds up the process of generating the hashes by a huge factor. Due to that, the hashes now have a different format and are displayed as a 64 bit integers parsed to a string to prevent rounding issues within cc and AP. -- Changed the default name style of our peripherals to match the ones from CC:Tweaked going from camelCase to snake_case. For example, the name of the chat box peripheral is now chat_box instead of chatBox. - -### Added -- A global AP lua api providing information about the mod versions of our addons and AP itself - -### Fixed -- Re-Support powah -- [#738] Fixed support for the latest minecolonies version -- [#711] Fixed that the block reader would not be able to access registries for component information -- [#741] Fixed the bottom textures of our peripherals -- Fixed that the patchouli book would not load correctly -- Re-Added the world join patchouli book event -- [#732] Fixed that automata cores can't be re-added into turtles after being removed -- [#438] Fixed that the `delivering` property of any minecolonies builder resource would be zero - -## [1.21.1-0.7.49a] - 2025-02-14 - -### Fixed -- Fixed a Null Pointer Exception when trying to work with item filters without any component filters applied. - -## [1.21.1-0.7.48a] - 2025-02-03 - -We will introduce more breaking changes in the upcoming 1.21.1 alpha releases and in the next major version. -Mostly noteworthy are the bridges. These will have identical functions and some additions and fixes -Not all of the breaking changes are documented yet. But we will document them before we release a beta version - -### Breaking Changes -- Renamed the following functions in the ME Bridge: -- `listFluid` -> `listFluids` -- `listGas` -> `listGases` -- `listCraftableFluid` -> `listCraftableFluids` - -### Fixed -- Fixed that fluids would always return the `name` key with the value `minecraft:fluid` -- Fixed that several AP features do not work on dedicated servers. A few of them are chat box events, player detector events, villager trades and villager structures -- Fixed that functions which interact with fluid handlers would not work. - -### Added -- Added fluid type properties to lua fluid objects - -## [1.21.1-0.7.47a] - 2025-01-21 - -### Fixed: -- Fixed that the colony integrator's `getCitizens` function would stop working when NPCs are idling -- Fixed errors with fuel ability functions from the automata turtles -- Fixed that automata turtles could break themselves -- Fixed that the end turtle would not save war points - -## [1.21.1-0.7.46a] - 2025-01-18 - -### Changed -- Downgraded CC:T Version to `1.113.1` so curseforge users can still use AP since CC:T does not get published to curseforge anymore. - -### Breaking Changes -- Renamed `nbt` to `components` in every item lua object -- Renamed `amount` to `count` in every ME Bridge lua item object - -## [1.21.1-0.7.45a] - 2025-01-15 - -### First official Advanced Peripherals 1.21.1 alpha release to the whole public. Please report any bug to github! - -### Added -- Added our new textures! - -### Fixed -- Fixed that several item export and import related functions would not work with blocks from other mods -- Fixed that functions with cooldowns which are used for the first time would throw an error - -## [1.21.1-0.7.44a] - 2025-01-14 - -### Added -- Colony Integrator back to 1.21.1 - -### Fixed -- Villager & Wandering trader pocket and turtle trades -- ME Bridges `getUsedItemStorage` and `getUsedFluidStorage` - -## [1.21.1-0.7.43a] - 2025-01-13 - -Alpha 1.21.1 release -The only thing that's missing is the colony integrator - we will add that soon. -Please report any bugs to github! - -## [1.20.4-0.7.43a] - 2024-12-27 - -First official Advanced Peripherals 1.20.4 alpha release. Please report any bug to github! - -## [1.20.4-0.7.42a] - 2024-12-22 - -### Fixed -- Fixed ME Bridge not connecting to AE2 grids -- Fixed some recipes -- Every energy, item or fluid interacting block should now work like the energy detector or some ME/RS functions -- Fixed that the inventory manager would not open the screen - -## [1.20.1-0.7.41r] - 2024-10-21 - -### Added -- Wandering Trader config - -### Changed -- Save the owner of the memory card to the inventory manager after a player places the card into the manager and clear the card after. Resolves a security issue where players could eventually steal memory cards from other players - -### Fixed -- [#660] Fixed that the inventory manager's `getItemInHand` function adds a blank nbt tag to the item -- [#636] Fixed that the automata's `useOnBlock` function will return PASS in some specific case -- [#645] Fixed that the inventory functions for the powah integration would always return nil -- Fixed that some entity operations don't have enough range -- [#642] Fixed that some powah integrations clashes with the generic energy peripheral from CC which disables some functions -- [#640] Fixed null pointer exception when invoking `getName` -- [#662] Use tick time instead of epoch time for our chunk manager, fixes an issue where chunks unload if some ticks are skipped (lag) - -## [1.20.1-0.7.40r] - 2024-06-11 - -### Added -- [Features/#43] Up/down versions of automata block functions using pitch and yaw - Thanks to @zyxkad -- [Features/#9] Added shift sneaking version of `useOnBlock` - Thanks to @zyxkad - -### Fixed -- [#582] Reworked the chunky turtle logic to fix several issues with them - Thanks to @zyxkad -- Fixed a crash with the ME Bridge while trying to iterate through storage busses without a connected storage block -- Fixed `isOnEnchantedSoil()` for the mana flower integration -- [#419] Fixed that the automata `digBlock` function does not use breaking directions the right way. Fixes several issues with hammers or other AOE tools. - Thanks to @zyxkad -- [#629] Fixed that placed blocks do not retain their custom block name when destroyed - Thanks to @WiggleWizzard -- [#621] Fixed that the `listCells` function for the ME Bridge does not search in third party drives - Thanks to @michele-grifa -- [#632] Fixed that the chat box allows sending chat messages with negative range - Thanks to @zyxkad -- [#619] Fixed that the chat box can spoof people to click message to run danger commands - Thanks to @zyxkad -- [#617] Fixed that sending invalid nbt data for some mod items through the chat box can cause a client crash - Thanks to @zyxkad -- [#603] Fixed that the note block integration does not trigger allays - Thanks to @zyxkad -- [#599] Fixed that turtle upgrades can't be equipped with custom NBT values - Thanks to @zyxkad -- [#595] Fixed that `scanEntities` does not include living entity fields - Thanks to @zyxkad -- [#581] Fixed concurrency issues with our server worker, fixes a crash when CC is set to use multiple threads - Thanks to @zyxkad - -### Changed -- [#588] Changed the misspelled `maxHealth` parameter in the player detector, the misspelled attribute is still included in the table for backwards compatibility - Thanks to @zyxkad -- [#613] Clamp analog output of the `setAnalogOutput` function between 0-15 - Thanks to @zyxkad - -## [1.20.1-0.7.39r] - 2024-04-12 -### Fixed -- [#578] Re-Added botania integration with a few new functions -- [#559] Fixed the creation of empty nbt tags when inserting items into the ME System - @Thanks to michele-grifa! -- [#577,#570] Fixed that the RS bridge does not show `isCraftable` in `getItem` or `getPattern` - Thanks to @tomprince! -- [#570] Improved performance of ME Bridge's iterating functions by making the functions not quadratic - Thanks to @tomprince! -- [#560] Fixed stacking problems when using `getItems` from the inventory manager -- [#551] Fixed that RS Bridge's `isItemCrafting` is false when the item is not in the system -- [#536] Invalidate the energy detectors in and output energy providers to prevent the energy detector from stopping to transfer energy -- [#575] Added support for more disk cells and portable cells for the ME Bridge - Thanks to @iTrooz - -### Added -- [#571] Added `selectionMode` to the output of ME Bridge's `getCraftingCPUs` function - Thanks to @tomprince! -- [#564] Added optional parameter to `getPlayerPos` to specify the amount of decimal places to retrieve the position of - Thanks to @minecraf7771 - -## [1.20.1-0.7.38r] - 2024-02-13 - -### Fixed -- [#556] Fixed a server crash when the toast packet got loaded on the server side -- [#558] Fixed support for the latest minecolonies version -- [#552] Fixed that our automata turtles don't allow charging when `need_fuel` in the CC config is set to true -- [#538] Delete old ar goggles curios tag - -## [1.20.1-0.7.37r] - 2024-02-09 - -### Added -- Added `isTileEntity` and `getBlockStates` to the Block Reader -- Added `sendToastToPlayer` and `sendFormattedToastToPlayer` to the Chat Box -- Added the health, the respawn position and the air supply to the player of the player detector. - -### Fixed -- [#553] Changed the priority of our chat event to prevent `chat message validation failure` issues - -### Changed -- Added random error to `getPlayerPos`. That is by default deactivated. Thanks to @eitan3085! -- Make the prefix of chat box messages dyeable with `&` chars - -## [1.20.1-0.7.36r] - 2024-01-17 - -### Fixed -- [#542] Fixed that our description key bind does not work in specific cases and other windows than the vanilla inventory. - -### Changed -- Added the Stack to the resource order of the Colony Integrator and add the fingerprint to common item stacks - -## [1.20.1-0.7.35b] - 2023-11-24 - -### Fixed -- [#530] Fixed stray pixel in inventory_manager_gui.png -- Fixed Memory Card tooltip color -- [#524] Fixed not working brackets color change of the Chat Box - Thanks to @zyxkad! -- [#522] Fixed that the index of the argument `range` for the functions `sendMessageToPlayer` and `sendFormattedMessageToPlayer` in the Chat Box is incorrect - Thanks to @zyxkad! - -### Added -- [#519] Added Applied Mekanistics support to the ME Bridge - Thanks to @starcatmeow! - -### Changed -- [#474] Changed the inventory manager. Merged the NBT and normal variants of the removeItem and addItem functions to one. See documentation for more info -- [#441] Let the ME bridges `isConnected` function only return true when the ME bridge is actually connected to an active ME system - -## [1.20.1-0.7.34b] - 2023-11-03 - -#### This is the neoforge port for 1.20.1. This version works for Minecraft Forge and for NeoForge. - -### Fixed -- Fixed integration for Mekanism 10.4 - -## [1.20.1-0.7.33b] - 2023-10-07 -### Fixed -- Fixed that `craftFluid` of the RS Bridge will not work when the target fluid stack is empty -- Fixed the amount of the costs of researches in the colony integrator -- [#505] Fixed a NullPointerException when calling `craftItem` with the ME Bridge while using the CPU argument -- [#503],[#509] Fixed a bug where the imported items to a ME System are imported without the NBT tag(Thanks to @michele-grifa!) -- [#501] Fixed some stack overflow exceptions when moving items around(Independent of the periphal) -- [#511] Fixed the patchouli book - -### Changed -- [#512] Changed some debug messages of the ME and RS Bridge - -### Added -- [#514] Added a `neededTime` property to the research table of the colony integrator - -## [1.20.1-0.7.32b] - 2023-08-06 - -### Changed -- Changed sorting of our creative tab - -### Added -- [#481] Add configurable chunk loading radius to chunky turtle. Thanks to @Einhornyordle! -- [#483] Add Powah's Ender Cell support. Thanks to @Apeopex! -- [#435] Add a `isFluidCrafting` and `isFluidCraftable` function to the ME Bridge -- [#477] Add two configuration values for the chat box. One for a maximum range and one to disallow multidimensional message sending -- [#491] Added support for Storage Busses in calculation of used storage space for the ME Bridge. Thanks to @Michele Grifa! -- [#494] Add the name to `getCraftingCPUs()` -- [#490] Don't divide the amount of the bytes of the DISK drives -- [#485] Add AE2 Addtions support to the ME Bridge - -### Fixed -- [#488] Added support with CC:T 1.106x. Thanks to @SirEdvin! -- [#478] Fixed not working Ae2 Things integration -- [#482] Fixed that some of the functions of automata turtles throw NPEs if the functions were called for the first time -- [#487] Fixed a server crash when two ME Bridges are connected to one ME System while items are scheduled for crafting -- [#490] Fixed that `getUsedItemStorage` does not respect AE2Things DISK drives -- [#486] Fixed that the player detector will not detect players in different dimensions - - -## [1.20.1-0.7.31a] - 2023-06-29 - -### Added -- Added the minecolonies integration back -- Added the mekanism integration back - -## [1.20.1-0.7.30a] - 2023-06-18 - -Initial port to 1.20.1. Could and probably will include bugs, please report them on our [issue tracker](https://github.com/SirEndii/AdvancedPeripherals/issues/). -Currently disabled integrations are botania, create, mekanism and powah - -## [1.19.3-0.7.29r] - 2023-06-01 - -### Changed -- Change the argument of `isItemCrafting` to an item filter table -- Removed minecolonies integration without removing the block since minecolonies does not exist for 1.19.3 -- Removed botania integration since botania does not exist for 1.19.3 - -### Fixed -- [#434] `getItem` throwing NullPointerException if the item does not exist in the me system -- [#444] Cardinal directions aren't working for some of our peripherals - Thanks to @zyxkad ! -- [#436] fluid stacks returned by the me or rs bridge are missing some information like the display name, fingerprint or nbt values -- [#448] Wrong return values of the `getInputFluid/getOutputFluid` functions of the create basin integration - Thanks to @zyxkad -- [#439] Fixed wrong calculation of the player position which leads to false results of some functions of the player detector - Thanks to @zyxkad -- [#454] Fixed cache blocking of the rs bridge which leads to a disability to remove items from the rs system -- [#456] Fixed a bug which leads to crashes when trying to get the happiness of the citizens - Thanks to @Einhornyordle! -- Fixed `writeTable` function of the storage peripheral -- Fixed a bug where the item of a filter gets ignored if nbt values are defined -- [#425] Fixed patchouli urls -- [#463] Fix create integration for create 0.5.1a -- [#464] Fixed that the inventory manager causes items to stop stacking - -### Added -- [#445] Added the peripheral name to the `playerClick` event of the player detector - Thanks to @zyxkad! -- [#467] Added playerJoin, playerLeave, playerChangedDimension events on Player Detector - Thanks to @michele-grifa! -- Increase max range of the radius of sphere operations - - -## [1.19.3-0.7.28r] - 2023-04-15 - -### Fixed -- [#433] Fixed that items will be exported regardless if the target can accept the items - RS and ME Bridge -- Fixed return type of `removeItem` in the inventory manager - -## [1.19.3-0.7.27r] - 2023-04-14 - -### Added -- [#429]Add back support for ae2 things -- Added some checks to the inventory manager - -### Fixed -- Fixed that the rs bridge does not export items if the item is distributed between multiple storages - thanks to Rudy Gambelini! -- [#427]Fixed that nbt values of items that are moved get deleted in the me bridge. -- [#430]Add `craftFluid` to the me bridge -- Fixed chatbox event calling when typing - -### Changed -- [#432]Disable curio slot -- Disable fuel consumption of the pocket computer - can be enabled in the config - -## [1.19.3-0.7.26r] - 2023-03-15 - -### Added -- [#416]Add the crafting job to the crafting cpu object - me bridge - -### Fixed -- [#416]Try to parse the `nbt` argument as a table if parsing it as a string fails. Adds the ability to use the output of our functions like `listItems` or `getItem` as item filter argument. -- [#417]Disable power consumption if powered peripherals are disabled in the configuration -- [#423]Fixed that some functions of the me and rs bridge ignore or increasing the count they want to export - -## [1.19.3-0.7.24b] - 2023-02-12 - -### Fixed -- [#411] Fixed nil return values of `getItem` - RS Bridge - -## [1.19.3-0.7.23b] - 2023-02-11 - -### Breaking Changes -- This update changes the way how we transfer items. This fixes a lot of bugs but also changes some functions. This can break some scripts you might use. Please refer to the [changelog](https://docs.intelligence-modding.de/changelogs/0.7.24r/) - -### Added -- Added optional arguments to specify which crafting cpu you want to use - Thanks to Michele Grifa! - ME Bridge -- Added `getTotalItemStorage`, `getTotalFluidStorage`, `getUsedItemStorage`, `getUsedFluidStorage`, `getAvailableItemStorage`, `getAvailableFluidStorage` - Thanks to Michele Grifa! - ME Bridge -- Added `listCells` function - Thanks to Michele Grifa! - ME Bridge -- Added methods to import/export fluid from/to the ME System - Thanks to Michele Grifa! -- Added support for shears to the `digBlock` function of automata turtles -- [#397] The RS, ME Bridge and the inventory manager are now able to ignore NBT values if none is specified -- Added support for offhand items to the inventory manager, the slot is 36. - -### Fixed -- [#349] Fixed create fluid tank integration with multiblocks -- [#356] Fixed LuaException if the player detector is moved around in the inventory -- [#398] Fix wrong return types of basin integration -- [#384] Fix long execution times of some redstone integrator functions -- [#393] Check if items can be extracted before inserting, fixes dupe bugs - RS and ME Bridge -- Particles of our blocks -- [#378] Clear canvas if a player switches worlds/servers -- [#393, #361, #371. #407, #406, #408] Fixed several issues with the inventory system. Like ignored NBT values, deleted NBT values, ignored armor, dupe bugs or wrong transmitted items. - -## [1.19.2-0.7.22b] - 2022-12-02 - -### Added -- Added `getRadiation` to the environment detector - -### Fixed -- Fixed chat box event -- [#352] Fixed RS bridge crashing the game when connecting it to a cable -- [#355] Don't allow negative numbers for the energy detector - -## [1.19.2-0.7.21b] - 2022-10-04 - -### Added -- Added `isUnderRaid` to the colony integrator - -### Fixed -- Fixed language entries -- Fixed rs bridge and colony integrator recipe - -## [1.19.2-0.7.20a] - 2022-09-26 - -### Known Issues -- Missing language entries - -### Fixed -- [#341] Fixed `isThunder` - environment detector -- [#347] Fixed crash on server startup - -## [1.19.2-0.7.20a] - 2022-09-24 - -### Fixed -- [#341] Fixed `isThunder` - environment detector -- [#347] Fix crash on server startup due to client side classes - -## [1.19.2-0.7.19a] - 2022-09-18 - -This version supports Create, AE2, Refined Storage, Minecolonies, Botania and Patchouli - -### Changed -- Removed `getDimensionProvider`, `getDimensionPath` and `getDimensionPaN` but added `getDimension` which just returns the location of the dimension. As Example `minecraft:nether` or `galacticraft:moon` - environment detector - -### Removed -- Disabled the AR Goggles since we want to rewrite the entire system without destroying backwards compatibility in the next 1.19 versions - -## [1.18.2-0.7.19r] - 2022-09-06 - -Bump min forge version to 40.1.52 - -### Fixed -- [#339, #338] Fixed that commands that are being run in the console are throwing exceptions - -## [1.18.2-0.7.18r] - 2022-09-02 - -### Fixed -- [#334] Fixed AP turtles and pocket computers appearing in all creative tabs - -## [1.18.2-0.7.17r] - 2022-09-01 - -### Added -- [#342] Added `buildingName`, `targetLevel` and `workOrderType` to `getWorkOrders` - colony integrator -- Added `isCraftable` to fluid stacks - me bridge -- [#313] The chat box `chat` event now listens for the `say` command -- [#317] Added inventory manager nbt support -- [#286] Language updates - -### Fixed -- [#174] Fixed client crash when quick moving stacks in the inventory manager -- [#308] Fixed NPE for `getOwner` - inventory manager -- [#281] Fixed wrong amount of pulled items in the inventory manager -- [#280] Fixed `inCoords` functions - player detector -- [#221] Fixed NPE when rs bridge is not connected to a network -- [#321] Fixed that items are voided when importing items into a full me system -- [#319] Fixed `getRequests` - colony integrator -- Fixed that work orders do not return a location -- Fixed console spam and not working table values of buildings - colony integrator - -### Changed -- [#323] Improved return values of `craftItem` - me bridge - -## [1.18.2-0.7.16b] - 2022-07-18 - -### Added -- [#314] Added `getItemInOffHand` to the inventory manager -- Added create integration -- Added botania integration - -### Fixed -- Village structures *again* -- [#315] Improved performance for `isItemCraftable` - RS Bridge -- [#304] Fix duplicated entries with `listItems` - RS Bridge -- [#270] Added `isCraftable` to fluids and items - RS Bridge - -## [1.18.2-0.7.15b] - 2022-05-21 - -### Fixed -- Minecolonies integration for 1.0.754-ALPHA and newer -- Village structures -- [#297] Fixed tags to fix some RS Bridge functions (Thanks to rayrvg!) - -## [1.18.2-0.7.14b] - 2022-04-28 - -### Fixed -- [#294] `isRequests` does return also true when a sub-ingredient is being crafted (MeBridge, thanks to LauJosefsen!) -- [#293] `isItemCraftable` Does not return true, if an item is craftable, but the amount in the ME system is 0 (MeBridge, thanks to LauJosefsen!) -- [#293] `listCraftableItems` Does not return items that are indeed craftable, but the amount is 0 (MeBridge, thanks to LauJosefsen!) -- [#293] `isItemCrafting` Gives lua error (Java null pointer exception) if amount is 0 (MeBridge, thanks to LauJosefsen!) -- [#295] Fixed scanner height for new world heights (Thanks to JensenJ!) -- [#287] Fixed crash with the chunky turtle throwing an IllegalArgumentException -- [#283] Fixed several issues caused by tags and items (Thanks to AIUbi!) -- Fixed Me Bridge *again* - -## [1.18.2-0.7.13a] - 2022-04-07 - -### Added -- 1.18.2 support - -### Fixed -- ME Bridge does work again - -## [1.18.1-0.7.12b] - 2022-03-04 - -Added language updates from crowdin - -### Fixed -- Fixed `chat` event -- Fixed compass turtle -- Fixed and improved language files - -## [1.18.1-0.7.11b] - 2022-02-15 - -Small update but with a quite important fix. -I'll fix the chat event in the next update. - -### Fixed -- The chunky turtle does now work as intentional - -## [1.18.1-0.7.10b] - 2022-02-10 - -Due to the high amount of minor bugs, AP is now marked as beta. - -### Changed -- [#239] Decreased base energy consumption of ME and RS bridge - -### Added -- [#261] Ported RsBridge peripheral from 1.16 to 1.18 (Thanks to CanadianBaconBoi) -- [#261] Re-Added `listCraftableItems` (Thanks to CanadianBaconBoi) -- [#263] Added ids to AR goggles (Thanks to ThatGravyBoat) -- [#241] Added `getPlayerRotationZ` and `getPlayerRotationX` to the AR goggles - -## [1.18.1-0.7.9r] - 2022-01-26 - -We'll start adding more mod integrations in the next major 1.18 version. - -### Changed -- [#247] We changed the textures of our blocks. Every block is now rotatable and the front texture of every block is now marked with a light aqua box. - -### Added -- [#237] Added `sendFormattedMessageToPlayer` to the chat box -- [#237] Added the ability to format prefixes with the chat box -- [#237] UUID's can now be used for `ToPlayer` functions in the chat box. -- [#237] Added a range parameter to the chat box(Parameter 5) -- [#190] The shape and color of the brackets of the chat box can now be changed - -### Fixed -- [#228] Typo of metaphysics config file. You may need to redo some configurations. -- [#189] Fixed that the player detector ignores config values. -- Fixed the key `status` of the table of the function `getResearch` from the minecolonies integration. -- Fixed `getBlockData` of the block reader peripheral -- Fixed not dropping blocks -- Fixed several recipes -- [#257] Incompatibility with newer forge versions - -## [1.16.5-0.7.7r] - 2022-01-20 - -### Removed -- Removed mekanism integration. The latest mekanism version does now support computercraft. -- Removed draconic evolution integration. - -### Changed -- [#247] We changed the textures of our blocks. Every block is now rotatable and the front texture of every block is now marked with a light aqua box. - -### Added -- [#237] Added `sendFormattedMessageToPlayer` to the chat box -- [#237] Added the ability to format prefixes with the chat box -- [#237] UUID's can now be used for `ToPlayer` functions in the chat box. -- [#237] Added a range parameter to the chat box(Parameter 5) -- [#190] The shape and color of the brackets of the chat box can now be changed - -### Fixed -- [#228] Typo of metaphysics config file. You may need to redo some configurations. -- [#189] Fixed that the player detector ignores config values. -- Fixed the key `status` of the table of the function `getResearch` from the minecolonies integration. - -## [1.18.1-0.7.8.1r] - 2021-12-24 - -### Fixed -- Fixed incompatibility with ae2 10.0.0-beta.1 - -## [1.18.1-0.7.8r] - 2021-12-18 - -### Added -- Minecolonies integration - -### Fixed -- [#228]Typo of metaphysics config file. You may need to redo some configurations. -- [#235]Fixed blurry HUD when opening the journey map full screen. -- [#236]Fixed patchouli loading - -## [1.16.5-0.7.6r] - 2021-12-14 - -### Fixed -- Crashes with newer minecolonies versions. - -### Added -- Transmitter integration for mekanism - -## [1.18-0.7.7.1r] - 2021-12-10 - -### Fixed -- Fixed a critical dupe bug with the ME Bridge. - -## [1.18-0.7.7r] - 2021-12-10 -# 1.18 port -This is the 1.18 port of Advanced Peripherals. -This version comes with applied energistics 2 and curios integration. - -## [1.17.1-0.7.6r] - 2021-12-03 - -# This is the last 1.17 version of Advanced Peripherals. -We will now work on a 1.18 port. Supported is 1.16 and 1.18. Join our discord to read why. -Rest in piece 1.17! - -### Fixed -Added compatibility with the latest CC version. - -## [1.17.1-0.7.5.1r] - 2021-11-26 - -### Added -- Added back me bridge and colony integrator recipe. -- Added back colony integrator pocket upgrade. - -## [1.17.1-0.7.5r] - 2021-11-26 - -### Attention -We changed our config system. So if you want to update the mod in your pack, don't forget to use the new files. -We also recommend you to delete the old one, no one needs crap. - -This is the port of 0.7.4r, 0.7.4.1b and 0.7.5r as 1.17 version. -### Changed -- [#247] We changed the textures of our blocks. Every block is now rotatable and the front texture of every block is now marked with a light aqua box. - -### Added -- [#237] Added `sendFormattedMessageToPlayer` to the chat box -- [#237] Added the ability to format prefixes with the chat box -- [#237] UUID's can now be used for `ToPlayer` functions in the chat box. -- [#237] Added a range parameter to the chat box(Parameter 5) -- [#190] The shape and color of the brackets of the chat box can now be changed - -### Fixed -- [#228] Typo of metaphysics config file. You may need to redo some configurations. -- [#189] Fixed that the player detector ignores config values. -- Fixed the key `status` of the table of the function `getResearch` from the minecolonies integration. - -## [1.16.5-0.7.6r] - 2021-12-14 - -### Fixed -- Crashes with newer minecolonies versions. - -### Added -- Transmitter integration for mekanism - -## [1.18-0.7.7.1r] - 2021-12-10 - -### Fixed -- Fixed a critical dupe bug with the ME Bridge. - -## [1.18-0.7.7r] - 2021-12-10 -# 1.18 port -This is the 1.18 port of Advanced Peripherals. -This version comes with applied energistics 2 and curios integration. - -## [1.17.1-0.7.6r] - 2021-12-03 - -# This is the last 1.17 version of Advanced Peripherals. -We will now work on a 1.18 port. Supported is 1.16 and 1.18. Join our discord to read why. -Rest in piece 1.17! - -### Fixed -Added compatibility with the latest CC version. - -## [1.17.1-0.7.5.1r] - 2021-11-26 - -### Added -- Added back me bridge and colony integrator recipe. -- Added back colony integrator pocket upgrade. - -## [1.17.1-0.7.5r] - 2021-11-26 - -### Attention -We changed our config system. So if you want to update the mod in your pack, don't forget to use the new files. -We also recommend you to delete the old one, no one needs crap. - -This is the port of 0.7.4r, 0.7.4.1b and 0.7.5r as 1.17 version. - -### Fixed -- Config typos and descriptions -- A FormattedMessage formatting mistake. -- [#203]Fixed Inventory Manager api, slot argument behaviour is now correct. -- [#219]Fixed that the inventory manager sees slot 0 as nil. - -### Added -- Added back AE2 and MineColonies integration. -- [[#224]](https://github.com/Seniorendi/AdvancedPeripherals/pull/224) Added Korean language by mindy15963 -- [#223]Added consumption of the ME Bridge to the config. -- [#76]Added noteblock integration -- [#217]Added `getItemInHand`, `getFreeSlot`, `isSpaceAvailable` and `getEmptySpace` to the inventory manager. -- Added support for armor items. You can use the slots 100-103 to access armor items. -- Added more information to the `getPlayerPos` function. (Configurable) -- A new config system. You can find every config in `gamePath/config/AdvancedPeripherals/xxx.toml` - De divided the config files in 4 different ones. General, World, Peripherals and Metaphysics. -- [#210]Added a new config value, `villagerStructureWeight`. Can be used to change the weight of the structures of our villager. - -## [1.16.5-0.7.4.1b] - 2021-11-15 - -### Attention -We changed our config system. So if you want to update the mod in your pack, don't forget to use the new files. -We also recommend you to delete the old one, no one needs crap. - -### Added -- A new config system. You can find every config in `gamePath/config/AdvancedPeripherals/xxx.toml` - De divided the config files in 4 different ones. General, World, Peripherals and Metaphysics. -- [#210]Added a new config value, `villagerStructureWeight`. Can be used to change the weight of the structures of our villager. - -## [1.16.5-0.7.4r] - 2021-11-14 - -### Fixed - -- A FormattedMessage formatting mistake. -- [#203]Fixed Inventory Manager api, slot argument behaviour is now correct. -- [#219]Fixed that the inventory manager sees slot 0 as nil. -- Fixed `getMaxMana` of the mana pool integration. - -### Added - -- [#76]Added noteblock integration -- [#217]Added `getItemInHand`, `getFreeSlot`, `isSpaceAvailable` and `getEmptySpace` to the inventory manager. -- Added support for armor items. You can use the slots 100-103 to access armor items. -- Added more information to the `getPlayerPos` function. (Configurable) -- Added `getManaNeeded` to the mana pool integration -- [#186] Added draconic evolution integration for the reactor and the energy core. - -## [1.17.1-0.7.3r] - 2021-10-13 - -### Removed - -- Removed `listCraftableItems()` from the RSBridge because of some issues - -### Added - -- `getMaxItemDiskStorage()` to the RS Bridge -- `getMaxFluidDiskStorage()` to the RS Bridge -- `getMaxItemExternalStorage()` to the RS Bridge -- `getMaxFluidExternalStorage()` to the RS Bridge -- `getPattern()` to the RS Bridge -- `isItemCraftable()` to the RS Bridge -- `isItemCraftable()` to the ME Bridge -- Mekanism dynamic tank integration -- french translation - -### Fixed - -- [#177]Fixed that items after removing it from a chest using the inventory manager does not stack anymore. -- [#194]Fixed error spamming when using `getRequests()` from the colony integrator -- [#203]Fixed Inventory Manager api, slot argument behaviour is now correct. - -## [1.17.1-0.7.2r] - 2021-09-06 - -### Fixed - -- `lookAtBlock` now correctly shows tags - -## [1.16.5-0.7.1r] - 2021-08-23 - -### Fixed - -- chunky turtle related issues -- RS and ME Bridge related issues -- redstone integrator block updates -- peripheral name of the player detector turtle -- Compatibility with CC:T 1.98.2 diff --git a/docs/RELEASE.md b/docs/RELEASE.md deleted file mode 100644 index 41bce4134..000000000 --- a/docs/RELEASE.md +++ /dev/null @@ -1,41 +0,0 @@ -## Release process - -This documentation focused on release process for Advanced Peripherals. - -### Preparation - -First, you need to get curseforge api -key. [Here](https://support.curseforge.com/en/support/solutions/articles/9000197321-curseforge-api) is some -documentation about it. - -Then, you need to get modrinth key, from [settings](https://modrinth.com/dashboard/settings) in "Authorization token" -section - -Second, you need to create `.env` file in root folder and put in this file - -``` -CURSEFORGE_KEY= -MODRINTH_KEY= -``` - -If you also want to do manual upload to [AdvancedPeripheral maven repository](https://mvn.intelligence-modding.de/), you can add next variables - -``` -PUBLIC_REP_NAME= -PUBLIC_REP_KEY= -``` - -### Before release - -- Manually review `CHANGELOG.md` to check it for mistakes or some problems -- Make sure, that `mod_version` and `release_type` in `gradle.properties` matches to what you want to receive - -### Release process - -- Execute `./gradlew patchChangelog` or manually update `CHANGELOG.md` and commit result to repository -- ~~Run `git tag -` to create git tag and push it to repository via `git push --tags`~~ -- Upload project to github via `./gradlew githubRelease` -- Upload project to curseforge via `./gradlew curseforge` -- Upload project to modrinth via `./gradlew publishModrinth` -- Upload project to maven via `./gradlew publishAllPublicationsToPublicRepository` -- Update `mod_version` to next patch or minor version, what you want diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java index 9fc6cde68..7c3a33d38 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MEBridgePeripheral.java @@ -1,5 +1,6 @@ package de.srendi.advancedperipherals.common.addons.computercraft.peripheral; +import de.srendi.advancedperipherals.AdvancedPeripherals; import appeng.api.crafting.IPatternDetails; import appeng.api.networking.IGridNode; import appeng.api.networking.IManagedGridNode; @@ -867,10 +868,10 @@ public MethodResult forceCompleteCraftingTasks(IArguments arguments) throws LuaE AEKey craftedItem = craftingStack.what(); long totalAmount = craftingStack.amount(); - System.out.println("[DEBUG] ==> Processing job for: " + craftedItem.getDisplayName().getString()); - System.out.println("[DEBUG] ==> Total target amount: " + totalAmount); - System.out.println("[DEBUG] ==> CPU busy: " + cpu.isBusy()); - System.out.println("[DEBUG] ==> CPU type: " + cpu.getClass().getSimpleName()); + AdvancedPeripherals.debug("[DEBUG] ==> Processing job for: " + craftedItem.getDisplayName().getString()); + AdvancedPeripherals.debug("[DEBUG] ==> Total target amount: " + totalAmount); + AdvancedPeripherals.debug("[DEBUG] ==> CPU busy: " + cpu.isBusy()); + AdvancedPeripherals.debug("[DEBUG] ==> CPU type: " + cpu.getClass().getSimpleName()); // Calculate the actual completed amount using AE2 internal logic long actualCraftedAmount = totalAmount; @@ -881,43 +882,43 @@ public MethodResult forceCompleteCraftingTasks(IArguments arguments) throws LuaE long active = craftingCpuLogic.getWaitingFor(craftedItem); actualCraftedAmount = totalAmount - (pending + active); - System.out.println("[DEBUG] ==> AE2 Logic - Pending: " + pending + ", Active: " + active + ", Calculated Completed: " + actualCraftedAmount); + AdvancedPeripherals.debug("[DEBUG] ==> AE2 Logic - Pending: " + pending + ", Active: " + active + ", Calculated Completed: " + actualCraftedAmount); // If calculated amount is 0 or negative, it means nothing is completed yet // In this case, we should force complete with the total requested amount if (actualCraftedAmount <= 0) { - System.out.println("[DEBUG] ==> No items completed yet, using total amount for force completion"); + AdvancedPeripherals.debug("[DEBUG] ==> No items completed yet, using total amount for force completion"); actualCraftedAmount = totalAmount; } } catch (Exception e) { - System.out.println("[DEBUG] ==> Could not calculate precise amount: " + e.getMessage()); + AdvancedPeripherals.debug("[DEBUG] ==> Could not calculate precise amount: " + e.getMessage()); e.printStackTrace(); // Fall back to total amount if calculation fails actualCraftedAmount = totalAmount; } } else { - System.out.println("[DEBUG] ==> Non-CraftingCPUCluster, using total amount: " + totalAmount); + AdvancedPeripherals.debug("[DEBUG] ==> Non-CraftingCPUCluster, using total amount: " + totalAmount); } // For force completion, we insert the full requested amount // The notification should show what we actually added to storage long amountToInsert = actualCraftedAmount; - System.out.println("[DEBUG] ==> Final amount to insert and notify: " + amountToInsert); + AdvancedPeripherals.debug("[DEBUG] ==> Final amount to insert and notify: " + amountToInsert); MEStorage storage = AEApi.getMonitor(node); long inserted = storage.insert(craftedItem, amountToInsert, Actionable.MODULATE, bridge); - System.out.println("[DEBUG] ==> Actually inserted into storage: " + inserted); + AdvancedPeripherals.debug("[DEBUG] ==> Actually inserted into storage: " + inserted); // Cancel the job without relying on AE2 notification logic cpu.cancelJob(); Thread.sleep(50); boolean completed = !cpu.isBusy(); - System.out.println("[DEBUG] ==> CPU idle after cancellation: " + completed); + AdvancedPeripherals.debug("[DEBUG] ==> CPU idle after cancellation: " + completed); if (completed) { jobsCompleted++; - System.out.println("[DEBUG] ==> Sending notification with amount: " + amountToInsert); + AdvancedPeripherals.debug("[DEBUG] ==> Sending notification with amount: " + amountToInsert); // Send custom notification with crafted item details sendForceCompletionNotification(jobsCompleted, craftedItem, amountToInsert, inserted); } @@ -931,11 +932,11 @@ public MethodResult forceCompleteCraftingTasks(IArguments arguments) throws LuaE } private void sendForceCompletionNotification(int jobNumber, AEKey craftedItem, long craftedAmount, long insertedAmount) { - System.out.println("[DEBUG-NOTIF] ==> sendForceCompletionNotification called with:"); - System.out.println("[DEBUG-NOTIF] ==> jobNumber: " + jobNumber); - System.out.println("[DEBUG-NOTIF] ==> craftedItem: " + craftedItem.getDisplayName().getString()); - System.out.println("[DEBUG-NOTIF] ==> craftedAmount: " + craftedAmount); - System.out.println("[DEBUG-NOTIF] ==> insertedAmount: " + insertedAmount); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> sendForceCompletionNotification called with:"); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> jobNumber: " + jobNumber); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> craftedItem: " + craftedItem.getDisplayName().getString()); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> craftedAmount: " + craftedAmount); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> insertedAmount: " + insertedAmount); // Generate unique job ID for this force completion (matching original AE2 system style) long jobId = System.currentTimeMillis() + jobNumber; @@ -948,58 +949,35 @@ private void sendForceCompletionNotification(int jobNumber, AEKey craftedItem, l if (shouldSendCraftingNotifications()) { sendToastToNearbyPlayers(jobId, craftedItem, craftedAmount, insertedAmount); } else { - System.out.println("[DEBUG-NOTIF] ==> Skipping toast notification - notifications disabled"); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> Skipping toast notification - notifications disabled"); } } private void sendToastToNearbyPlayers(long jobId, AEKey craftedItem, long craftedAmount, long insertedAmount) { - System.out.println("[DEBUG-TOAST] ==> sendToastToNearbyPlayers called with:"); - System.out.println("[DEBUG-TOAST] ==> jobId: " + jobId); - System.out.println("[DEBUG-TOAST] ==> craftedItem: " + craftedItem.getDisplayName().getString()); - System.out.println("[DEBUG-TOAST] ==> craftedAmount: " + craftedAmount); - System.out.println("[DEBUG-TOAST] ==> insertedAmount: " + insertedAmount); + AdvancedPeripherals.debug("[DEBUG-TOAST] ==> sendToastToNearbyPlayers called with:"); + AdvancedPeripherals.debug("[DEBUG-TOAST] ==> jobId: " + jobId); + AdvancedPeripherals.debug("[DEBUG-TOAST] ==> craftedItem: " + craftedItem.getDisplayName().getString()); + AdvancedPeripherals.debug("[DEBUG-TOAST] ==> craftedAmount: " + craftedAmount); + AdvancedPeripherals.debug("[DEBUG-TOAST] ==> insertedAmount: " + insertedAmount); - try { - ResourceKey dimension = getLevel().dimension(); - int range = 32; - - Component title = Component.literal("Auto-Crafting Complete"); - - String formattedAmount = craftedItem.formatAmount(craftedAmount, appeng.api.stacks.AmountFormat.SLOT); - String itemName = craftedItem.getDisplayName().getString(); - - System.out.println("[DEBUG-TOAST] ==> AE2 formatAmount result: '" + formattedAmount + "'"); - System.out.println("[DEBUG-TOAST] ==> Item name: '" + itemName + "'"); - - String simpleAmount = String.valueOf(craftedAmount); - System.out.println("[DEBUG-TOAST] ==> Simple amount formatting: '" + simpleAmount + "'"); - - Component message = Component.literal(simpleAmount + " " + itemName); - System.out.println("[DEBUG-TOAST] ==> Final message (using simple formatting): '" + message.getString() + "'"); - - if (insertedAmount != craftedAmount) { - message = Component.literal(formattedAmount + " " + itemName + " (" + insertedAmount + " stored)"); - System.out.println("[DEBUG-TOAST] ==> Modified message for partial storage: '" + message.getString() + "'"); - } - - for (ServerPlayer player : ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayers()) { - if (player.level().dimension() != dimension) - continue; - - if (CoordUtil.isInRange(getPos(), getLevel(), player, range, range)) { - System.out.println("[DEBUG-TOAST] ==> Sending notification packet to player: " + player.getName().getString()); - System.out.println("[DEBUG-TOAST] ==> Client will decide whether to show notification based on their client setting"); - - // Send the packet to the client - the client will check its own setting - CraftingCompleteToastPacket packet = new CraftingCompleteToastPacket(title, message, craftedItem, craftedAmount); - APNetworking.sendTo(player, packet); - } + ResourceKey dimension = getLevel().dimension(); + int range = 32; // Toast notification range + + AdvancedPeripherals.debug("[DEBUG-TOAST] ==> Sending AE2 notification packets to nearby players"); + + for (ServerPlayer player : ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayers()) { + if (player.level().dimension() != dimension) + continue; + + if (CoordUtil.isInRange(getPos(), getLevel(), player, range, range)) { + AdvancedPeripherals.debug("[DEBUG-TOAST] ==> Sending packet to player: " + player.getName().getString()); + + // Send packet with item data - client will create authentic AE2 FinishedJobToast + Component title = Component.literal("Auto-Crafting Complete"); + Component message = Component.literal(craftedAmount + " " + craftedItem.getDisplayName().getString()); + CraftingCompleteToastPacket packet = new CraftingCompleteToastPacket(title, message, craftedItem, craftedAmount); + APNetworking.sendTo(player, packet); } - - } catch (Exception e) { - System.out.println("[DEBUG-TOAST] ==> ERROR in sendToastToNearbyPlayers: " + e.getMessage()); - e.printStackTrace(); - // Ignore toast notification errors, don't break the force completion } } @@ -1015,13 +993,13 @@ private boolean shouldSendCraftingNotifications() { boolean serverSetting = APConfig.PERIPHERALS_CONFIG.meCraftingNotifications.get(); if (!serverSetting) { - System.out.println("[DEBUG-NOTIF] ==> Notifications disabled by server config (meCraftingNotifications=false)"); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> Notifications disabled by server config (meCraftingNotifications=false)"); return false; } // Server setting is enabled, send packets to all clients // Each client will check their own setting when they receive the packet - System.out.println("[DEBUG-NOTIF] ==> Server notifications enabled, sending packets to clients"); + AdvancedPeripherals.debug("[DEBUG-NOTIF] ==> Server notifications enabled, sending packets to clients"); return true; } diff --git a/src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java b/src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java index 704498a28..df1445b11 100644 --- a/src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java +++ b/src/main/java/de/srendi/advancedperipherals/network/toclient/CraftingCompleteToastPacket.java @@ -81,11 +81,11 @@ public void handle(@NotNull IPayloadContext context) { try { // Attempt to get AE2's notification setting // Let's try different potential methods - System.out.println("[DEBUG-CLIENT] ==> Attempting to access AE2 config..."); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> Attempting to access AE2 config..."); // Try AEConfig instance methods if (AEConfig.instance() != null) { - System.out.println("[DEBUG-CLIENT] ==> AEConfig instance found"); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> AEConfig instance found"); // Use reflection to access AE2's notification setting // This is more robust than compile-time method calls @@ -111,7 +111,7 @@ public void handle(@NotNull IPayloadContext context) { if (result instanceof Boolean) { ae2NotificationSetting = (Boolean) result; methodFound = true; - System.out.println("[DEBUG-CLIENT] ==> Found AE2 method: " + methodName + " = " + ae2NotificationSetting); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> Found AE2 method: " + methodName + " = " + ae2NotificationSetting); break; } } catch (Exception ignored) { @@ -120,63 +120,52 @@ public void handle(@NotNull IPayloadContext context) { } if (!methodFound) { - System.out.println("[DEBUG-CLIENT] ==> No AE2 notification method found, using default"); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> No AE2 notification method found, using default"); ae2NotificationSetting = true; } } catch (Exception reflectionError) { - System.out.println("[DEBUG-CLIENT] ==> Reflection failed: " + reflectionError.getMessage()); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> Reflection failed: " + reflectionError.getMessage()); ae2NotificationSetting = true; // Default to enabled } - System.out.println("[DEBUG-CLIENT] ==> AE2 notification setting: " + ae2NotificationSetting); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> AE2 notification setting: " + ae2NotificationSetting); } // Additional debug info about AE2 integration - System.out.println("[DEBUG-CLIENT] ==> AE2 integration complete"); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> AE2 integration complete"); } catch (Exception e) { - System.out.println("[DEBUG-CLIENT] ==> Could not access AE2 config: " + e.getMessage()); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> Could not access AE2 config: " + e.getMessage()); ae2NotificationSetting = true; // Default to enabled if we can't check } if (!clientNotificationSetting) { - System.out.println("[DEBUG-CLIENT] ==> AdvancedPeripherals client notification setting disabled, not showing toast"); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> AdvancedPeripherals client notification setting disabled, not showing toast"); return; } if (!ae2NotificationSetting) { - System.out.println("[DEBUG-CLIENT] ==> AE2 notification setting disabled, not showing toast"); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> AE2 notification setting disabled, not showing toast"); return; } - System.out.println("[DEBUG-CLIENT] ==> Both notification settings enabled, showing toast"); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> Both notification settings enabled, showing toast"); - Minecraft minecraft = Minecraft.getInstance(); - - try { - // Use AE2's original FinishedJobToast directly - if (!itemStack.isEmpty()) { - AEItemKey aeKey = AEItemKey.of(itemStack); - // Use the preserved amount, not the ItemStack count - long amount = this.craftedAmount; - - System.out.println("[DEBUG-CLIENT] ==> Using AE2 FinishedJobToast with amount: " + amount); - - // Create and add AE2's original FinishedJobToast - appeng.client.gui.me.common.FinishedJobToast finishedJobToast = - new appeng.client.gui.me.common.FinishedJobToast(aeKey, amount); - - minecraft.getToasts().addToast(finishedJobToast); - System.out.println("[DEBUG-CLIENT] ==> Successfully added AE2 FinishedJobToast"); - } else { - System.out.println("[DEBUG-CLIENT] ==> ItemStack is empty, skipping toast"); - } - } catch (Exception | NoClassDefFoundError e) { - // If AE2's toast isn't available, log error but don't crash - AdvancedPeripherals.debug("Failed to display AE2 FinishedJobToast: " + e.getMessage()); - System.out.println("[DEBUG-CLIENT] ==> Failed to create AE2 toast: " + e.getMessage()); - e.printStackTrace(); + if (!itemStack.isEmpty()) { + AEItemKey aeKey = AEItemKey.of(itemStack); + long amount = this.craftedAmount; + + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> Creating AE2 FinishedJobToast with amount: " + amount); + + // Create and add AE2's authentic FinishedJobToast + appeng.client.gui.me.common.FinishedJobToast finishedJobToast = + new appeng.client.gui.me.common.FinishedJobToast(aeKey, amount); + + Minecraft.getInstance().getToasts().addToast(finishedJobToast); + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> AE2 FinishedJobToast displayed successfully"); + } else { + AdvancedPeripherals.debug("[DEBUG-CLIENT] ==> ItemStack is empty, skipping toast"); } } From fa895df25056b16a8ec184eb2ce43f526f6958ea Mon Sep 17 00:00:00 2001 From: Semlock Date: Sun, 7 Sep 2025 04:26:12 -0700 Subject: [PATCH 3/3] somehow deleted changelog --- CHANGELOG.md | 793 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 793 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..a0bf29bcd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,793 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres +to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +## [1.21.1-0.7.55b] - 2025-07-14 + +### Fixed +- Fixed that the getRequests() function from the colony integrator wouldn't return items anymore + +## [1.21.1-0.7.54b] - 2025-07-12 + +### Fixed +- Fixed a crash at initializing when patchouli is not installed +- Fixed that some Inventory Manager functions can't be wrapped + +## [1.21.1-0.7.53b] - 2025-07-09 + +### Fixed +- [#762] Fixed that several lua functions would throw a `IllegalStateException` + +## [1.21.1-0.7.52b] - 2025-07-06 + +Due to some internal changes and fixes, the minimum version of neoforge was raised to 21.1.186, minecolonies to 1.1.1020-1.21.1-snapshot and CC:Tweaked to 1.116.0 + +### Added +- [#761] Added hungarian translation, thanks to @bayi! +- [#757] Added UTF8 support to the chat box, thanks to @456dev! + +### Fixed +- [#760] Fixed support with the latest CC version +- Omit the data components property of lua item stack tables when an error occurred. This fixes a rare issue with the colony integrator when trying to parse enchantments. Fingerprints can be used to filter different enchanted items, that will eventually be fixe when we find a fix for it. +- [#752] Fixed that export/import functions of the ME Bridge would return nil when the requested amount couldn't be exported + +## [1.21.1-0.7.51b] - 2025-06-21 + +### Added +- UUID and Name property to the player lua object of the player detector + +### Changed +- Patchouli book texture +- Default chemical filter count from 64 mB to 1000 mB +- Added a configurable char limit to chat box messages + +### Fixed +- Fixed that several mekanism integrations would crash the game/server when mekanism is not loaded +- [#746] Fixed that export and import functions from the ME bridge would not find target inventories +- Updated Patchouli book documentation URLs +- Support with the latest mekanism version + +## [1.21.1-0.7.50b] - 2025-06-10 + +The new ME and RS Bridge system are more or less final, but expect any last-minute changes before the final release. We will listen for any feedback and try to improve the system as much as we can! +If there are any inconsistencies or bugs, please report them at our github! + +### Changed +- We enhanced the RS and ME Bridge majorly, including new functions, a better crafting system and more. Refer to the [docs](https://docs.advanced-peripherals.de/0.7/guides/storage_system_functions/) +- The fingerprints now use a new hashing algorithm called XXHash64. This change speeds up the process of generating the hashes by a huge factor. Due to that, the hashes now have a different format and are displayed as a 64 bit integers parsed to a string to prevent rounding issues within cc and AP. +- Changed the default name style of our peripherals to match the ones from CC:Tweaked going from camelCase to snake_case. For example, the name of the chat box peripheral is now chat_box instead of chatBox. + +### Added +- A global AP lua api providing information about the mod versions of our addons and AP itself + +### Fixed +- Re-Support powah +- [#738] Fixed support for the latest minecolonies version +- [#711] Fixed that the block reader would not be able to access registries for component information +- [#741] Fixed the bottom textures of our peripherals +- Fixed that the patchouli book would not load correctly +- Re-Added the world join patchouli book event +- [#732] Fixed that automata cores can't be re-added into turtles after being removed +- [#438] Fixed that the `delivering` property of any minecolonies builder resource would be zero + +## [1.21.1-0.7.49a] - 2025-02-14 + +### Fixed +- Fixed a Null Pointer Exception when trying to work with item filters without any component filters applied. + +## [1.21.1-0.7.48a] - 2025-02-03 + +We will introduce more breaking changes in the upcoming 1.21.1 alpha releases and in the next major version. +Mostly noteworthy are the bridges. These will have identical functions and some additions and fixes +Not all of the breaking changes are documented yet. But we will document them before we release a beta version + +### Breaking Changes +- Renamed the following functions in the ME Bridge: +- `listFluid` -> `listFluids` +- `listGas` -> `listGases` +- `listCraftableFluid` -> `listCraftableFluids` + +### Fixed +- Fixed that fluids would always return the `name` key with the value `minecraft:fluid` +- Fixed that several AP features do not work on dedicated servers. A few of them are chat box events, player detector events, villager trades and villager structures +- Fixed that functions which interact with fluid handlers would not work. + +### Added +- Added fluid type properties to lua fluid objects + +## [1.21.1-0.7.47a] - 2025-01-21 + +### Fixed: +- Fixed that the colony integrator's `getCitizens` function would stop working when NPCs are idling +- Fixed errors with fuel ability functions from the automata turtles +- Fixed that automata turtles could break themselves +- Fixed that the end turtle would not save war points + +## [1.21.1-0.7.46a] - 2025-01-18 + +### Changed +- Downgraded CC:T Version to `1.113.1` so curseforge users can still use AP since CC:T does not get published to curseforge anymore. + +### Breaking Changes +- Renamed `nbt` to `components` in every item lua object +- Renamed `amount` to `count` in every ME Bridge lua item object + +## [1.21.1-0.7.45a] - 2025-01-15 + +### First official Advanced Peripherals 1.21.1 alpha release to the whole public. Please report any bug to github! + +### Added +- Added our new textures! + +### Fixed +- Fixed that several item export and import related functions would not work with blocks from other mods +- Fixed that functions with cooldowns which are used for the first time would throw an error + +## [1.21.1-0.7.44a] - 2025-01-14 + +### Added +- Colony Integrator back to 1.21.1 + +### Fixed +- Villager & Wandering trader pocket and turtle trades +- ME Bridges `getUsedItemStorage` and `getUsedFluidStorage` + +## [1.21.1-0.7.43a] - 2025-01-13 + +Alpha 1.21.1 release +The only thing that's missing is the colony integrator - we will add that soon. +Please report any bugs to github! + +## [1.20.4-0.7.43a] - 2024-12-27 + +First official Advanced Peripherals 1.20.4 alpha release. Please report any bug to github! + +## [1.20.4-0.7.42a] - 2024-12-22 + +### Fixed +- Fixed ME Bridge not connecting to AE2 grids +- Fixed some recipes +- Every energy, item or fluid interacting block should now work like the energy detector or some ME/RS functions +- Fixed that the inventory manager would not open the screen + +## [1.20.1-0.7.41r] - 2024-10-21 + +### Added +- Wandering Trader config + +### Changed +- Save the owner of the memory card to the inventory manager after a player places the card into the manager and clear the card after. Resolves a security issue where players could eventually steal memory cards from other players + +### Fixed +- [#660] Fixed that the inventory manager's `getItemInHand` function adds a blank nbt tag to the item +- [#636] Fixed that the automata's `useOnBlock` function will return PASS in some specific case +- [#645] Fixed that the inventory functions for the powah integration would always return nil +- Fixed that some entity operations don't have enough range +- [#642] Fixed that some powah integrations clashes with the generic energy peripheral from CC which disables some functions +- [#640] Fixed null pointer exception when invoking `getName` +- [#662] Use tick time instead of epoch time for our chunk manager, fixes an issue where chunks unload if some ticks are skipped (lag) + +## [1.20.1-0.7.40r] - 2024-06-11 + +### Added +- [Features/#43] Up/down versions of automata block functions using pitch and yaw - Thanks to @zyxkad +- [Features/#9] Added shift sneaking version of `useOnBlock` - Thanks to @zyxkad + +### Fixed +- [#582] Reworked the chunky turtle logic to fix several issues with them - Thanks to @zyxkad +- Fixed a crash with the ME Bridge while trying to iterate through storage busses without a connected storage block +- Fixed `isOnEnchantedSoil()` for the mana flower integration +- [#419] Fixed that the automata `digBlock` function does not use breaking directions the right way. Fixes several issues with hammers or other AOE tools. - Thanks to @zyxkad +- [#629] Fixed that placed blocks do not retain their custom block name when destroyed - Thanks to @WiggleWizzard +- [#621] Fixed that the `listCells` function for the ME Bridge does not search in third party drives - Thanks to @michele-grifa +- [#632] Fixed that the chat box allows sending chat messages with negative range - Thanks to @zyxkad +- [#619] Fixed that the chat box can spoof people to click message to run danger commands - Thanks to @zyxkad +- [#617] Fixed that sending invalid nbt data for some mod items through the chat box can cause a client crash - Thanks to @zyxkad +- [#603] Fixed that the note block integration does not trigger allays - Thanks to @zyxkad +- [#599] Fixed that turtle upgrades can't be equipped with custom NBT values - Thanks to @zyxkad +- [#595] Fixed that `scanEntities` does not include living entity fields - Thanks to @zyxkad +- [#581] Fixed concurrency issues with our server worker, fixes a crash when CC is set to use multiple threads - Thanks to @zyxkad + +### Changed +- [#588] Changed the misspelled `maxHealth` parameter in the player detector, the misspelled attribute is still included in the table for backwards compatibility - Thanks to @zyxkad +- [#613] Clamp analog output of the `setAnalogOutput` function between 0-15 - Thanks to @zyxkad + +## [1.20.1-0.7.39r] - 2024-04-12 +### Fixed +- [#578] Re-Added botania integration with a few new functions +- [#559] Fixed the creation of empty nbt tags when inserting items into the ME System - @Thanks to michele-grifa! +- [#577,#570] Fixed that the RS bridge does not show `isCraftable` in `getItem` or `getPattern` - Thanks to @tomprince! +- [#570] Improved performance of ME Bridge's iterating functions by making the functions not quadratic - Thanks to @tomprince! +- [#560] Fixed stacking problems when using `getItems` from the inventory manager +- [#551] Fixed that RS Bridge's `isItemCrafting` is false when the item is not in the system +- [#536] Invalidate the energy detectors in and output energy providers to prevent the energy detector from stopping to transfer energy +- [#575] Added support for more disk cells and portable cells for the ME Bridge - Thanks to @iTrooz + +### Added +- [#571] Added `selectionMode` to the output of ME Bridge's `getCraftingCPUs` function - Thanks to @tomprince! +- [#564] Added optional parameter to `getPlayerPos` to specify the amount of decimal places to retrieve the position of - Thanks to @minecraf7771 + +## [1.20.1-0.7.38r] - 2024-02-13 + +### Fixed +- [#556] Fixed a server crash when the toast packet got loaded on the server side +- [#558] Fixed support for the latest minecolonies version +- [#552] Fixed that our automata turtles don't allow charging when `need_fuel` in the CC config is set to true +- [#538] Delete old ar goggles curios tag + +## [1.20.1-0.7.37r] - 2024-02-09 + +### Added +- Added `isTileEntity` and `getBlockStates` to the Block Reader +- Added `sendToastToPlayer` and `sendFormattedToastToPlayer` to the Chat Box +- Added the health, the respawn position and the air supply to the player of the player detector. + +### Fixed +- [#553] Changed the priority of our chat event to prevent `chat message validation failure` issues + +### Changed +- Added random error to `getPlayerPos`. That is by default deactivated. Thanks to @eitan3085! +- Make the prefix of chat box messages dyeable with `&` chars + +## [1.20.1-0.7.36r] - 2024-01-17 + +### Fixed +- [#542] Fixed that our description key bind does not work in specific cases and other windows than the vanilla inventory. + +### Changed +- Added the Stack to the resource order of the Colony Integrator and add the fingerprint to common item stacks + +## [1.20.1-0.7.35b] - 2023-11-24 + +### Fixed +- [#530] Fixed stray pixel in inventory_manager_gui.png +- Fixed Memory Card tooltip color +- [#524] Fixed not working brackets color change of the Chat Box - Thanks to @zyxkad! +- [#522] Fixed that the index of the argument `range` for the functions `sendMessageToPlayer` and `sendFormattedMessageToPlayer` in the Chat Box is incorrect - Thanks to @zyxkad! + +### Added +- [#519] Added Applied Mekanistics support to the ME Bridge - Thanks to @starcatmeow! + +### Changed +- [#474] Changed the inventory manager. Merged the NBT and normal variants of the removeItem and addItem functions to one. See documentation for more info +- [#441] Let the ME bridges `isConnected` function only return true when the ME bridge is actually connected to an active ME system + +## [1.20.1-0.7.34b] - 2023-11-03 + +#### This is the neoforge port for 1.20.1. This version works for Minecraft Forge and for NeoForge. + +### Fixed +- Fixed integration for Mekanism 10.4 + +## [1.20.1-0.7.33b] - 2023-10-07 +### Fixed +- Fixed that `craftFluid` of the RS Bridge will not work when the target fluid stack is empty +- Fixed the amount of the costs of researches in the colony integrator +- [#505] Fixed a NullPointerException when calling `craftItem` with the ME Bridge while using the CPU argument +- [#503],[#509] Fixed a bug where the imported items to a ME System are imported without the NBT tag(Thanks to @michele-grifa!) +- [#501] Fixed some stack overflow exceptions when moving items around(Independent of the periphal) +- [#511] Fixed the patchouli book + +### Changed +- [#512] Changed some debug messages of the ME and RS Bridge + +### Added +- [#514] Added a `neededTime` property to the research table of the colony integrator + +## [1.20.1-0.7.32b] - 2023-08-06 + +### Changed +- Changed sorting of our creative tab + +### Added +- [#481] Add configurable chunk loading radius to chunky turtle. Thanks to @Einhornyordle! +- [#483] Add Powah's Ender Cell support. Thanks to @Apeopex! +- [#435] Add a `isFluidCrafting` and `isFluidCraftable` function to the ME Bridge +- [#477] Add two configuration values for the chat box. One for a maximum range and one to disallow multidimensional message sending +- [#491] Added support for Storage Busses in calculation of used storage space for the ME Bridge. Thanks to @Michele Grifa! +- [#494] Add the name to `getCraftingCPUs()` +- [#490] Don't divide the amount of the bytes of the DISK drives +- [#485] Add AE2 Addtions support to the ME Bridge + +### Fixed +- [#488] Added support with CC:T 1.106x. Thanks to @SirEdvin! +- [#478] Fixed not working Ae2 Things integration +- [#482] Fixed that some of the functions of automata turtles throw NPEs if the functions were called for the first time +- [#487] Fixed a server crash when two ME Bridges are connected to one ME System while items are scheduled for crafting +- [#490] Fixed that `getUsedItemStorage` does not respect AE2Things DISK drives +- [#486] Fixed that the player detector will not detect players in different dimensions + + +## [1.20.1-0.7.31a] - 2023-06-29 + +### Added +- Added the minecolonies integration back +- Added the mekanism integration back + +## [1.20.1-0.7.30a] - 2023-06-18 + +Initial port to 1.20.1. Could and probably will include bugs, please report them on our [issue tracker](https://github.com/SirEndii/AdvancedPeripherals/issues/). +Currently disabled integrations are botania, create, mekanism and powah + +## [1.19.3-0.7.29r] - 2023-06-01 + +### Changed +- Change the argument of `isItemCrafting` to an item filter table +- Removed minecolonies integration without removing the block since minecolonies does not exist for 1.19.3 +- Removed botania integration since botania does not exist for 1.19.3 + +### Fixed +- [#434] `getItem` throwing NullPointerException if the item does not exist in the me system +- [#444] Cardinal directions aren't working for some of our peripherals - Thanks to @zyxkad ! +- [#436] fluid stacks returned by the me or rs bridge are missing some information like the display name, fingerprint or nbt values +- [#448] Wrong return values of the `getInputFluid/getOutputFluid` functions of the create basin integration - Thanks to @zyxkad +- [#439] Fixed wrong calculation of the player position which leads to false results of some functions of the player detector - Thanks to @zyxkad +- [#454] Fixed cache blocking of the rs bridge which leads to a disability to remove items from the rs system +- [#456] Fixed a bug which leads to crashes when trying to get the happiness of the citizens - Thanks to @Einhornyordle! +- Fixed `writeTable` function of the storage peripheral +- Fixed a bug where the item of a filter gets ignored if nbt values are defined +- [#425] Fixed patchouli urls +- [#463] Fix create integration for create 0.5.1a +- [#464] Fixed that the inventory manager causes items to stop stacking + +### Added +- [#445] Added the peripheral name to the `playerClick` event of the player detector - Thanks to @zyxkad! +- [#467] Added playerJoin, playerLeave, playerChangedDimension events on Player Detector - Thanks to @michele-grifa! +- Increase max range of the radius of sphere operations + + +## [1.19.3-0.7.28r] - 2023-04-15 + +### Fixed +- [#433] Fixed that items will be exported regardless if the target can accept the items - RS and ME Bridge +- Fixed return type of `removeItem` in the inventory manager + +## [1.19.3-0.7.27r] - 2023-04-14 + +### Added +- [#429]Add back support for ae2 things +- Added some checks to the inventory manager + +### Fixed +- Fixed that the rs bridge does not export items if the item is distributed between multiple storages - thanks to Rudy Gambelini! +- [#427]Fixed that nbt values of items that are moved get deleted in the me bridge. +- [#430]Add `craftFluid` to the me bridge +- Fixed chatbox event calling when typing + +### Changed +- [#432]Disable curio slot +- Disable fuel consumption of the pocket computer - can be enabled in the config + +## [1.19.3-0.7.26r] - 2023-03-15 + +### Added +- [#416]Add the crafting job to the crafting cpu object - me bridge + +### Fixed +- [#416]Try to parse the `nbt` argument as a table if parsing it as a string fails. Adds the ability to use the output of our functions like `listItems` or `getItem` as item filter argument. +- [#417]Disable power consumption if powered peripherals are disabled in the configuration +- [#423]Fixed that some functions of the me and rs bridge ignore or increasing the count they want to export + +## [1.19.3-0.7.24b] - 2023-02-12 + +### Fixed +- [#411] Fixed nil return values of `getItem` - RS Bridge + +## [1.19.3-0.7.23b] - 2023-02-11 + +### Breaking Changes +- This update changes the way how we transfer items. This fixes a lot of bugs but also changes some functions. This can break some scripts you might use. Please refer to the [changelog](https://docs.intelligence-modding.de/changelogs/0.7.24r/) + +### Added +- Added optional arguments to specify which crafting cpu you want to use - Thanks to Michele Grifa! - ME Bridge +- Added `getTotalItemStorage`, `getTotalFluidStorage`, `getUsedItemStorage`, `getUsedFluidStorage`, `getAvailableItemStorage`, `getAvailableFluidStorage` - Thanks to Michele Grifa! - ME Bridge +- Added `listCells` function - Thanks to Michele Grifa! - ME Bridge +- Added methods to import/export fluid from/to the ME System - Thanks to Michele Grifa! +- Added support for shears to the `digBlock` function of automata turtles +- [#397] The RS, ME Bridge and the inventory manager are now able to ignore NBT values if none is specified +- Added support for offhand items to the inventory manager, the slot is 36. + +### Fixed +- [#349] Fixed create fluid tank integration with multiblocks +- [#356] Fixed LuaException if the player detector is moved around in the inventory +- [#398] Fix wrong return types of basin integration +- [#384] Fix long execution times of some redstone integrator functions +- [#393] Check if items can be extracted before inserting, fixes dupe bugs - RS and ME Bridge +- Particles of our blocks +- [#378] Clear canvas if a player switches worlds/servers +- [#393, #361, #371. #407, #406, #408] Fixed several issues with the inventory system. Like ignored NBT values, deleted NBT values, ignored armor, dupe bugs or wrong transmitted items. + +## [1.19.2-0.7.22b] - 2022-12-02 + +### Added +- Added `getRadiation` to the environment detector + +### Fixed +- Fixed chat box event +- [#352] Fixed RS bridge crashing the game when connecting it to a cable +- [#355] Don't allow negative numbers for the energy detector + +## [1.19.2-0.7.21b] - 2022-10-04 + +### Added +- Added `isUnderRaid` to the colony integrator + +### Fixed +- Fixed language entries +- Fixed rs bridge and colony integrator recipe + +## [1.19.2-0.7.20a] - 2022-09-26 + +### Known Issues +- Missing language entries + +### Fixed +- [#341] Fixed `isThunder` - environment detector +- [#347] Fixed crash on server startup + +## [1.19.2-0.7.20a] - 2022-09-24 + +### Fixed +- [#341] Fixed `isThunder` - environment detector +- [#347] Fix crash on server startup due to client side classes + +## [1.19.2-0.7.19a] - 2022-09-18 + +This version supports Create, AE2, Refined Storage, Minecolonies, Botania and Patchouli + +### Changed +- Removed `getDimensionProvider`, `getDimensionPath` and `getDimensionPaN` but added `getDimension` which just returns the location of the dimension. As Example `minecraft:nether` or `galacticraft:moon` - environment detector + +### Removed +- Disabled the AR Goggles since we want to rewrite the entire system without destroying backwards compatibility in the next 1.19 versions + +## [1.18.2-0.7.19r] - 2022-09-06 + +Bump min forge version to 40.1.52 + +### Fixed +- [#339, #338] Fixed that commands that are being run in the console are throwing exceptions + +## [1.18.2-0.7.18r] - 2022-09-02 + +### Fixed +- [#334] Fixed AP turtles and pocket computers appearing in all creative tabs + +## [1.18.2-0.7.17r] - 2022-09-01 + +### Added +- [#342] Added `buildingName`, `targetLevel` and `workOrderType` to `getWorkOrders` - colony integrator +- Added `isCraftable` to fluid stacks - me bridge +- [#313] The chat box `chat` event now listens for the `say` command +- [#317] Added inventory manager nbt support +- [#286] Language updates + +### Fixed +- [#174] Fixed client crash when quick moving stacks in the inventory manager +- [#308] Fixed NPE for `getOwner` - inventory manager +- [#281] Fixed wrong amount of pulled items in the inventory manager +- [#280] Fixed `inCoords` functions - player detector +- [#221] Fixed NPE when rs bridge is not connected to a network +- [#321] Fixed that items are voided when importing items into a full me system +- [#319] Fixed `getRequests` - colony integrator +- Fixed that work orders do not return a location +- Fixed console spam and not working table values of buildings - colony integrator + +### Changed +- [#323] Improved return values of `craftItem` - me bridge + +## [1.18.2-0.7.16b] - 2022-07-18 + +### Added +- [#314] Added `getItemInOffHand` to the inventory manager +- Added create integration +- Added botania integration + +### Fixed +- Village structures *again* +- [#315] Improved performance for `isItemCraftable` - RS Bridge +- [#304] Fix duplicated entries with `listItems` - RS Bridge +- [#270] Added `isCraftable` to fluids and items - RS Bridge + +## [1.18.2-0.7.15b] - 2022-05-21 + +### Fixed +- Minecolonies integration for 1.0.754-ALPHA and newer +- Village structures +- [#297] Fixed tags to fix some RS Bridge functions (Thanks to rayrvg!) + +## [1.18.2-0.7.14b] - 2022-04-28 + +### Fixed +- [#294] `isRequests` does return also true when a sub-ingredient is being crafted (MeBridge, thanks to LauJosefsen!) +- [#293] `isItemCraftable` Does not return true, if an item is craftable, but the amount in the ME system is 0 (MeBridge, thanks to LauJosefsen!) +- [#293] `listCraftableItems` Does not return items that are indeed craftable, but the amount is 0 (MeBridge, thanks to LauJosefsen!) +- [#293] `isItemCrafting` Gives lua error (Java null pointer exception) if amount is 0 (MeBridge, thanks to LauJosefsen!) +- [#295] Fixed scanner height for new world heights (Thanks to JensenJ!) +- [#287] Fixed crash with the chunky turtle throwing an IllegalArgumentException +- [#283] Fixed several issues caused by tags and items (Thanks to AIUbi!) +- Fixed Me Bridge *again* + +## [1.18.2-0.7.13a] - 2022-04-07 + +### Added +- 1.18.2 support + +### Fixed +- ME Bridge does work again + +## [1.18.1-0.7.12b] - 2022-03-04 + +Added language updates from crowdin + +### Fixed +- Fixed `chat` event +- Fixed compass turtle +- Fixed and improved language files + +## [1.18.1-0.7.11b] - 2022-02-15 + +Small update but with a quite important fix. +I'll fix the chat event in the next update. + +### Fixed +- The chunky turtle does now work as intentional + +## [1.18.1-0.7.10b] - 2022-02-10 + +Due to the high amount of minor bugs, AP is now marked as beta. + +### Changed +- [#239] Decreased base energy consumption of ME and RS bridge + +### Added +- [#261] Ported RsBridge peripheral from 1.16 to 1.18 (Thanks to CanadianBaconBoi) +- [#261] Re-Added `listCraftableItems` (Thanks to CanadianBaconBoi) +- [#263] Added ids to AR goggles (Thanks to ThatGravyBoat) +- [#241] Added `getPlayerRotationZ` and `getPlayerRotationX` to the AR goggles + +## [1.18.1-0.7.9r] - 2022-01-26 + +We'll start adding more mod integrations in the next major 1.18 version. + +### Changed +- [#247] We changed the textures of our blocks. Every block is now rotatable and the front texture of every block is now marked with a light aqua box. + +### Added +- [#237] Added `sendFormattedMessageToPlayer` to the chat box +- [#237] Added the ability to format prefixes with the chat box +- [#237] UUID's can now be used for `ToPlayer` functions in the chat box. +- [#237] Added a range parameter to the chat box(Parameter 5) +- [#190] The shape and color of the brackets of the chat box can now be changed + +### Fixed +- [#228] Typo of metaphysics config file. You may need to redo some configurations. +- [#189] Fixed that the player detector ignores config values. +- Fixed the key `status` of the table of the function `getResearch` from the minecolonies integration. +- Fixed `getBlockData` of the block reader peripheral +- Fixed not dropping blocks +- Fixed several recipes +- [#257] Incompatibility with newer forge versions + +## [1.16.5-0.7.7r] - 2022-01-20 + +### Removed +- Removed mekanism integration. The latest mekanism version does now support computercraft. +- Removed draconic evolution integration. + +### Changed +- [#247] We changed the textures of our blocks. Every block is now rotatable and the front texture of every block is now marked with a light aqua box. + +### Added +- [#237] Added `sendFormattedMessageToPlayer` to the chat box +- [#237] Added the ability to format prefixes with the chat box +- [#237] UUID's can now be used for `ToPlayer` functions in the chat box. +- [#237] Added a range parameter to the chat box(Parameter 5) +- [#190] The shape and color of the brackets of the chat box can now be changed + +### Fixed +- [#228] Typo of metaphysics config file. You may need to redo some configurations. +- [#189] Fixed that the player detector ignores config values. +- Fixed the key `status` of the table of the function `getResearch` from the minecolonies integration. + +## [1.18.1-0.7.8.1r] - 2021-12-24 + +### Fixed +- Fixed incompatibility with ae2 10.0.0-beta.1 + +## [1.18.1-0.7.8r] - 2021-12-18 + +### Added +- Minecolonies integration + +### Fixed +- [#228]Typo of metaphysics config file. You may need to redo some configurations. +- [#235]Fixed blurry HUD when opening the journey map full screen. +- [#236]Fixed patchouli loading + +## [1.16.5-0.7.6r] - 2021-12-14 + +### Fixed +- Crashes with newer minecolonies versions. + +### Added +- Transmitter integration for mekanism + +## [1.18-0.7.7.1r] - 2021-12-10 + +### Fixed +- Fixed a critical dupe bug with the ME Bridge. + +## [1.18-0.7.7r] - 2021-12-10 +# 1.18 port +This is the 1.18 port of Advanced Peripherals. +This version comes with applied energistics 2 and curios integration. + +## [1.17.1-0.7.6r] - 2021-12-03 + +# This is the last 1.17 version of Advanced Peripherals. +We will now work on a 1.18 port. Supported is 1.16 and 1.18. Join our discord to read why. +Rest in piece 1.17! + +### Fixed +Added compatibility with the latest CC version. + +## [1.17.1-0.7.5.1r] - 2021-11-26 + +### Added +- Added back me bridge and colony integrator recipe. +- Added back colony integrator pocket upgrade. + +## [1.17.1-0.7.5r] - 2021-11-26 + +### Attention +We changed our config system. So if you want to update the mod in your pack, don't forget to use the new files. +We also recommend you to delete the old one, no one needs crap. + +This is the port of 0.7.4r, 0.7.4.1b and 0.7.5r as 1.17 version. +### Changed +- [#247] We changed the textures of our blocks. Every block is now rotatable and the front texture of every block is now marked with a light aqua box. + +### Added +- [#237] Added `sendFormattedMessageToPlayer` to the chat box +- [#237] Added the ability to format prefixes with the chat box +- [#237] UUID's can now be used for `ToPlayer` functions in the chat box. +- [#237] Added a range parameter to the chat box(Parameter 5) +- [#190] The shape and color of the brackets of the chat box can now be changed + +### Fixed +- [#228] Typo of metaphysics config file. You may need to redo some configurations. +- [#189] Fixed that the player detector ignores config values. +- Fixed the key `status` of the table of the function `getResearch` from the minecolonies integration. + +## [1.16.5-0.7.6r] - 2021-12-14 + +### Fixed +- Crashes with newer minecolonies versions. + +### Added +- Transmitter integration for mekanism + +## [1.18-0.7.7.1r] - 2021-12-10 + +### Fixed +- Fixed a critical dupe bug with the ME Bridge. + +## [1.18-0.7.7r] - 2021-12-10 +# 1.18 port +This is the 1.18 port of Advanced Peripherals. +This version comes with applied energistics 2 and curios integration. + +## [1.17.1-0.7.6r] - 2021-12-03 + +# This is the last 1.17 version of Advanced Peripherals. +We will now work on a 1.18 port. Supported is 1.16 and 1.18. Join our discord to read why. +Rest in piece 1.17! + +### Fixed +Added compatibility with the latest CC version. + +## [1.17.1-0.7.5.1r] - 2021-11-26 + +### Added +- Added back me bridge and colony integrator recipe. +- Added back colony integrator pocket upgrade. + +## [1.17.1-0.7.5r] - 2021-11-26 + +### Attention +We changed our config system. So if you want to update the mod in your pack, don't forget to use the new files. +We also recommend you to delete the old one, no one needs crap. + +This is the port of 0.7.4r, 0.7.4.1b and 0.7.5r as 1.17 version. + +### Fixed +- Config typos and descriptions +- A FormattedMessage formatting mistake. +- [#203]Fixed Inventory Manager api, slot argument behaviour is now correct. +- [#219]Fixed that the inventory manager sees slot 0 as nil. + +### Added +- Added back AE2 and MineColonies integration. +- [[#224]](https://github.com/Seniorendi/AdvancedPeripherals/pull/224) Added Korean language by mindy15963 +- [#223]Added consumption of the ME Bridge to the config. +- [#76]Added noteblock integration +- [#217]Added `getItemInHand`, `getFreeSlot`, `isSpaceAvailable` and `getEmptySpace` to the inventory manager. +- Added support for armor items. You can use the slots 100-103 to access armor items. +- Added more information to the `getPlayerPos` function. (Configurable) +- A new config system. You can find every config in `gamePath/config/AdvancedPeripherals/xxx.toml` + De divided the config files in 4 different ones. General, World, Peripherals and Metaphysics. +- [#210]Added a new config value, `villagerStructureWeight`. Can be used to change the weight of the structures of our villager. + +## [1.16.5-0.7.4.1b] - 2021-11-15 + +### Attention +We changed our config system. So if you want to update the mod in your pack, don't forget to use the new files. +We also recommend you to delete the old one, no one needs crap. + +### Added +- A new config system. You can find every config in `gamePath/config/AdvancedPeripherals/xxx.toml` + De divided the config files in 4 different ones. General, World, Peripherals and Metaphysics. +- [#210]Added a new config value, `villagerStructureWeight`. Can be used to change the weight of the structures of our villager. + +## [1.16.5-0.7.4r] - 2021-11-14 + +### Fixed + +- A FormattedMessage formatting mistake. +- [#203]Fixed Inventory Manager api, slot argument behaviour is now correct. +- [#219]Fixed that the inventory manager sees slot 0 as nil. +- Fixed `getMaxMana` of the mana pool integration. + +### Added + +- [#76]Added noteblock integration +- [#217]Added `getItemInHand`, `getFreeSlot`, `isSpaceAvailable` and `getEmptySpace` to the inventory manager. +- Added support for armor items. You can use the slots 100-103 to access armor items. +- Added more information to the `getPlayerPos` function. (Configurable) +- Added `getManaNeeded` to the mana pool integration +- [#186] Added draconic evolution integration for the reactor and the energy core. + +## [1.17.1-0.7.3r] - 2021-10-13 + +### Removed + +- Removed `listCraftableItems()` from the RSBridge because of some issues + +### Added + +- `getMaxItemDiskStorage()` to the RS Bridge +- `getMaxFluidDiskStorage()` to the RS Bridge +- `getMaxItemExternalStorage()` to the RS Bridge +- `getMaxFluidExternalStorage()` to the RS Bridge +- `getPattern()` to the RS Bridge +- `isItemCraftable()` to the RS Bridge +- `isItemCraftable()` to the ME Bridge +- Mekanism dynamic tank integration +- french translation + +### Fixed + +- [#177]Fixed that items after removing it from a chest using the inventory manager does not stack anymore. +- [#194]Fixed error spamming when using `getRequests()` from the colony integrator +- [#203]Fixed Inventory Manager api, slot argument behaviour is now correct. + +## [1.17.1-0.7.2r] - 2021-09-06 + +### Fixed + +- `lookAtBlock` now correctly shows tags + +## [1.16.5-0.7.1r] - 2021-08-23 + +### Fixed + +- chunky turtle related issues +- RS and ME Bridge related issues +- redstone integrator block updates +- peripheral name of the player detector turtle +- Compatibility with CC:T 1.98.2