From 5bc1dc3218fee6134a52318ed95bea75e5f100ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 17 Oct 2024 02:11:37 +0000 Subject: [PATCH] chore: pre-commit changes [skip ci] --- .../advancedportals/core/tags/BungeeTag.java | 140 +++++++++--------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/core/src/main/java/com/sekwah/advancedportals/core/tags/BungeeTag.java b/core/src/main/java/com/sekwah/advancedportals/core/tags/BungeeTag.java index c50d7e0f..ac2e54bd 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/tags/BungeeTag.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/tags/BungeeTag.java @@ -1,70 +1,70 @@ -package com.sekwah.advancedportals.core.tags; - -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; -import com.google.inject.Inject; -import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.registry.TagTarget; -import com.sekwah.advancedportals.core.repository.ConfigRepository; -import com.sekwah.advancedportals.core.util.FriendlyDataOutput; -import com.sekwah.advancedportals.core.util.Lang; -import com.sekwah.advancedportals.core.warphandler.ActivationData; -import com.sekwah.advancedportals.core.warphandler.Tag; - -import java.util.Random; - -public class BungeeTag implements Tag.Activation { - - public static final String PACKET_CHANNEL = "BungeeCord"; - @Inject - ConfigRepository configRepository; - - public static String TAG_NAME = "bungee"; - - private final TagType[] tagTypes = - new TagType[] {TagType.PORTAL}; - - private final Random random = new Random(); - - @Override - public TagType[] getTagTypes() { - return tagTypes; - } - - @Override - public String getName() { - return TAG_NAME; - } - - @Override - public String[] getAliases() { - return null; - } - - @Override - public String description() { - return Lang.translate("tag.bungee.description"); - } - - @Override - public boolean preActivated(TagTarget target, PlayerContainer player, ActivationData activeData, String[] argData) { - return true; - } - - @Override - public void postActivated(TagTarget target, PlayerContainer player, ActivationData activationData, String[] argData) { - - } - - @Override - public boolean activated(TagTarget target, PlayerContainer player, ActivationData activeData, String[] argData) { - String selectedArg = argData[random.nextInt(argData.length)]; - - ByteArrayDataOutput outForSend = ByteStreams.newDataOutput(); - outForSend.writeUTF("Connect"); - outForSend.writeUTF(selectedArg); - player.sendPacket(BungeeTag.PACKET_CHANNEL, outForSend.toByteArray()); - activeData.setWarpStatus(ActivationData.WarpedStatus.WARPED); - return true; - } -} +package com.sekwah.advancedportals.core.tags; + +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; +import com.google.inject.Inject; +import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; +import com.sekwah.advancedportals.core.registry.TagTarget; +import com.sekwah.advancedportals.core.repository.ConfigRepository; +import com.sekwah.advancedportals.core.util.FriendlyDataOutput; +import com.sekwah.advancedportals.core.util.Lang; +import com.sekwah.advancedportals.core.warphandler.ActivationData; +import com.sekwah.advancedportals.core.warphandler.Tag; + +import java.util.Random; + +public class BungeeTag implements Tag.Activation { + + public static final String PACKET_CHANNEL = "BungeeCord"; + @Inject + ConfigRepository configRepository; + + public static String TAG_NAME = "bungee"; + + private final TagType[] tagTypes = + new TagType[] {TagType.PORTAL}; + + private final Random random = new Random(); + + @Override + public TagType[] getTagTypes() { + return tagTypes; + } + + @Override + public String getName() { + return TAG_NAME; + } + + @Override + public String[] getAliases() { + return null; + } + + @Override + public String description() { + return Lang.translate("tag.bungee.description"); + } + + @Override + public boolean preActivated(TagTarget target, PlayerContainer player, ActivationData activeData, String[] argData) { + return true; + } + + @Override + public void postActivated(TagTarget target, PlayerContainer player, ActivationData activationData, String[] argData) { + + } + + @Override + public boolean activated(TagTarget target, PlayerContainer player, ActivationData activeData, String[] argData) { + String selectedArg = argData[random.nextInt(argData.length)]; + + ByteArrayDataOutput outForSend = ByteStreams.newDataOutput(); + outForSend.writeUTF("Connect"); + outForSend.writeUTF(selectedArg); + player.sendPacket(BungeeTag.PACKET_CHANNEL, outForSend.toByteArray()); + activeData.setWarpStatus(ActivationData.WarpedStatus.WARPED); + return true; + } +}