diff --git a/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/editions/bedrock/handlers/BedrockEditionUpstreamPacketHandler.java b/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/editions/bedrock/handlers/BedrockEditionUpstreamPacketHandler.java
index 4ded3fe..f305ed0 100644
--- a/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/editions/bedrock/handlers/BedrockEditionUpstreamPacketHandler.java
+++ b/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/editions/bedrock/handlers/BedrockEditionUpstreamPacketHandler.java
@@ -28,7 +28,163 @@
import au.com.grieve.reversion.editions.bedrock.BedrockReversionSession;
import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.BedrockPacket;
import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.handler.BedrockPacketHandler;
-import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.*;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AddBehaviorTreePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AddEntityPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AddHangingEntityPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AddItemEntityPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AddPaintingPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AddPlayerPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AdventureSettingsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AnimateEntityPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AnimatePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AnvilDamagePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AutomationClientConnectPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AvailableCommandsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.AvailableEntityIdentifiersPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.BiomeDefinitionListPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.BlockEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.BlockPickRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.BookEditPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.BossEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CameraPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CameraShakePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ChangeDimensionPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ChunkRadiusUpdatedPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ClientCacheBlobStatusPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ClientCacheMissResponsePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ClientCacheStatusPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ClientToServerHandshakePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ClientboundMapItemDataPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CodeBuilderPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CommandBlockUpdatePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CommandOutputPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CommandRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CompletedUsingItemPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ContainerClosePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ContainerOpenPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ContainerSetDataPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CorrectPlayerMovePredictionPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CraftingDataPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CraftingEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.CreativeContentPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.DebugInfoPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.DisconnectPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.EducationSettingsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.EmoteListPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.EmotePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.EntityEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.EntityFallPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.EntityPickRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.EventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ExplodePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.GameRulesChangedPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.GuiDataPickItemPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.HurtArmorPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.InteractPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.InventoryContentPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.InventorySlotPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.InventoryTransactionPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ItemComponentPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ItemFrameDropItemPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ItemStackRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ItemStackResponsePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LabTablePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LecternUpdatePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LevelChunkPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LevelEventGenericPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LevelEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LevelSoundEvent1Packet;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LevelSoundEvent2Packet;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LevelSoundEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.LoginPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MapCreateLockedCopyPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MapInfoRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MobArmorEquipmentPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MobEffectPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MobEquipmentPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ModalFormRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ModalFormResponsePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MotionPredictionHintsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MoveEntityAbsolutePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MoveEntityDeltaPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MovePlayerPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.MultiplayerSettingsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.NetworkChunkPublisherUpdatePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.NetworkSettingsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.NetworkStackLatencyPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.NpcRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.OnScreenTextureAnimationPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PacketViolationWarningPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PhotoTransferPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlaySoundPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerActionPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerArmorDamagePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerAuthInputPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerEnchantOptionsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerFogPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerHotbarPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerInputPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerListPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PlayerSkinPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PositionTrackingDBClientRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PositionTrackingDBServerBroadcastPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.PurchaseReceiptPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.RemoveEntityPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.RemoveObjectivePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.RequestChunkRadiusPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ResourcePackChunkDataPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ResourcePackChunkRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ResourcePackClientResponsePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ResourcePackDataInfoPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ResourcePackStackPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.RespawnPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.RiderJumpPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ScriptCustomEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ServerSettingsRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ServerSettingsResponsePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetCommandsEnabledPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetDefaultGameTypePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetDifficultyPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetDisplayObjectivePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetEntityDataPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetEntityLinkPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetEntityMotionPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetHealthPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetLastHurtByPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetLocalPlayerAsInitializedPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetPlayerGameTypePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetScorePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetScoreboardIdentityPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetSpawnPositionPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetTimePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SetTitlePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SettingsCommandPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ShowCreditsPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ShowProfilePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.ShowStoreOfferPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SimpleEventPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SpawnExperienceOrbPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SpawnParticleEffectPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.StartGamePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.StopSoundPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.StructureBlockUpdatePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.StructureTemplateDataRequestPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.StructureTemplateDataResponsePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.SubClientLoginPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.TakeItemEntityPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.TextPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.TickSyncPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.TransferPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdateBlockPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdateBlockPropertiesPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdateBlockSyncedPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdateEquipPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdatePlayerGameTypePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdateSoftEnumPacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.UpdateTradePacket;
+import au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.packet.VideoStreamConnectPacket;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import lombok.Getter;
@@ -52,7 +208,7 @@ public boolean handlePacket(BedrockPacket original) {
ByteBuf buffer = ByteBufAllocator.DEFAULT.ioBuffer();
facadeSession.getTranslatedCodec().tryEncode(buffer, original, serverSession);
- com.nukkitx.protocol.bedrock.BedrockPacket translated = facadeSession.getOriginalCodec().tryDecode(buffer, facadeSession.getTranslatedCodec().getId(original.getClass()));
+ com.nukkitx.protocol.bedrock.BedrockPacket translated = facadeSession.getOriginalCodec().tryDecode(buffer, facadeSession.getTranslatedCodec().getId(original.getClass()), facadeSession);
buffer.release();
diff --git a/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/server/GeyserServerSession.java b/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/server/GeyserServerSession.java
index 2fdd4c1..7c2f5f0 100644
--- a/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/server/GeyserServerSession.java
+++ b/geyser-reversion/src/main/java/au/com/grieve/geyser/reversion/server/GeyserServerSession.java
@@ -39,6 +39,7 @@
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.crypto.SecretKey;
+import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.util.Arrays;
import java.util.Collection;
@@ -52,6 +53,8 @@ public class GeyserServerSession extends BedrockServerSession {
BedrockPacketCodec originalCodec;
au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.BedrockPacketCodec translatedCodec;
+ private Method tryEncode;
+
public GeyserServerSession(BedrockReversionSession reversionSession) {
super(null, null, null);
@@ -69,7 +72,7 @@ public void sendPacket(BedrockPacket original) {
// Isolate Reversion protocol from Geyser Protocol in case there are overlapping differences
ByteBuf buffer = ByteBufAllocator.DEFAULT.ioBuffer();
- originalCodec.tryEncode(buffer, original);
+ originalCodec.tryEncode(buffer, original, this);
au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.BedrockPacket translated = translatedCodec.tryDecode(buffer, BedrockProtocol.DEFAULT_BEDROCK_CODEC.getId(original.getClass()), reversionSession);
buffer.release();
reversionSession.sendPacket(translated);
@@ -80,7 +83,7 @@ public void sendPacketImmediately(BedrockPacket original) {
// Isolate Reversion protocol from Geyser Protocol in case there are overlapping differences
ByteBuf buffer = ByteBufAllocator.DEFAULT.ioBuffer();
- originalCodec.tryEncode(buffer, original);
+ originalCodec.tryEncode(buffer, original, this);
au.com.grieve.reversion.shaded.nukkitx.protocol.bedrock.BedrockPacket translated = translatedCodec.tryDecode(buffer, BedrockProtocol.DEFAULT_BEDROCK_CODEC.getId(original.getClass()), reversionSession);
buffer.release();
diff --git a/pom.xml b/pom.xml
index 01a4a0e..e0a226f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,7 +44,7 @@
1.8
1.8
UTF-8
- 1.0.22
+ 1.0.23