aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hype/bbsentials/client/Commands
diff options
context:
space:
mode:
authorHacktheTime <l4bg0jb7@duck.com>2023-09-21 21:55:53 +0200
committerHacktheTime <l4bg0jb7@duck.com>2023-09-21 21:55:53 +0200
commit2486da0f63a2c2cce7341a1402df7834414b6c42 (patch)
tree4418c56ef97369f5e653660a724473579841838e /src/main/java/de/hype/bbsentials/client/Commands
parent2fbf623b1bfc51c4576a02bf8b02413d718cf514 (diff)
downloadBBsentials-2486da0f63a2c2cce7341a1402df7834414b6c42.tar.gz
BBsentials-2486da0f63a2c2cce7341a1402df7834414b6c42.tar.bz2
BBsentials-2486da0f63a2c2cce7341a1402df7834414b6c42.zip
aad Islands and island detecter util method
Diffstat (limited to 'src/main/java/de/hype/bbsentials/client/Commands')
-rw-r--r--src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java b/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java
index 490288c..ee83ec9 100644
--- a/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java
+++ b/src/main/java/de/hype/bbsentials/client/Commands/CommandsOLD.java
@@ -4,9 +4,9 @@ import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import de.hype.bbsentials.chat.Chat;
+import de.hype.bbsentials.client.BBUtils;
import de.hype.bbsentials.client.BBsentials;
import de.hype.bbsentials.constants.enviromentShared.ChChestItems;
-import de.hype.bbsentials.constants.enviromentShared.Islands;
import de.hype.bbsentials.constants.enviromentShared.MiningEvents;
import de.hype.bbsentials.packets.AbstractPacket;
import de.hype.bbsentials.packets.packets.*;
@@ -18,6 +18,7 @@ import net.minecraft.command.CommandSource;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import static de.hype.bbsentials.client.BBsentials.*;
@@ -276,7 +277,7 @@ public class CommandsOLD {
String extramessage = StringArgumentType.getString(context, "extramessage");
String location = StringArgumentType.getString(context, "location");
boolean lessWaste = Boolean.parseBoolean(StringArgumentType.getString(context, "lasswaste"));
- sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, Islands.HUB, extramessage, lessWaste));
+ sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, BBUtils.getCurrentIsland() , extramessage, lessWaste));
return 1;
})
)
@@ -284,14 +285,14 @@ public class CommandsOLD {
int hub = IntegerArgumentType.getInteger(context, "Hub");
String location = "bea";
boolean lessWaste = Boolean.parseBoolean(StringArgumentType.getString(context, "lasswaste"));
- sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, Islands.HUB, "", lessWaste));
+ sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, BBUtils.getCurrentIsland(), "", lessWaste));
return 1;
})
))
.executes((context) -> {
int hub = IntegerArgumentType.getInteger(context, "Hub");
String location = StringArgumentType.getString(context, "location");
- sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, Islands.HUB, "", true));
+ sendPacket(new SplashNotifyPacket(hub, config.getUsername(), location, BBUtils.getCurrentIsland(), "", true));
return 1;
})
@@ -320,7 +321,7 @@ public class CommandsOLD {
.executes((context) -> {
try {
BBsentials.bbserver.sendPacket(new MiningEventPacket(event,//TODO get the island
- config.getUsername(), Islands.HUB));
+ config.getUsername(), Objects.requireNonNull(BBUtils.getCurrentIsland())));
} catch (Exception e) {
Chat.sendPrivateMessageToSelf("§c" + e.getMessage());
}