From b9541505af68ac7b7c093206ac7b1ba88957a5a6 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 30 Aug 2021 13:55:01 -0400 Subject: [PATCH] Bump version to try and fix deploying; other nitpicks --- Jenkinsfile | 4 +- ap/pom.xml | 4 +- bootstrap/bungeecord/pom.xml | 4 +- bootstrap/pom.xml | 4 +- bootstrap/spigot/pom.xml | 4 +- bootstrap/sponge/pom.xml | 4 +- bootstrap/standalone/pom.xml | 4 +- bootstrap/velocity/pom.xml | 4 +- common/pom.xml | 2 +- connector/pom.xml | 8 ++-- .../network/UpstreamPacketHandler.java | 2 +- .../network/translators/PacketTranslator.java | 2 +- .../translators/PacketTranslatorRegistry.java | 2 +- .../BedrockAdventureSettingsTranslator.java | 2 +- .../bedrock/BedrockAnimateTranslator.java | 2 +- .../BedrockBlockEntityDataTranslator.java | 2 +- .../BedrockBlockPickRequestTranslator.java | 2 +- .../bedrock/BedrockBookEditTranslator.java | 2 +- .../BedrockCommandBlockUpdateTranslator.java | 2 +- .../BedrockCommandRequestTranslator.java | 2 +- .../BedrockContainerCloseTranslator.java | 2 +- .../bedrock/BedrockEmoteListTranslator.java | 2 +- .../BedrockEntityPickRequestTranslator.java | 2 +- .../bedrock/BedrockFilterTextTranslator.java | 2 +- ...BedrockInventoryTransactionTranslator.java | 2 +- .../BedrockItemFrameDropItemTranslator.java | 2 +- .../BedrockItemStackRequestTranslator.java | 2 +- .../BedrockLecternUpdateTranslator.java | 2 +- .../BedrockMapInfoRequestTranslator.java | 2 +- .../BedrockMobEquipmentTranslator.java | 2 +- .../BedrockMoveEntityAbsoluteTranslator.java | 2 +- .../BedrockNetworkStackLatencyTranslator.java | 2 +- ...drockPacketViolationWarningTranslator.java | 2 +- .../bedrock/BedrockPlayerInputTranslator.java | 2 +- ...tionTrackingDBClientRequestTranslator.java | 2 +- .../bedrock/BedrockRespawnTranslator.java | 2 +- ...edrockServerSettingsRequestTranslator.java | 2 +- ...SetLocalPlayerAsInitializedTranslator.java | 2 +- .../bedrock/BedrockShowCreditsTranslator.java | 2 +- .../bedrock/BedrockTextTranslator.java | 2 +- .../entity/BedrockEntityEventTranslator.java | 2 +- .../player/BedrockActionTranslator.java | 2 +- .../entity/player/BedrockEmoteTranslator.java | 2 +- .../player/BedrockInteractTranslator.java | 2 +- .../player/BedrockMovePlayerTranslator.java | 2 +- .../player/BedrockRiderJumpTranslator.java | 2 +- .../BedrockSetPlayerGameTypeTranslator.java | 2 +- .../BedrockLevelSoundEventTranslator.java | 2 +- .../java/JavaAdvancementsTabTranslator.java | 2 +- .../java/JavaAdvancementsTranslator.java | 2 +- .../java/JavaBossBarTranslator.java | 2 +- .../translators/java/JavaChatTranslator.java | 2 +- .../java/JavaDeclareCommandsTranslator.java | 2 +- .../java/JavaDeclareRecipesTranslator.java | 2 +- .../java/JavaDeclareTagsTranslator.java | 2 +- .../java/JavaDifficultyTranslator.java | 2 +- .../java/JavaDisconnectPacket.java | 2 +- .../java/JavaJoinGameTranslator.java | 2 +- .../java/JavaKeepAliveTranslator.java | 2 +- .../java/JavaLoginDisconnectTranslator.java | 2 +- .../JavaLoginPluginRequestTranslator.java | 2 +- .../java/JavaLoginSuccessTranslator.java | 2 +- .../translators/java/JavaPingPacket.java | 2 +- .../java/JavaPluginMessageTranslator.java | 2 +- .../java/JavaRespawnTranslator.java | 2 +- .../java/JavaStatisticsTranslator.java | 2 +- .../java/JavaUnlockRecipesTranslator.java | 2 +- .../entity/JavaEntityAnimationTranslator.java | 2 +- .../entity/JavaEntityAttachTranslator.java | 2 +- .../JavaEntityCollectItemTranslator.java | 2 +- .../entity/JavaEntityEffectTranslator.java | 2 +- .../entity/JavaEntityEquipmentTranslator.java | 2 +- .../entity/JavaEntityHeadLookTranslator.java | 2 +- .../entity/JavaEntityMetadataTranslator.java | 2 +- .../JavaEntityPositionRotationTranslator.java | 2 +- .../entity/JavaEntityPositionTranslator.java | 2 +- .../JavaEntityPropertiesTranslator.java | 2 +- .../JavaEntityRemoveEffectTranslator.java | 2 +- .../entity/JavaEntityRotationTranslator.java | 2 +- .../JavaEntitySetPassengersTranslator.java | 2 +- .../entity/JavaEntityStatusTranslator.java | 2 +- .../entity/JavaEntityTeleportTranslator.java | 2 +- .../entity/JavaEntityVelocityTranslator.java | 2 +- .../entity/JavaRemoveEntitiesTranslator.java | 2 +- .../player/JavaPlayerAbilitiesTranslator.java | 2 +- .../player/JavaPlayerActionAckTranslator.java | 2 +- .../JavaPlayerChangeHeldItemTranslator.java | 2 +- .../player/JavaPlayerHealthTranslator.java | 2 +- .../player/JavaPlayerListEntryTranslator.java | 2 +- .../JavaPlayerPositionRotationTranslator.java | 2 +- .../JavaPlayerSetExperienceTranslator.java | 2 +- .../spawn/JavaSpawnEntityTranslator.java | 2 +- .../spawn/JavaSpawnExpOrbTranslator.java | 2 +- .../JavaSpawnLivingEntityTranslator.java | 2 +- .../spawn/JavaSpawnPaintingTranslator.java | 2 +- .../spawn/JavaSpawnPlayerTranslator.java | 2 +- .../JavaDisplayScoreboardTranslator.java | 2 +- .../JavaScoreboardObjectiveTranslator.java | 2 +- .../java/scoreboard/JavaTeamTranslator.java | 2 +- .../scoreboard/JavaUpdateScoreTranslator.java | 2 +- .../java/title/JavaClearTitlesTranslator.java | 2 +- .../title/JavaSetActionBarTextTranslator.java | 2 +- .../title/JavaSetSubtitleTextTranslator.java | 2 +- .../title/JavaSetTitleTextTranslator.java | 2 +- .../JavaSetTitlesAnimationTranslator.java | 2 +- .../window/JavaCloseWindowTranslator.java | 2 +- .../window/JavaOpenHorseWindowTranslator.java | 2 +- .../java/window/JavaOpenWindowTranslator.java | 2 +- .../java/window/JavaSetSlotTranslator.java | 2 +- .../window/JavaWindowItemsTranslator.java | 2 +- .../window/JavaWindowPropertyTranslator.java | 2 +- .../world/JavaBlockBreakAnimTranslator.java | 2 +- .../java/world/JavaBlockChangeTranslator.java | 2 +- .../java/world/JavaBlockValueTranslator.java | 2 +- .../java/world/JavaChunkDataTranslator.java | 2 +- .../java/world/JavaExplosionTranslator.java | 2 +- .../java/world/JavaMapDataTranslator.java | 2 +- .../world/JavaMultiBlockChangeTranslator.java | 2 +- .../world/JavaNotifyClientTranslator.java | 2 +- .../world/JavaPlayBuiltinSoundTranslator.java | 2 +- .../java/world/JavaPlayEffectTranslator.java | 2 +- .../java/world/JavaPlaySoundTranslator.java | 2 +- .../world/JavaSpawnParticleTranslator.java | 2 +- .../world/JavaSpawnPositionTranslator.java | 2 +- .../java/world/JavaStopSoundTranslator.java | 2 +- .../java/world/JavaTradeListTranslator.java | 2 +- .../java/world/JavaUnloadChunkTranslator.java | 2 +- .../world/JavaUpdateTileEntityTranslator.java | 2 +- .../java/world/JavaUpdateTimeTranslator.java | 2 +- .../JavaUpdateViewDistanceTranslator.java | 2 +- .../JavaUpdateViewPositionTranslator.java | 2 +- .../java/world/JavaVehicleMoveTranslator.java | 2 +- .../connector/utils/LoginEncryptionUtils.java | 48 ++++++++++++++----- pom.xml | 2 +- 134 files changed, 181 insertions(+), 155 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 325fb977b..0b77fa9c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { } } - /*stage ('Deploy') { + stage ('Deploy') { when { branch "master" } @@ -48,7 +48,7 @@ pipeline { serverId: "opencollab-artifactory" ) } - }*/ + } } post { diff --git a/ap/pom.xml b/ap/pom.xml index 7e263c0d1..f8cc2dd1b 100644 --- a/ap/pom.xml +++ b/ap/pom.xml @@ -6,9 +6,9 @@ org.geysermc geyser-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT ap - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT \ No newline at end of file diff --git a/bootstrap/bungeecord/pom.xml b/bootstrap/bungeecord/pom.xml index f49f5f408..b01ac7984 100644 --- a/bootstrap/bungeecord/pom.xml +++ b/bootstrap/bungeecord/pom.xml @@ -6,7 +6,7 @@ org.geysermc bootstrap-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT bootstrap-bungeecord @@ -14,7 +14,7 @@ org.geysermc connector - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT compile diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml index 6bbd1a0b6..c54d489fa 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -6,7 +6,7 @@ org.geysermc geyser-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT bootstrap-parent pom @@ -34,7 +34,7 @@ org.geysermc ap - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT provided diff --git a/bootstrap/spigot/pom.xml b/bootstrap/spigot/pom.xml index 4277dc235..cc2a73ffd 100644 --- a/bootstrap/spigot/pom.xml +++ b/bootstrap/spigot/pom.xml @@ -6,7 +6,7 @@ org.geysermc bootstrap-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT bootstrap-spigot @@ -21,7 +21,7 @@ org.geysermc connector - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT compile diff --git a/bootstrap/sponge/pom.xml b/bootstrap/sponge/pom.xml index 77f4fe78a..4991e8aaf 100644 --- a/bootstrap/sponge/pom.xml +++ b/bootstrap/sponge/pom.xml @@ -6,7 +6,7 @@ org.geysermc bootstrap-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT bootstrap-sponge @@ -14,7 +14,7 @@ org.geysermc connector - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT compile diff --git a/bootstrap/standalone/pom.xml b/bootstrap/standalone/pom.xml index e338f9533..e39097b4a 100644 --- a/bootstrap/standalone/pom.xml +++ b/bootstrap/standalone/pom.xml @@ -6,7 +6,7 @@ org.geysermc bootstrap-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT bootstrap-standalone @@ -14,7 +14,7 @@ org.geysermc connector - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT compile diff --git a/bootstrap/velocity/pom.xml b/bootstrap/velocity/pom.xml index 5c12b6a46..1e74bafbc 100644 --- a/bootstrap/velocity/pom.xml +++ b/bootstrap/velocity/pom.xml @@ -6,7 +6,7 @@ org.geysermc bootstrap-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT bootstrap-velocity @@ -14,7 +14,7 @@ org.geysermc connector - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT compile diff --git a/common/pom.xml b/common/pom.xml index 2dfa63a42..edf31c2b8 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -6,7 +6,7 @@ org.geysermc geyser-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT common diff --git a/connector/pom.xml b/connector/pom.xml index 371a09a52..6b955ca21 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -6,7 +6,7 @@ org.geysermc geyser-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT connector @@ -21,13 +21,13 @@ org.geysermc ap - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT provided org.geysermc common - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT compile @@ -115,7 +115,7 @@ com.github.CloudburstMC.Protocol bedrock-v448 - 690a545d + 6ce2f6e compile diff --git a/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java b/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java index 84bb63b95..6915e4575 100644 --- a/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java +++ b/connector/src/main/java/org/geysermc/connector/network/UpstreamPacketHandler.java @@ -80,7 +80,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { session.setBlockMappings(BlockRegistries.BLOCKS.forVersion(loginPacket.getProtocolVersion())); session.setItemMappings(Registries.ITEMS.forVersion(loginPacket.getProtocolVersion())); - LoginEncryptionUtils.encryptPlayerConnection(connector, session, loginPacket); + LoginEncryptionUtils.encryptPlayerConnection(session, loginPacket); PlayStatusPacket playStatus = new PlayStatusPacket(); playStatus.setStatus(PlayStatusPacket.Status.LOGIN_SUCCESS); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslator.java index 8bb3eb330..f59f747d2 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslator.java @@ -29,6 +29,6 @@ import org.geysermc.connector.network.session.GeyserSession; public abstract class PacketTranslator { - public abstract void translate(T packet, GeyserSession session); + public abstract void translate(GeyserSession session, T packet); } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslatorRegistry.java b/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslatorRegistry.java index 7bd0e66ac..49f299d59 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslatorRegistry.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/PacketTranslatorRegistry.java @@ -112,7 +112,7 @@ public class PacketTranslatorRegistry { } try { - translator.translate(packet, session); + translator.translate(session, packet); } catch (Throwable ex) { GeyserConnector.getInstance().getLogger().error(LanguageUtils.getLocaleStringLog("geyser.network.translator.packet.failed", packet.getClass().getSimpleName()), ex); ex.printStackTrace(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAdventureSettingsTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAdventureSettingsTranslator.java index e868eedeb..a9ae9db6d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAdventureSettingsTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAdventureSettingsTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockAdventureSettingsTranslator extends PacketTranslator { @Override - public void translate(AdventureSettingsPacket packet, GeyserSession session) { + public void translate(GeyserSession session, AdventureSettingsPacket packet) { boolean isFlying = packet.getSettings().contains(AdventureSetting.FLYING); if (!isFlying && session.getGameMode() == GameMode.SPECTATOR) { // We should always be flying in spectator mode diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java index 4d915b619..53912bf4e 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockAnimateTranslator.java @@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit; public class BedrockAnimateTranslator extends PacketTranslator { @Override - public void translate(AnimatePacket packet, GeyserSession session) { + public void translate(GeyserSession session, AnimatePacket packet) { // Stop the player sending animations before they have fully spawned into the server if (!session.isSpawned()) { return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockEntityDataTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockEntityDataTranslator.java index f9db86d8b..a5575bb82 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockEntityDataTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockEntityDataTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.connector.utils.SignUtils; public class BedrockBlockEntityDataTranslator extends PacketTranslator { @Override - public void translate(BlockEntityDataPacket packet, GeyserSession session) { + public void translate(GeyserSession session, BlockEntityDataPacket packet) { NbtMap tag = packet.getData(); if (tag.getString("id").equals("Sign")) { // This is the reason why this all works - Bedrock sends packets every time you update the sign, Java only wants the final packet diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockPickRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockPickRequestTranslator.java index 3a3a4bbed..add16e9ca 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockPickRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBlockPickRequestTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.utils.InventoryUtils; public class BedrockBlockPickRequestTranslator extends PacketTranslator { @Override - public void translate(BlockPickRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, BlockPickRequestPacket packet) { Vector3i vector = packet.getBlockPosition(); int blockToPick = session.getConnector().getWorldManager().getBlockAt(session, vector.getX(), vector.getY(), vector.getZ()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBookEditTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBookEditTranslator.java index 67dcb40c8..53e945c52 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBookEditTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockBookEditTranslator.java @@ -49,7 +49,7 @@ public class BedrockBookEditTranslator extends PacketTranslator private static final int MAXIMUM_TITLE_LENGTH = 128 * 4; @Override - public void translate(BookEditPacket packet, GeyserSession session) { + public void translate(GeyserSession session, BookEditPacket packet) { if (packet.getText() != null && !packet.getText().isEmpty() && packet.getText().getBytes(StandardCharsets.UTF_8).length > MAXIMUM_PAGE_LENGTH) { session.getConnector().getLogger().warning("Page length greater than server allowed!"); return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandBlockUpdateTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandBlockUpdateTranslator.java index 634ba0c56..f8f503387 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandBlockUpdateTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandBlockUpdateTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockCommandBlockUpdateTranslator extends PacketTranslator { @Override - public void translate(CommandBlockUpdatePacket packet, GeyserSession session) { + public void translate(GeyserSession session, CommandBlockUpdatePacket packet) { String command = packet.getCommand(); boolean outputTracked = packet.isOutputTracked(); if (packet.isBlock()) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java index a9ed15cef..b73048d33 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockCommandRequestTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class BedrockCommandRequestTranslator extends PacketTranslator { @Override - public void translate(CommandRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, CommandRequestPacket packet) { String command = packet.getCommand().replace("/", ""); CommandManager commandManager = GeyserConnector.getInstance().getCommandManager(); if (session.getConnector().getPlatformType() == PlatformType.STANDALONE && command.trim().startsWith("geyser ") && commandManager.getCommands().containsKey(command.split(" ")[1])) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockContainerCloseTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockContainerCloseTranslator.java index 88c2206d5..935dde462 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockContainerCloseTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockContainerCloseTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.utils.InventoryUtils; public class BedrockContainerCloseTranslator extends PacketTranslator { @Override - public void translate(ContainerClosePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ContainerClosePacket packet) { byte windowId = packet.getId(); //Client wants close confirmation diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEmoteListTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEmoteListTranslator.java index 2519aa447..4a005082a 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEmoteListTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEmoteListTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockEmoteListTranslator extends PacketTranslator { @Override - public void translate(EmoteListPacket packet, GeyserSession session) { + public void translate(GeyserSession session, EmoteListPacket packet) { if (session.getConnector().getConfig().getEmoteOffhandWorkaround() == EmoteOffhandWorkaroundOption.NO_EMOTES) { return; } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEntityPickRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEntityPickRequestTranslator.java index 3910fd7ff..c6677dbdc 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEntityPickRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockEntityPickRequestTranslator.java @@ -42,7 +42,7 @@ import org.geysermc.connector.utils.InventoryUtils; public class BedrockEntityPickRequestTranslator extends PacketTranslator { @Override - public void translate(EntityPickRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, EntityPickRequestPacket packet) { if (session.getGameMode() != GameMode.CREATIVE) return; // Apparently Java behavior Entity entity = session.getEntityCache().getEntityByGeyserId(packet.getRuntimeEntityId()); if (entity == null) return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockFilterTextTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockFilterTextTranslator.java index 3b017dfbd..681ca432c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockFilterTextTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockFilterTextTranslator.java @@ -41,7 +41,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockFilterTextTranslator extends PacketTranslator { @Override - public void translate(FilterTextPacket packet, GeyserSession session) { + public void translate(GeyserSession session, FilterTextPacket packet) { if (session.getOpenInventory() instanceof CartographyContainer) { // We don't want to be able to rename in the cartography table return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockInventoryTransactionTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockInventoryTransactionTranslator.java index 72cbdbd52..45135d90c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockInventoryTransactionTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockInventoryTransactionTranslator.java @@ -70,7 +70,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator { @Override - public void translate(ItemFrameDropItemPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ItemFrameDropItemPacket packet) { Entity entity = ItemFrameEntity.getItemFrameEntity(session, packet.getBlockPosition()); if (entity != null) { ClientPlayerInteractEntityPacket interactPacket = new ClientPlayerInteractEntityPacket((int) entity.getEntityId(), diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockItemStackRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockItemStackRequestTranslator.java index b5e0dd2ce..80d5e8098 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockItemStackRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockItemStackRequestTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.connector.network.translators.inventory.InventoryTranslator; public class BedrockItemStackRequestTranslator extends PacketTranslator { @Override - public void translate(ItemStackRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ItemStackRequestPacket packet) { Inventory inventory = session.getOpenInventory(); if (inventory == null) return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockLecternUpdateTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockLecternUpdateTranslator.java index f693ade96..ea30099f0 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockLecternUpdateTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockLecternUpdateTranslator.java @@ -45,7 +45,7 @@ import org.geysermc.connector.utils.InventoryUtils; public class BedrockLecternUpdateTranslator extends PacketTranslator { @Override - public void translate(LecternUpdatePacket packet, GeyserSession session) { + public void translate(GeyserSession session, LecternUpdatePacket packet) { if (packet.isDroppingBook()) { // Bedrock drops the book outside of the GUI. Java drops it in the GUI // So, we enter the GUI and then drop it! :) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMapInfoRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMapInfoRequestTranslator.java index b997644c7..4b4c5b20d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMapInfoRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMapInfoRequestTranslator.java @@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit; public class BedrockMapInfoRequestTranslator extends PacketTranslator { @Override - public void translate(MapInfoRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, MapInfoRequestPacket packet) { long mapId = packet.getUniqueMapId(); ClientboundMapItemDataPacket mapPacket = session.getStoredMaps().remove(mapId); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMobEquipmentTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMobEquipmentTranslator.java index 3102c622f..4e53e0c4e 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMobEquipmentTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMobEquipmentTranslator.java @@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit; public class BedrockMobEquipmentTranslator extends PacketTranslator { @Override - public void translate(MobEquipmentPacket packet, GeyserSession session) { + public void translate(GeyserSession session, MobEquipmentPacket packet) { if (!session.isSpawned() || packet.getHotbarSlot() > 8 || packet.getContainerId() != ContainerId.INVENTORY || session.getPlayerInventory().getHeldItemSlot() == packet.getHotbarSlot()) { // For the last condition - Don't update the slot if the slot is the same - not Java Edition behavior and messes with plugins such as Grief Prevention diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java index fbfaafb43..00fa6a1f3 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockMoveEntityAbsoluteTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockMoveEntityAbsoluteTranslator extends PacketTranslator { @Override - public void translate(MoveEntityAbsolutePacket packet, GeyserSession session) { + public void translate(GeyserSession session, MoveEntityAbsolutePacket packet) { session.setLastVehicleMoveTimestamp(System.currentTimeMillis()); float y = packet.getPosition().getY(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockNetworkStackLatencyTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockNetworkStackLatencyTranslator.java index cd9265c0e..345c69d66 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockNetworkStackLatencyTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockNetworkStackLatencyTranslator.java @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit; public class BedrockNetworkStackLatencyTranslator extends PacketTranslator { @Override - public void translate(NetworkStackLatencyPacket packet, GeyserSession session) { + public void translate(GeyserSession session, NetworkStackLatencyPacket packet) { long pingId; // so apparently, as of 1.16.200 // PS4 divides the network stack latency timestamp FOR US!!! diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPacketViolationWarningTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPacketViolationWarningTranslator.java index b69cedcb5..110a3f547 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPacketViolationWarningTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPacketViolationWarningTranslator.java @@ -34,7 +34,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockPacketViolationWarningTranslator extends PacketTranslator { @Override - public void translate(PacketViolationWarningPacket packet, GeyserSession session) { + public void translate(GeyserSession session, PacketViolationWarningPacket packet) { // Not translated since this is something that the developers need to know session.getConnector().getLogger().error("Packet violation warning sent from client! " + packet.toString()); } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPlayerInputTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPlayerInputTranslator.java index 1d9eb0221..27289b5d2 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPlayerInputTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPlayerInputTranslator.java @@ -46,7 +46,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockPlayerInputTranslator extends PacketTranslator { @Override - public void translate(PlayerInputPacket packet, GeyserSession session) { + public void translate(GeyserSession session, PlayerInputPacket packet) { ClientSteerVehiclePacket clientSteerVehiclePacket = new ClientSteerVehiclePacket( packet.getInputMotion().getX(), packet.getInputMotion().getY(), packet.isJumping(), packet.isSneaking() ); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java index da760cdd9..b8f09103d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockPositionTrackingDBClientRequestTranslator.java @@ -42,7 +42,7 @@ import org.geysermc.connector.utils.LoadstoneTracker; public class BedrockPositionTrackingDBClientRequestTranslator extends PacketTranslator { @Override - public void translate(PositionTrackingDBClientRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, PositionTrackingDBClientRequestPacket packet) { PositionTrackingDBServerBroadcastPacket broadcastPacket = new PositionTrackingDBServerBroadcastPacket(); broadcastPacket.setTrackingId(packet.getTrackingId()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockRespawnTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockRespawnTranslator.java index 2964bd65c..1257ec0d9 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockRespawnTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockRespawnTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockRespawnTranslator extends PacketTranslator { @Override - public void translate(RespawnPacket packet, GeyserSession session) { + public void translate(GeyserSession session, RespawnPacket packet) { if (packet.getState() == RespawnPacket.State.CLIENT_READY) { // Previously we only sent the respawn packet before the server finished loading // The message included was 'Otherwise when immediate respawn is on the client never loads' diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockServerSettingsRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockServerSettingsRequestTranslator.java index 501ed4468..2b2ec2917 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockServerSettingsRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockServerSettingsRequestTranslator.java @@ -38,7 +38,7 @@ import java.util.concurrent.TimeUnit; @Translator(packet = ServerSettingsRequestPacket.class) public class BedrockServerSettingsRequestTranslator extends PacketTranslator { @Override - public void translate(ServerSettingsRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSettingsRequestPacket packet) { CustomForm window = SettingsUtils.buildForm(session); int windowId = session.getFormCache().addForm(window); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java index ac6f543d3..c52513c4d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockSetLocalPlayerAsInitializedTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.connector.skin.SkullSkinManager; @Translator(packet = SetLocalPlayerAsInitializedPacket.class) public class BedrockSetLocalPlayerAsInitializedTranslator extends PacketTranslator { @Override - public void translate(SetLocalPlayerAsInitializedPacket packet, GeyserSession session) { + public void translate(GeyserSession session, SetLocalPlayerAsInitializedPacket packet) { if (session.getPlayerEntity().getGeyserId() == packet.getRuntimeEntityId()) { if (!session.getUpstream().isInitialized()) { session.getUpstream().setInitialized(true); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockShowCreditsTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockShowCreditsTranslator.java index c6c292225..0252817ef 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockShowCreditsTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockShowCreditsTranslator.java @@ -37,7 +37,7 @@ import com.nukkitx.protocol.bedrock.packet.ShowCreditsPacket; public class BedrockShowCreditsTranslator extends PacketTranslator { @Override - public void translate(ShowCreditsPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ShowCreditsPacket packet) { if (packet.getStatus() == ShowCreditsPacket.Status.END_CREDITS) { ClientRequestPacket javaRespawnPacket = new ClientRequestPacket(ClientRequest.RESPAWN); session.sendDownstreamPacket(javaRespawnPacket); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java index 9253372a9..775a40114 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class BedrockTextTranslator extends PacketTranslator { @Override - public void translate(TextPacket packet, GeyserSession session) { + public void translate(GeyserSession session, TextPacket packet) { String message = packet.getMessage(); if (MessageTranslator.isTooLong(message, session)) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/BedrockEntityEventTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/BedrockEntityEventTranslator.java index e5c2590da..b85f57586 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/BedrockEntityEventTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/BedrockEntityEventTranslator.java @@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit; public class BedrockEntityEventTranslator extends PacketTranslator { @Override - public void translate(EntityEventPacket packet, GeyserSession session) { + public void translate(GeyserSession session, EntityEventPacket packet) { switch (packet.getType()) { case EATING_ITEM: // Resend the packet so we get the eating sounds diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockActionTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockActionTranslator.java index 2603f2a0f..ab652434c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockActionTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockActionTranslator.java @@ -54,7 +54,7 @@ import java.util.ArrayList; public class BedrockActionTranslator extends PacketTranslator { @Override - public void translate(PlayerActionPacket packet, GeyserSession session) { + public void translate(GeyserSession session, PlayerActionPacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); // Send book update before any player action diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockEmoteTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockEmoteTranslator.java index 890dc0c8c..a20c3872c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockEmoteTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockEmoteTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.utils.BlockUtils; public class BedrockEmoteTranslator extends PacketTranslator { @Override - public void translate(EmotePacket packet, GeyserSession session) { + public void translate(GeyserSession session, EmotePacket packet) { if (session.getConnector().getConfig().getEmoteOffhandWorkaround() != EmoteOffhandWorkaroundOption.DISABLED) { // Activate the workaround - we should trigger the offhand now ClientPlayerActionPacket swapHandsPacket = new ClientPlayerActionPacket(PlayerAction.SWAP_HANDS, BlockUtils.POSITION_ZERO, diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockInteractTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockInteractTranslator.java index 10384d43c..cb101c231 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockInteractTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockInteractTranslator.java @@ -46,7 +46,7 @@ import org.geysermc.connector.utils.InteractiveTagManager; public class BedrockInteractTranslator extends PacketTranslator { @Override - public void translate(InteractPacket packet, GeyserSession session) { + public void translate(GeyserSession session, InteractPacket packet) { Entity entity; if (packet.getRuntimeEntityId() == session.getPlayerEntity().getGeyserId()) { //Player is not in entity cache diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java index 7970dbd16..6882e6e0c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockMovePlayerTranslator.java @@ -53,7 +53,7 @@ public class BedrockMovePlayerTranslator extends PacketTranslator { @Override - public void translate(RiderJumpPacket packet, GeyserSession session) { + public void translate(GeyserSession session, RiderJumpPacket packet) { Entity vehicle = session.getRidingVehicleEntity(); if (vehicle instanceof AbstractHorseEntity) { ClientPlayerStatePacket playerStatePacket = new ClientPlayerStatePacket((int) vehicle.getEntityId(), PlayerState.START_HORSE_JUMP, packet.getJumpStrength()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java index b8afe76c8..1022d838d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/entity/player/BedrockSetPlayerGameTypeTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator; public class BedrockSetPlayerGameTypeTranslator extends PacketTranslator { @Override - public void translate(SetPlayerGameTypePacket packet, GeyserSession session) { + public void translate(GeyserSession session, SetPlayerGameTypePacket packet) { // no SetPlayerGameTypePacket playerGameTypePacket = new SetPlayerGameTypePacket(); playerGameTypePacket.setGamemode(session.getGameMode().ordinal()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/world/BedrockLevelSoundEventTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/world/BedrockLevelSoundEventTranslator.java index c87692b8c..8b19a00eb 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/world/BedrockLevelSoundEventTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/world/BedrockLevelSoundEventTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.connector.utils.CooldownUtils; public class BedrockLevelSoundEventTranslator extends PacketTranslator { @Override - public void translate(LevelSoundEventPacket packet, GeyserSession session) { + public void translate(GeyserSession session, LevelSoundEventPacket packet) { // lol what even :thinking: session.sendUpstreamPacket(packet); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTabTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTabTranslator.java index aa22ae465..6a6d541c6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTabTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTabTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.connector.network.translators.Translator; @Translator(packet = ServerAdvancementTabPacket.class) public class JavaAdvancementsTabTranslator extends PacketTranslator { @Override - public void translate(ServerAdvancementTabPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerAdvancementTabPacket packet) { AdvancementsCache advancementsCache = session.getAdvancementsCache(); advancementsCache.setCurrentAdvancementCategoryId(packet.getTabId()); advancementsCache.buildAndShowListForm(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTranslator.java index 2e1057e0e..01de50c21 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaAdvancementsTranslator.java @@ -42,7 +42,7 @@ import java.util.Map; public class JavaAdvancementsTranslator extends PacketTranslator { @Override - public void translate(ServerAdvancementsPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerAdvancementsPacket packet) { AdvancementsCache advancementsCache = session.getAdvancementsCache(); if (packet.isReset()) { advancementsCache.getStoredAdvancements().clear(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaBossBarTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaBossBarTranslator.java index 0dd7cb950..b74c84444 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaBossBarTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaBossBarTranslator.java @@ -35,7 +35,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.ServerBossBarPacke @Translator(packet = ServerBossBarPacket.class) public class JavaBossBarTranslator extends PacketTranslator { @Override - public void translate(ServerBossBarPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerBossBarPacket packet) { BossBar bossBar = session.getEntityCache().getBossBar(packet.getUuid()); switch (packet.getAction()) { case ADD: diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaChatTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaChatTranslator.java index a59880509..e059517d7 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaChatTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaChatTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class JavaChatTranslator extends PacketTranslator { @Override - public void translate(ServerChatPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerChatPacket packet) { TextPacket textPacket = new TextPacket(); textPacket.setPlatformChatId(""); textPacket.setSourceName(""); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareCommandsTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareCommandsTranslator.java index 0aec21840..e4116c6aa 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareCommandsTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareCommandsTranslator.java @@ -96,7 +96,7 @@ public class JavaDeclareCommandsTranslator extends PacketTranslator> recipeTypes = Registries.CRAFTING_DATA.forVersion(session.getUpstream().getProtocolVersion()); // Get the last known network ID (first used for the pregenerated recipes) and increment from there. int netId = InventoryUtils.LAST_RECIPE_NET_ID + 1; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareTagsTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareTagsTranslator.java index 368693bf2..c72ab4543 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareTagsTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDeclareTagsTranslator.java @@ -34,7 +34,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaDeclareTagsTranslator extends PacketTranslator { @Override - public void translate(ServerDeclareTagsPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerDeclareTagsPacket packet) { session.getTagCache().loadPacket(packet); } } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDifficultyTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDifficultyTranslator.java index 48447fe8a..b6299cc35 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDifficultyTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDifficultyTranslator.java @@ -36,7 +36,7 @@ import com.nukkitx.protocol.bedrock.packet.SetDifficultyPacket; public class JavaDifficultyTranslator extends PacketTranslator { @Override - public void translate(ServerDifficultyPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerDifficultyPacket packet) { SetDifficultyPacket setDifficultyPacket = new SetDifficultyPacket(); setDifficultyPacket.setDifficulty(packet.getDifficulty().ordinal()); session.sendUpstreamPacket(setDifficultyPacket); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDisconnectPacket.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDisconnectPacket.java index cf6688db9..3a9ca3787 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDisconnectPacket.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaDisconnectPacket.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class JavaDisconnectPacket extends PacketTranslator { @Override - public void translate(ServerDisconnectPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerDisconnectPacket packet) { session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale())); } } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java index a84464c10..da21b7c22 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaJoinGameTranslator.java @@ -52,7 +52,7 @@ public class JavaJoinGameTranslator extends PacketTranslator SKIN_PART_VALUES = Arrays.asList(SkinPart.values()); @Override - public void translate(ServerJoinGamePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerJoinGamePacket packet) { PlayerEntity entity = session.getPlayerEntity(); entity.setEntityId(packet.getEntityId()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaKeepAliveTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaKeepAliveTranslator.java index 8506389f3..6798b191c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaKeepAliveTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaKeepAliveTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaKeepAliveTranslator extends PacketTranslator { @Override - public void translate(ServerKeepAlivePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerKeepAlivePacket packet) { if (!session.getConnector().getConfig().isForwardPlayerPing()) { return; } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginDisconnectTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginDisconnectTranslator.java index 3433edcc2..814082d05 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginDisconnectTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginDisconnectTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class JavaLoginDisconnectTranslator extends PacketTranslator { @Override - public void translate(LoginDisconnectPacket packet, GeyserSession session) { + public void translate(GeyserSession session, LoginDisconnectPacket packet) { // The client doesn't manually get disconnected so we have to do it ourselves session.disconnect(MessageTranslator.convertMessage(packet.getReason(), session.getLocale())); } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginPluginRequestTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginPluginRequestTranslator.java index 9680188be..2ed285208 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginPluginRequestTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginPluginRequestTranslator.java @@ -35,7 +35,7 @@ import com.github.steveice10.mc.protocol.packet.login.server.LoginPluginRequestP @Translator(packet = LoginPluginRequestPacket.class) public class JavaLoginPluginRequestTranslator extends PacketTranslator { @Override - public void translate(LoginPluginRequestPacket packet, GeyserSession session) { + public void translate(GeyserSession session, LoginPluginRequestPacket packet) { // A vanilla client doesn't know any PluginMessage in the Login state, so we don't know any either. // Note: Fabric Networking API v1 will not let the client log in without sending this session.sendDownstreamPacket( diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginSuccessTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginSuccessTranslator.java index 214ea5deb..d7675bd07 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginSuccessTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaLoginSuccessTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.skin.SkinManager; public class JavaLoginSuccessTranslator extends PacketTranslator { @Override - public void translate(LoginSuccessPacket packet, GeyserSession session) { + public void translate(GeyserSession session, LoginSuccessPacket packet) { PlayerEntity playerEntity = session.getPlayerEntity(); AuthType remoteAuthType = session.getRemoteAuthType(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPingPacket.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPingPacket.java index c324a81c4..c2dc3454d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPingPacket.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPingPacket.java @@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaPingPacket extends PacketTranslator { @Override - public void translate(ServerPingPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPingPacket packet) { session.sendDownstreamPacket(new ClientPongPacket(packet.getId())); } } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPluginMessageTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPluginMessageTranslator.java index 013730878..15f1f960b 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPluginMessageTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaPluginMessageTranslator.java @@ -41,7 +41,7 @@ import java.nio.charset.StandardCharsets; @Translator(packet = ServerPluginMessagePacket.class) public class JavaPluginMessageTranslator extends PacketTranslator { @Override - public void translate(ServerPluginMessagePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPluginMessagePacket packet) { // The only plugin messages it has to listen for are Floodgate plugin messages if (session.getRemoteAuthType() != AuthType.FLOODGATE) { return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaRespawnTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaRespawnTranslator.java index 0af30c4fd..8df47c7b0 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaRespawnTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaRespawnTranslator.java @@ -43,7 +43,7 @@ import org.geysermc.connector.utils.DimensionUtils; public class JavaRespawnTranslator extends PacketTranslator { @Override - public void translate(ServerRespawnPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerRespawnPacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); entity.setHealth(entity.getMaxHealth()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaStatisticsTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaStatisticsTranslator.java index 247808041..15c6452ed 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaStatisticsTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaStatisticsTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.utils.StatisticsUtils; public class JavaStatisticsTranslator extends PacketTranslator { @Override - public void translate(ServerStatisticsPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerStatisticsPacket packet) { session.updateStatistics(packet.getStatistics()); if (session.isWaitingForStatistics()) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaUnlockRecipesTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaUnlockRecipesTranslator.java index 0a0ba4d2d..d7c4053e6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaUnlockRecipesTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaUnlockRecipesTranslator.java @@ -40,7 +40,7 @@ import java.util.Arrays; public class JavaUnlockRecipesTranslator extends PacketTranslator { @Override - public void translate(ServerUnlockRecipesPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerUnlockRecipesPacket packet) { if (packet.getAction() == UnlockRecipesAction.REMOVE) { session.getUnlockedRecipes().removeAll(Arrays.asList(packet.getRecipes())); } else { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAnimationTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAnimationTranslator.java index 255c4f466..57bacc658 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAnimationTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAnimationTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.utils.DimensionUtils; public class JavaEntityAnimationTranslator extends PacketTranslator { @Override - public void translate(ServerEntityAnimationPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityAnimationPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAttachTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAttachTranslator.java index b7ca66fe2..20f5c4e57 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAttachTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityAttachTranslator.java @@ -42,7 +42,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityAttachTranslator extends PacketTranslator { @Override - public void translate(ServerEntityAttachPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityAttachPacket packet) { Entity holderId; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityCollectItemTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityCollectItemTranslator.java index 4711e54e3..70b93472f 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityCollectItemTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityCollectItemTranslator.java @@ -44,7 +44,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityCollectItemTranslator extends PacketTranslator { @Override - public void translate(ServerEntityCollectItemPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityCollectItemPacket packet) { // Collected entity is the other entity Entity collectedEntity = session.getEntityCache().getEntityByJavaId(packet.getCollectedEntityId()); if (collectedEntity == null) return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEffectTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEffectTranslator.java index 627b3f2e9..d99b11a49 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEffectTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEffectTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.connector.utils.EntityUtils; public class JavaEntityEffectTranslator extends PacketTranslator { @Override - public void translate(ServerEntityEffectPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityEffectPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEquipmentTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEquipmentTranslator.java index d3a1c52bc..5dc015418 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEquipmentTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityEquipmentTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.connector.network.translators.item.ItemTranslator; public class JavaEntityEquipmentTranslator extends PacketTranslator { @Override - public void translate(ServerEntityEquipmentPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityEquipmentPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityHeadLookTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityHeadLookTranslator.java index 71801e4db..5120e8c3a 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityHeadLookTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityHeadLookTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityHeadLookTranslator extends PacketTranslator { @Override - public void translate(ServerEntityHeadLookPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityHeadLookPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityMetadataTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityMetadataTranslator.java index 73047d0c4..c67becaef 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityMetadataTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityMetadataTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.connector.utils.LanguageUtils; public class JavaEntityMetadataTranslator extends PacketTranslator { @Override - public void translate(ServerEntityMetadataPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityMetadataPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionRotationTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionRotationTranslator.java index 7f915e47d..733725936 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionRotationTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionRotationTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityPositionRotationTranslator extends PacketTranslator { @Override - public void translate(ServerEntityPositionRotationPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityPositionRotationPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionTranslator.java index 999b5f0e9..67f8fe1b6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPositionTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityPositionTranslator extends PacketTranslator { @Override - public void translate(ServerEntityPositionPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityPositionPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPropertiesTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPropertiesTranslator.java index 642ba3bb8..c3937a1e3 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPropertiesTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityPropertiesTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityPropertiesTranslator extends PacketTranslator { @Override - public void translate(ServerEntityPropertiesPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityPropertiesPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRemoveEffectTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRemoveEffectTranslator.java index 4a55f51a8..131fa2505 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRemoveEffectTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRemoveEffectTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.connector.utils.EntityUtils; public class JavaEntityRemoveEffectTranslator extends PacketTranslator { @Override - public void translate(ServerEntityRemoveEffectPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityRemoveEffectPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRotationTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRotationTranslator.java index 62fe65857..71e005899 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRotationTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityRotationTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityRotationTranslator extends PacketTranslator { @Override - public void translate(ServerEntityRotationPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityRotationPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntitySetPassengersTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntitySetPassengersTranslator.java index 66d3e3880..3e9fa0755 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntitySetPassengersTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntitySetPassengersTranslator.java @@ -43,7 +43,7 @@ import java.util.Arrays; public class JavaEntitySetPassengersTranslator extends PacketTranslator { @Override - public void translate(ServerEntitySetPassengersPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntitySetPassengersPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityStatusTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityStatusTranslator.java index af1cfc45b..aaa42d12d 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityStatusTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityStatusTranslator.java @@ -43,7 +43,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaEntityStatusTranslator extends PacketTranslator { @Override - public void translate(ServerEntityStatusPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityStatusPacket packet) { Entity entity; if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityTeleportTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityTeleportTranslator.java index 62d2ed214..35dcacfec 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityTeleportTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityTeleportTranslator.java @@ -37,7 +37,7 @@ import com.nukkitx.math.vector.Vector3f; public class JavaEntityTeleportTranslator extends PacketTranslator { @Override - public void translate(ServerEntityTeleportPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityTeleportPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityVelocityTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityVelocityTranslator.java index 3f0b69cdb..28d0d977f 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityVelocityTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaEntityVelocityTranslator.java @@ -40,7 +40,7 @@ import com.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket; public class JavaEntityVelocityTranslator extends PacketTranslator { @Override - public void translate(ServerEntityVelocityPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerEntityVelocityPacket packet) { Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId()); if (packet.getEntityId() == session.getPlayerEntity().getEntityId()) { entity = session.getPlayerEntity(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaRemoveEntitiesTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaRemoveEntitiesTranslator.java index e05763ee1..0b1e021e2 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaRemoveEntitiesTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/JavaRemoveEntitiesTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaRemoveEntitiesTranslator extends PacketTranslator { @Override - public void translate(ServerRemoveEntitiesPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerRemoveEntitiesPacket packet) { for (int entityId : packet.getEntityIds()) { Entity entity = session.getEntityCache().getEntityByJavaId(entityId); if (entity != null) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerAbilitiesTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerAbilitiesTranslator.java index f97e91edb..4b0152fcb 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerAbilitiesTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerAbilitiesTranslator.java @@ -34,7 +34,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaPlayerAbilitiesTranslator extends PacketTranslator { @Override - public void translate(ServerPlayerAbilitiesPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayerAbilitiesPacket packet) { session.setCanFly(packet.isCanFly()); session.setFlying(packet.isFlying()); session.sendAdventureSettings(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java index f7572dd82..8c9aa0142 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerActionAckTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.utils.ChunkUtils; public class JavaPlayerActionAckTranslator extends PacketTranslator { @Override - public void translate(ServerPlayerActionAckPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayerActionAckPacket packet) { ChunkUtils.updateBlock(session, packet.getNewState(), packet.getPosition()); if (packet.getAction() == PlayerAction.START_DIGGING && !packet.isSuccessful()) { LevelEventPacket stopBreak = new LevelEventPacket(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerChangeHeldItemTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerChangeHeldItemTranslator.java index 58ab3bfcd..27e16ee12 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerChangeHeldItemTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerChangeHeldItemTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaPlayerChangeHeldItemTranslator extends PacketTranslator { @Override - public void translate(ServerPlayerChangeHeldItemPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayerChangeHeldItemPacket packet) { PlayerHotbarPacket hotbarPacket = new PlayerHotbarPacket(); hotbarPacket.setContainerId(0); hotbarPacket.setSelectedHotbarSlot(packet.getSlot()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerHealthTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerHealthTranslator.java index 05bdfd95b..20403a610 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerHealthTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerHealthTranslator.java @@ -41,7 +41,7 @@ import java.util.List; public class JavaPlayerHealthTranslator extends PacketTranslator { @Override - public void translate(ServerPlayerHealthPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayerHealthPacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); int health = (int) Math.ceil(packet.getHealth()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerListEntryTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerListEntryTranslator.java index b8a7972c8..b5a358035 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerListEntryTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerListEntryTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.skin.SkinManager; @Translator(packet = ServerPlayerListEntryPacket.class) public class JavaPlayerListEntryTranslator extends PacketTranslator { @Override - public void translate(ServerPlayerListEntryPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayerListEntryPacket packet) { if (packet.getAction() != PlayerListEntryAction.ADD_PLAYER && packet.getAction() != PlayerListEntryAction.REMOVE_PLAYER) return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerPositionRotationTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerPositionRotationTranslator.java index 454d23d69..6b1778464 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerPositionRotationTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerPositionRotationTranslator.java @@ -50,7 +50,7 @@ import org.geysermc.connector.utils.LanguageUtils; public class JavaPlayerPositionRotationTranslator extends PacketTranslator { @Override - public void translate(ServerPlayerPositionRotationPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayerPositionRotationPacket packet) { if (!session.isLoggedIn()) return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerSetExperienceTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerSetExperienceTranslator.java index 52cd0b587..8a8636eb5 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerSetExperienceTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/player/JavaPlayerSetExperienceTranslator.java @@ -40,7 +40,7 @@ import java.util.Arrays; public class JavaPlayerSetExperienceTranslator extends PacketTranslator { @Override - public void translate(ServerPlayerSetExperiencePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayerSetExperiencePacket packet) { SessionPlayerEntity entity = session.getPlayerEntity(); AttributeData experience = GeyserAttributeType.EXPERIENCE.getAttribute(packet.getExperience()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnEntityTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnEntityTranslator.java index 7bce03d72..e53358ac2 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnEntityTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnEntityTranslator.java @@ -46,7 +46,7 @@ import java.lang.reflect.InvocationTargetException; public class JavaSpawnEntityTranslator extends PacketTranslator { @Override - public void translate(ServerSpawnEntityPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSpawnEntityPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnExpOrbTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnExpOrbTranslator.java index a158751c8..6fd0e6094 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnExpOrbTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnExpOrbTranslator.java @@ -39,7 +39,7 @@ import com.nukkitx.math.vector.Vector3f; public class JavaSpawnExpOrbTranslator extends PacketTranslator { @Override - public void translate(ServerSpawnExpOrbPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSpawnExpOrbPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Entity entity = new ExpOrbEntity( diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnLivingEntityTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnLivingEntityTranslator.java index 96d93fabd..46d47e808 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnLivingEntityTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnLivingEntityTranslator.java @@ -42,7 +42,7 @@ import java.lang.reflect.InvocationTargetException; public class JavaSpawnLivingEntityTranslator extends PacketTranslator { @Override - public void translate(ServerSpawnLivingEntityPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSpawnLivingEntityPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Vector3f motion = Vector3f.from(packet.getMotionX(), packet.getMotionY(), packet.getMotionZ()); Vector3f rotation = Vector3f.from(packet.getYaw(), packet.getPitch(), packet.getHeadYaw()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPaintingTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPaintingTranslator.java index fea6fd3d4..1d5ee4736 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPaintingTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPaintingTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.connector.utils.PaintingType; public class JavaSpawnPaintingTranslator extends PacketTranslator { @Override - public void translate(ServerSpawnPaintingPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSpawnPaintingPacket packet) { Vector3f position = Vector3f.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ()); PaintingEntity entity = new PaintingEntity(packet.getEntityId(), diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPlayerTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPlayerTranslator.java index 4cb967234..6df3666b6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPlayerTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/entity/spawn/JavaSpawnPlayerTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.connector.skin.SkinManager; public class JavaSpawnPlayerTranslator extends PacketTranslator { @Override - public void translate(ServerSpawnPlayerPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSpawnPlayerPacket packet) { Vector3f position = Vector3f.from(packet.getX(), packet.getY(), packet.getZ()); Vector3f rotation = Vector3f.from(packet.getYaw(), packet.getPitch(), packet.getYaw()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaDisplayScoreboardTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaDisplayScoreboardTranslator.java index dc2112b6a..a92cc628e 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaDisplayScoreboardTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaDisplayScoreboardTranslator.java @@ -35,7 +35,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.scoreboard.ServerD public class JavaDisplayScoreboardTranslator extends PacketTranslator { @Override - public void translate(ServerDisplayScoreboardPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerDisplayScoreboardPacket packet) { session.getWorldCache().getScoreboard() .displayObjective(packet.getName(), packet.getPosition()); } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaScoreboardObjectiveTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaScoreboardObjectiveTranslator.java index 87c842ff9..d898edf9c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaScoreboardObjectiveTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaScoreboardObjectiveTranslator.java @@ -41,7 +41,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.scoreboard.ServerS public class JavaScoreboardObjectiveTranslator extends PacketTranslator { @Override - public void translate(ServerScoreboardObjectivePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerScoreboardObjectivePacket packet) { WorldCache worldCache = session.getWorldCache(); Scoreboard scoreboard = worldCache.getScoreboard(); Objective objective = scoreboard.getObjective(packet.getName()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java index 1774f12c9..6ec4813d4 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaTeamTranslator.java @@ -47,7 +47,7 @@ public class JavaTeamTranslator extends PacketTranslator { private static final GeyserLogger LOGGER = GeyserConnector.getInstance().getLogger(); @Override - public void translate(ServerTeamPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerTeamPacket packet) { if (LOGGER.isDebug()) { LOGGER.debug("Team packet " + packet.getTeamName() + " " + packet.getAction() + " " + Arrays.toString(packet.getPlayers())); } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaUpdateScoreTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaUpdateScoreTranslator.java index b7054b1e2..daf4d3832 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaUpdateScoreTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/scoreboard/JavaUpdateScoreTranslator.java @@ -47,7 +47,7 @@ public class JavaUpdateScoreTranslator extends PacketTranslator { @Override - public void translate(ServerClearTitlesPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerClearTitlesPacket packet) { SetTitlePacket titlePacket = new SetTitlePacket(); // TODO handle packet.isResetTimes() titlePacket.setType(SetTitlePacket.Type.CLEAR); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetActionBarTextTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetActionBarTextTranslator.java index ebbfdffe2..516568b37 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetActionBarTextTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetActionBarTextTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class JavaSetActionBarTextTranslator extends PacketTranslator { @Override - public void translate(ServerSetActionBarTextPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSetActionBarTextPacket packet) { String text; if (packet.getText() == null) { //TODO 1.17 can this happen? text = " "; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetSubtitleTextTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetSubtitleTextTranslator.java index 5411962a1..ee246ea11 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetSubtitleTextTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetSubtitleTextTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class JavaSetSubtitleTextTranslator extends PacketTranslator { @Override - public void translate(ServerSetSubtitleTextPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSetSubtitleTextPacket packet) { String text; if (packet.getText() == null) { //TODO 1.17 can this happen? text = " "; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitleTextTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitleTextTranslator.java index 5e8d05572..199d05e3b 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitleTextTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitleTextTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.chat.MessageTranslator; public class JavaSetTitleTextTranslator extends PacketTranslator { @Override - public void translate(ServerSetTitleTextPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSetTitleTextPacket packet) { String text; if (packet.getText() == null) { //TODO 1.17 can this happen? text = " "; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitlesAnimationTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitlesAnimationTranslator.java index 69a0b2ba7..7514eef4c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitlesAnimationTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/title/JavaSetTitlesAnimationTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaSetTitlesAnimationTranslator extends PacketTranslator { @Override - public void translate(ServerSetTitlesAnimationPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSetTitlesAnimationPacket packet) { SetTitlePacket titlePacket = new SetTitlePacket(); titlePacket.setType(SetTitlePacket.Type.TIMES); titlePacket.setText(""); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaCloseWindowTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaCloseWindowTranslator.java index 3c984c0a2..419f4fc50 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaCloseWindowTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaCloseWindowTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.utils.InventoryUtils; public class JavaCloseWindowTranslator extends PacketTranslator { @Override - public void translate(ServerCloseWindowPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerCloseWindowPacket packet) { // Sometimes the server can request a window close of ID 0... when the window isn't even open // Don't confirm in this instance InventoryUtils.closeInventory(session, packet.getWindowId(), (session.getOpenInventory() != null && session.getOpenInventory().getId() == packet.getWindowId())); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaOpenHorseWindowTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaOpenHorseWindowTranslator.java index 5016b6150..ecd74332b 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaOpenHorseWindowTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaOpenHorseWindowTranslator.java @@ -98,7 +98,7 @@ public class JavaOpenHorseWindowTranslator extends PacketTranslator { @Override - public void translate(ServerOpenWindowPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerOpenWindowPacket packet) { if (packet.getWindowId() == 0) { return; } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaSetSlotTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaSetSlotTranslator.java index 68fc2df39..27f932c98 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaSetSlotTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaSetSlotTranslator.java @@ -58,7 +58,7 @@ import java.util.concurrent.TimeUnit; public class JavaSetSlotTranslator extends PacketTranslator { @Override - public void translate(ServerSetSlotPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSetSlotPacket packet) { if (packet.getWindowId() == 255) { //cursor GeyserItemStack newItem = GeyserItemStack.from(packet.getItem()); session.getPlayerInventory().setCursor(newItem, session); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowItemsTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowItemsTranslator.java index 7f8cea595..542001dfb 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowItemsTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowItemsTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.utils.InventoryUtils; public class JavaWindowItemsTranslator extends PacketTranslator { @Override - public void translate(ServerWindowItemsPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerWindowItemsPacket packet) { Inventory inventory = InventoryUtils.getInventory(session, packet.getWindowId()); if (inventory == null) return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowPropertyTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowPropertyTranslator.java index c5dcc76ca..512c797d2 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowPropertyTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/window/JavaWindowPropertyTranslator.java @@ -37,7 +37,7 @@ import org.geysermc.connector.utils.InventoryUtils; public class JavaWindowPropertyTranslator extends PacketTranslator { @Override - public void translate(ServerWindowPropertyPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerWindowPropertyPacket packet) { Inventory inventory = InventoryUtils.getInventory(session, packet.getWindowId()); if (inventory == null) return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockBreakAnimTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockBreakAnimTranslator.java index 4a3f60a8d..1a2b5e469 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockBreakAnimTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockBreakAnimTranslator.java @@ -41,7 +41,7 @@ import org.geysermc.connector.utils.BlockUtils; public class JavaBlockBreakAnimTranslator extends PacketTranslator { @Override - public void translate(ServerBlockBreakAnimPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerBlockBreakAnimPacket packet) { int state = session.getConnector().getWorldManager().getBlockAt(session, packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ()); int breakTime = (int) (65535 / Math.ceil(BlockUtils.getBreakTime(session, BlockRegistries.JAVA_BLOCKS.get(state), ItemMapping.AIR, new CompoundTag(""), false) * 20)); LevelEventPacket levelEventPacket = new LevelEventPacket(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockChangeTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockChangeTranslator.java index d144e99b8..78ee1238e 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockChangeTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockChangeTranslator.java @@ -42,7 +42,7 @@ import org.geysermc.connector.utils.ChunkUtils; public class JavaBlockChangeTranslator extends PacketTranslator { @Override - public void translate(ServerBlockChangePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerBlockChangePacket packet) { Position pos = packet.getRecord().getPosition(); boolean updatePlacement = session.getConnector().getPlatformType() != PlatformType.SPIGOT && // Spigot simply listens for the block place event session.getConnector().getWorldManager().getBlockAt(session, pos) != packet.getRecord().getBlock(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockValueTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockValueTranslator.java index bb703f2ee..892a41070 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockValueTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaBlockValueTranslator.java @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit; public class JavaBlockValueTranslator extends PacketTranslator { @Override - public void translate(ServerBlockValuePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerBlockValuePacket packet) { BlockEventPacket blockEventPacket = new BlockEventPacket(); blockEventPacket.setBlockPosition(Vector3i.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ())); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaChunkDataTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaChunkDataTranslator.java index 2ec3a15fc..2cadf157f 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaChunkDataTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaChunkDataTranslator.java @@ -52,7 +52,7 @@ public class JavaChunkDataTranslator extends PacketTranslator { @Override - public void translate(ServerExplosionPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerExplosionPacket packet) { for (ExplodedBlockRecord record : packet.getExploded()) { Vector3f pos = Vector3f.from(packet.getX() + record.getX(), packet.getY() + record.getY(), packet.getZ() + record.getZ()); ChunkUtils.updateBlock(session, BlockStateValues.JAVA_AIR_ID, pos.toInt()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMapDataTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMapDataTranslator.java index 8a67080a4..984d85d04 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMapDataTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMapDataTranslator.java @@ -41,7 +41,7 @@ import org.geysermc.connector.utils.MapColor; @Translator(packet = ServerMapDataPacket.class) public class JavaMapDataTranslator extends PacketTranslator { @Override - public void translate(ServerMapDataPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerMapDataPacket packet) { ClientboundMapItemDataPacket mapItemDataPacket = new ClientboundMapItemDataPacket(); boolean shouldStore = false; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMultiBlockChangeTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMultiBlockChangeTranslator.java index de1eea0bd..2a4115af7 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMultiBlockChangeTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaMultiBlockChangeTranslator.java @@ -37,7 +37,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.world.ServerMultiB public class JavaMultiBlockChangeTranslator extends PacketTranslator { @Override - public void translate(ServerMultiBlockChangePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerMultiBlockChangePacket packet) { for (BlockChangeRecord record : packet.getRecords()) { ChunkUtils.updateBlock(session, record.getBlock(), record.getPosition()); } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaNotifyClientTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaNotifyClientTranslator.java index f6eb375e6..1cdc09a75 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaNotifyClientTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaNotifyClientTranslator.java @@ -49,7 +49,7 @@ import org.geysermc.connector.utils.LocaleUtils; public class JavaNotifyClientTranslator extends PacketTranslator { @Override - public void translate(ServerNotifyClientPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerNotifyClientPacket packet) { PlayerEntity entity = session.getPlayerEntity(); switch (packet.getNotification()) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java index ec7adc034..f5ae7ff07 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayBuiltinSoundTranslator.java @@ -44,7 +44,7 @@ import org.geysermc.connector.registry.type.SoundMapping; public class JavaPlayBuiltinSoundTranslator extends PacketTranslator { @Override - public void translate(ServerPlayBuiltinSoundPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayBuiltinSoundPacket packet) { String packetSound = packet.getSound().getName(); SoundMapping soundMapping = Registries.SOUNDS.get(packetSound); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayEffectTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayEffectTranslator.java index 4ba1f2d41..aca7a1f93 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayEffectTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlayEffectTranslator.java @@ -48,7 +48,7 @@ import java.util.Locale; public class JavaPlayEffectTranslator extends PacketTranslator { @Override - public void translate(ServerPlayEffectPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlayEffectPacket packet) { // Separate case since each RecordEffectData in Java is an individual track in Bedrock if (packet.getEffect() == SoundEffect.RECORD) { RecordEffectData recordEffectData = (RecordEffectData) packet.getData(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlaySoundTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlaySoundTranslator.java index 8741bf241..1f1ac0d12 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlaySoundTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaPlaySoundTranslator.java @@ -40,7 +40,7 @@ import org.geysermc.connector.registry.type.SoundMapping; public class JavaPlaySoundTranslator extends PacketTranslator { @Override - public void translate(ServerPlaySoundPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerPlaySoundPacket packet) { String packetSound; if (packet.getSound() instanceof BuiltinSound) { packetSound = ((BuiltinSound) packet.getSound()).getName(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnParticleTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnParticleTranslator.java index 14f433c92..df17ceada 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnParticleTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnParticleTranslator.java @@ -50,7 +50,7 @@ import java.util.function.Function; public class JavaSpawnParticleTranslator extends PacketTranslator { @Override - public void translate(ServerSpawnParticlePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSpawnParticlePacket packet) { Function particleCreateFunction = createParticle(session, packet.getParticle()); if (particleCreateFunction != null) { if (packet.getAmount() == 0) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnPositionTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnPositionTranslator.java index 7c0a2a0ff..16e507440 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnPositionTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaSpawnPositionTranslator.java @@ -38,7 +38,7 @@ import org.geysermc.connector.utils.DimensionUtils; public class JavaSpawnPositionTranslator extends PacketTranslator { @Override - public void translate(ServerSpawnPositionPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerSpawnPositionPacket packet) { SetSpawnPositionPacket spawnPositionPacket = new SetSpawnPositionPacket(); spawnPositionPacket.setBlockPosition(Vector3i.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ())); spawnPositionPacket.setSpawnForced(true); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaStopSoundTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaStopSoundTranslator.java index ebcf2234e..93241310f 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaStopSoundTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaStopSoundTranslator.java @@ -39,7 +39,7 @@ import org.geysermc.connector.registry.type.SoundMapping; public class JavaStopSoundTranslator extends PacketTranslator { @Override - public void translate(ServerStopSoundPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerStopSoundPacket packet) { // Runs if all sounds are stopped if (packet.getSound() == null) { StopSoundPacket stopPacket = new StopSoundPacket(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaTradeListTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaTradeListTranslator.java index cce48f5cc..8b05d0469 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaTradeListTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaTradeListTranslator.java @@ -51,7 +51,7 @@ import java.util.List; public class JavaTradeListTranslator extends PacketTranslator { @Override - public void translate(ServerTradeListPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerTradeListPacket packet) { Inventory openInventory = session.getOpenInventory(); if (!(openInventory instanceof MerchantContainer && openInventory.getId() == packet.getWindowId())) { return; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUnloadChunkTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUnloadChunkTranslator.java index 6d3efc1cb..3d428327a 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUnloadChunkTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUnloadChunkTranslator.java @@ -37,7 +37,7 @@ import java.util.Iterator; public class JavaUnloadChunkTranslator extends PacketTranslator { @Override - public void translate(ServerUnloadChunkPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerUnloadChunkPacket packet) { session.getChunkCache().removeChunk(packet.getX(), packet.getZ()); //Checks if a skull is in an unloaded chunk then removes it diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTileEntityTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTileEntityTranslator.java index 056e0092d..25c4684b1 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTileEntityTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTileEntityTranslator.java @@ -45,7 +45,7 @@ import org.geysermc.connector.utils.BlockEntityUtils; public class JavaUpdateTileEntityTranslator extends PacketTranslator { @Override - public void translate(ServerUpdateTileEntityPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerUpdateTileEntityPacket packet) { String id = BlockEntityUtils.getBedrockBlockEntityId(packet.getType().name()); if (packet.getNbt().isEmpty()) { // Fixes errors in servers sending empty NBT BlockEntityUtils.updateBlockEntity(session, NbtMap.EMPTY, packet.getPosition()); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTimeTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTimeTranslator.java index 461d8139d..3564177e1 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTimeTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateTimeTranslator.java @@ -35,7 +35,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaUpdateTimeTranslator extends PacketTranslator { @Override - public void translate(ServerUpdateTimePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerUpdateTimePacket packet) { // Bedrock sends a GameRulesChangedPacket if there is no daylight cycle // Java just sends a negative long if there is no daylight cycle long time = packet.getTime(); diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewDistanceTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewDistanceTranslator.java index 23dc2dbc5..155af39b6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewDistanceTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewDistanceTranslator.java @@ -35,7 +35,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.world.ServerUpdate public class JavaUpdateViewDistanceTranslator extends PacketTranslator { @Override - public void translate(ServerUpdateViewDistancePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerUpdateViewDistancePacket packet) { session.setRenderDistance(packet.getViewDistance()); } } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewPositionTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewPositionTranslator.java index d304e1108..a4ce170bf 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewPositionTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaUpdateViewPositionTranslator.java @@ -37,7 +37,7 @@ import com.nukkitx.math.vector.Vector3i; public class JavaUpdateViewPositionTranslator extends PacketTranslator { @Override - public void translate(ServerUpdateViewPositionPacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerUpdateViewPositionPacket packet) { if (!session.isSpawned() && session.getLastChunkPosition() == null) { ChunkUtils.updateChunkPosition(session, Vector3i.from(packet.getChunkX() << 4, 64, packet.getChunkZ() << 4)); } diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaVehicleMoveTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaVehicleMoveTranslator.java index 013c503d0..2f984517c 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaVehicleMoveTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/world/JavaVehicleMoveTranslator.java @@ -36,7 +36,7 @@ import org.geysermc.connector.network.translators.Translator; public class JavaVehicleMoveTranslator extends PacketTranslator { @Override - public void translate(ServerVehicleMovePacket packet, GeyserSession session) { + public void translate(GeyserSession session, ServerVehicleMovePacket packet) { Entity entity = session.getRidingVehicleEntity(); if (entity == null) return; diff --git a/connector/src/main/java/org/geysermc/connector/utils/LoginEncryptionUtils.java b/connector/src/main/java/org/geysermc/connector/utils/LoginEncryptionUtils.java index d3d5fa67d..b9da1a439 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/LoginEncryptionUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/LoginEncryptionUtils.java @@ -31,6 +31,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeType; import com.github.steveice10.mc.auth.service.MsaAuthenticationService; import com.nimbusds.jose.JWSObject; +import com.nimbusds.jose.shaded.json.JSONObject; +import com.nimbusds.jose.shaded.json.JSONValue; import com.nukkitx.network.util.Preconditions; import com.nukkitx.protocol.bedrock.packet.LoginPacket; import com.nukkitx.protocol.bedrock.packet.ServerToClientHandshakePacket; @@ -49,6 +51,7 @@ import org.geysermc.cumulus.response.SimpleFormResponse; import javax.crypto.SecretKey; import java.io.IOException; +import java.net.URI; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PublicKey; @@ -62,28 +65,49 @@ public class LoginEncryptionUtils { private static boolean HAS_SENT_ENCRYPTION_MESSAGE = false; private static boolean validateChainData(JsonNode data) throws Exception { + if (data.size() != 3) { + return false; + } + ECPublicKey lastKey = null; boolean validChain = false; for (JsonNode node : data) { JWSObject jwt = JWSObject.parse(node.asText()); - if (!validChain) { - validChain = EncryptionUtils.verifyJwt(jwt, EncryptionUtils.getMojangPublicKey()); + // x509 cert is expected in every claim + URI x5u = jwt.getHeader().getX509CertURL(); + if (x5u == null) { + return false; } - if (lastKey != null) { - if (!EncryptionUtils.verifyJwt(jwt, lastKey)) return false; + ECPublicKey expectedKey = EncryptionUtils.generateKey(jwt.getHeader().getX509CertURL().toString()); + // First key is self-signed + if (lastKey == null) { + lastKey = expectedKey; + } else if (!lastKey.equals(expectedKey)) { + return false; } - JsonNode payloadNode = JSON_MAPPER.readTree(jwt.getPayload().toString()); - JsonNode ipkNode = payloadNode.get("identityPublicKey"); - Preconditions.checkState(ipkNode != null && ipkNode.getNodeType() == JsonNodeType.STRING, "identityPublicKey node is missing in chain"); - lastKey = EncryptionUtils.generateKey(ipkNode.asText()); + if (!EncryptionUtils.verifyJwt(jwt, lastKey)) { + return false; + } + + if (lastKey.equals(EncryptionUtils.getMojangPublicKey())) { + validChain = true; + } + + Object payload = JSONValue.parse(jwt.getPayload().toString()); + Preconditions.checkArgument(payload instanceof JSONObject, "Payload is not an object"); + + Object identityPublicKey = ((JSONObject) payload).get("identityPublicKey"); + Preconditions.checkArgument(identityPublicKey instanceof String, "identityPublicKey node is missing in chain"); + lastKey = EncryptionUtils.generateKey((String) identityPublicKey); } + return validChain; } - public static void encryptPlayerConnection(GeyserConnector connector, GeyserSession session, LoginPacket loginPacket) { + public static void encryptPlayerConnection(GeyserSession session, LoginPacket loginPacket) { JsonNode certData; try { certData = JSON_MAPPER.readTree(loginPacket.getChainData().toByteArray()); @@ -96,11 +120,13 @@ public class LoginEncryptionUtils { throw new RuntimeException("Certificate data is not valid"); } - encryptConnectionWithCert(connector, session, loginPacket.getSkinData().toString(), certChainData); + encryptConnectionWithCert(session, loginPacket.getSkinData().toString(), certChainData); } - private static void encryptConnectionWithCert(GeyserConnector connector, GeyserSession session, String clientData, JsonNode certChainData) { + private static void encryptConnectionWithCert(GeyserSession session, String clientData, JsonNode certChainData) { try { + GeyserConnector connector = session.getConnector(); + boolean validChain = validateChainData(certChainData); connector.getLogger().debug(String.format("Is player data valid? %s", validChain)); diff --git a/pom.xml b/pom.xml index f8ab9165f..43baad6ea 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.geysermc geyser-parent - 1.4.1-SNAPSHOT + 1.4.2-SNAPSHOT pom Geyser Allows for players from Minecraft Bedrock Edition to join Minecraft Java Edition servers.