From 4d2f1971d278fd10104b578ff6a12dc935bccb8a Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sat, 8 Jun 2024 11:38:23 -0400 Subject: [PATCH] =?UTF-8?q?feat(probe):=20=E5=A2=9E=E5=8A=A0=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E8=8A=82=E7=82=B9=E6=98=BE=E7=A4=BA=EF=BC=8Cresolves?= =?UTF-8?q?=20#111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 ++-- .../networks/network/NetworkRoot.java | 36 +++++++++++++++++++ .../networks/slimefun/tools/NetworkProbe.java | 14 ++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6a4b158a..9535cc27 100644 --- a/pom.xml +++ b/pom.xml @@ -183,9 +183,9 @@ - io.github.mooy1 + com.github.SlimefunGuguProject InfinityExpansion - 90e11bc + 3c5db3650a provided @@ -211,7 +211,7 @@ net.guizhanss GuizhanLibPlugin - 1.5.0 + 1.7.6 provided diff --git a/src/main/java/io/github/sefiraat/networks/network/NetworkRoot.java b/src/main/java/io/github/sefiraat/networks/network/NetworkRoot.java index 75ee9e99..2825f56d 100644 --- a/src/main/java/io/github/sefiraat/networks/network/NetworkRoot.java +++ b/src/main/java/io/github/sefiraat/networks/network/NetworkRoot.java @@ -51,6 +51,12 @@ public class NetworkRoot extends NetworkNode { private final Set powerDisplays = ConcurrentHashMap.newKeySet(); private final Set encoders = ConcurrentHashMap.newKeySet(); private final Set greedyBlocks = ConcurrentHashMap.newKeySet(); + private final Set cutters = ConcurrentHashMap.newKeySet(); + private final Set pasters = ConcurrentHashMap.newKeySet(); + private final Set vacuums = ConcurrentHashMap.newKeySet(); + private final Set wirelessTransmitters = ConcurrentHashMap.newKeySet(); + private final Set wirelessReceivers = ConcurrentHashMap.newKeySet(); + private final Set powerOutlets = ConcurrentHashMap.newKeySet(); private Set barrels = null; @@ -85,6 +91,12 @@ public void registerNode(@Nonnull Location location, @Nonnull NodeType type) { case POWER_DISPLAY -> powerDisplays.add(location); case ENCODER -> encoders.add(location); case GREEDY_BLOCK -> greedyBlocks.add(location); + case CUTTER -> cutters.add(location); + case PASTER -> pasters.add(location); + case VACUUM -> vacuums.add(location); + case WIRELESS_TRANSMITTER -> wirelessTransmitters.add(location); + case WIRELESS_RECEIVER -> wirelessReceivers.add(location); + case POWER_OUTLET -> powerOutlets.add(location); } } @@ -174,6 +186,30 @@ public Set getEncoders() { return this.encoders; } + public Set getCutters() { + return this.cutters; + } + + public Set getPasters() { + return this.pasters; + } + + public Set getVacuums() { + return this.vacuums; + } + + public Set getWirelessTransmitters() { + return this.wirelessTransmitters; + } + + public Set getWirelessReceivers() { + return this.wirelessReceivers; + } + + public Set getPowerOutlets() { + return this.powerOutlets; + } + @Nonnull public Map getAllNetworkItems() { final Map itemStacks = new HashMap<>(); diff --git a/src/main/java/io/github/sefiraat/networks/slimefun/tools/NetworkProbe.java b/src/main/java/io/github/sefiraat/networks/slimefun/tools/NetworkProbe.java index 60ed3ebc..9261c5ea 100644 --- a/src/main/java/io/github/sefiraat/networks/slimefun/tools/NetworkProbe.java +++ b/src/main/java/io/github/sefiraat/networks/slimefun/tools/NetworkProbe.java @@ -73,6 +73,13 @@ private void displayToPlayer(@Nonnull Block block, @Nonnull Player player) { final int powerNodes = root.getPowerNodes().size(); final int powerDisplays = root.getPowerDisplays().size(); final int encoders = root.getEncoders().size(); + final int cutters = root.getCutters().size(); + final int pasters = root.getPasters().size(); + final int vacuums = root.getVacuums().size(); + final int wirelessTransmitters = root.getWirelessTransmitters().size(); + final int wirelessReceivers = root.getWirelessReceivers().size(); + final int powerOutlets = root.getPowerOutlets().size(); + final int greedyBlocks = root.getGreedyBlocks().size(); final Map allNetworkItems = root.getAllNetworkItems(); final int distinctItems = allNetworkItems.size(); @@ -103,6 +110,13 @@ private void displayToPlayer(@Nonnull Block block, @Nonnull Player player) { player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络能源节点", p, powerNodes}, new StringBuffer(), null).toString()); player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络电表", p, powerDisplays}, new StringBuffer(), null).toString()); player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络配方编码器", p, encoders}, new StringBuffer(), null).toString()); + player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络剪切器", p, cutters}, new StringBuffer(), null).toString()); + player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络粘贴器", p, pasters}, new StringBuffer(), null).toString()); + player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络吸尘器", p, vacuums}, new StringBuffer(), null).toString()); + player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络无线发射器", p, wirelessTransmitters}, new StringBuffer(), null).toString()); + player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络无线接收器", p, wirelessReceivers}, new StringBuffer(), null).toString()); + player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络插口", p, powerOutlets}, new StringBuffer(), null).toString()); + player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "网络阻断器", p, greedyBlocks}, new StringBuffer(), null).toString()); player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "物品类型数量", p, distinctItems}, new StringBuffer(), null).toString()); player.sendMessage(MESSAGE_FORMAT.format(new Object[]{c, "累计物品数量", p, totalItems}, new StringBuffer(), null).toString());