aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-04 11:58:31 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-06-04 11:59:12 +0200
commit1a6dc6ad26494c6769159a9b404ccfb837065bcf (patch)
treef23d69c082d1b7fa64a788eeae757699f3c5689f
parentb2439b1a5d4efca754d2da00f695d71b5ffaf1d8 (diff)
downloadskyhanni-1a6dc6ad26494c6769159a9b404ccfb837065bcf.tar.gz
skyhanni-1a6dc6ad26494c6769159a9b404ccfb837065bcf.tar.bz2
skyhanni-1a6dc6ad26494c6769159a9b404ccfb837065bcf.zip
Added /pt <player> alias for /party transfer
-rw-r--r--CHANGELOG.md2
-rw-r--r--FEATURES.md2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/PartyTransferCommand.kt26
5 files changed, 38 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dbb4fcb3c..94abea18d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,6 +22,8 @@
+ Show missing items to contribute inside the inventory
+ Click on the item name to open the bazaar
+ Highlight a component in the inventory that can be contributed
++ Added `/pt <player>` alias for `/party transfer <player>`
+ + SkyBlock Command `/tp` to check the play time still works
### Changes
+ Added Options for displays Crop Milestone and Best Crop Time.
diff --git a/FEATURES.md b/FEATURES.md
index 857d38557..927bdb6f9 100644
--- a/FEATURES.md
+++ b/FEATURES.md
@@ -238,6 +238,8 @@
+ **/shtrackcollection <item>** - This tracks the number of items you collect, but it does not work with sacks.
+ **/shcropspeedmeter** - Helps calculate the real farming fortune with the formula crops broken per block.
+ **/shcroptime <amount> <item>** Displays the estimated time it will take to gather the requested quantity of a particular item based on the current crop speed.
++ `/pt <player>` as alias for `/party transfer <player>`
+ + SkyBlock Command `/tp` to check the play time still works
## Misc
- Allow to copy, paste, and mark selected text in signs (not visual, but it's working still)
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 5455967be..e67ef054b 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.features.chat.ChatFilter
import at.hannibal2.skyhanni.features.chat.PlayerDeathMessages
import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatFilter
import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatModifier
+import at.hannibal2.skyhanni.features.commands.PartyTransferCommand
import at.hannibal2.skyhanni.features.commands.WikiCommand
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.features.dungeon.*
@@ -178,6 +179,7 @@ class SkyHanniMod {
loadModule(RealTime())
loadModule(RngMeterInventory())
loadModule(WikiCommand())
+ loadModule(PartyTransferCommand())
loadModule(SummoningMobManager())
loadModule(AreaMiniBossFeatures())
loadModule(MobHighlight())
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java
index 34c2d9dcd..9cd9c82bb 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java
@@ -10,4 +10,10 @@ public class CommandsFeatures {
@ConfigOption(name = "Fandom Wiki", desc = "Use Fandom wiki (§ehypixel-skyblock.fandom.com§7) instead of the Hypixel wiki (§ewiki.hypixel.net§7).")
@ConfigEditorBoolean
public boolean useFandomWiki = false;
+
+ @Expose
+ @ConfigOption(name = "Party transfer", desc = "Allows §e/pt <player> §7as alias for §e/party transfer§7.\n" +
+ "§7SkyBlock Command §e/tp §7to check the play time still works.")
+ @ConfigEditorBoolean
+ public boolean usePartyTransferAlias = true;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyTransferCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyTransferCommand.kt
new file mode 100644
index 000000000..485a3569f
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyTransferCommand.kt
@@ -0,0 +1,26 @@
+package at.hannibal2.skyhanni.features.commands
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.PacketEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
+import net.minecraft.network.play.client.C01PacketChatMessage
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class PartyTransferCommand {
+ @SubscribeEvent
+ fun onSendPacket(event: PacketEvent.SendEvent) {
+ if (!SkyHanniMod.feature.commands.usePartyTransferAlias) return
+
+ val packet = event.packet
+ if (packet is C01PacketChatMessage) {
+ val pattern = "/pt (?<args>.*)".toPattern()
+ pattern.matchMatcher(packet.message.lowercase()) {
+ event.isCanceled = true
+ val args = group("args")
+ LorenzUtils.sendCommandToServer("party transfer $args")
+ }
+ }
+ }
+
+} \ No newline at end of file