forked from GeyserMC/Geyser
Fix Floodgate players causing errors on Bukkit. (#490)
Co-authored-by: Tim203 <mctim203@gmail.com>
This commit is contained in:
parent
7195d20fae
commit
48147c2ce3
1 changed files with 8 additions and 0 deletions
|
@ -35,6 +35,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientTelepo
|
||||||
import com.github.steveice10.mc.protocol.data.game.world.block.BlockState;
|
import com.github.steveice10.mc.protocol.data.game.world.block.BlockState;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerRespawnPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.ServerRespawnPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.handshake.client.HandshakePacket;
|
import com.github.steveice10.mc.protocol.packet.handshake.client.HandshakePacket;
|
||||||
|
import com.github.steveice10.mc.protocol.packet.login.server.LoginSuccessPacket;
|
||||||
import com.github.steveice10.packetlib.Client;
|
import com.github.steveice10.packetlib.Client;
|
||||||
import com.github.steveice10.packetlib.event.session.*;
|
import com.github.steveice10.packetlib.event.session.*;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
|
@ -332,6 +333,13 @@ public class GeyserSession implements CommandSender {
|
||||||
lastDimPacket = null;
|
lastDimPacket = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Required, or else Floodgate players break with Bukkit chunk caching
|
||||||
|
if (event.getPacket() instanceof LoginSuccessPacket) {
|
||||||
|
GameProfile profile = ((LoginSuccessPacket) event.getPacket()).getProfile();
|
||||||
|
playerEntity.setUsername(profile.getName());
|
||||||
|
playerEntity.setUuid(profile.getId());
|
||||||
|
}
|
||||||
|
|
||||||
Registry.JAVA.translate(event.getPacket().getClass(), event.getPacket(), GeyserSession.this);
|
Registry.JAVA.translate(event.getPacket().getClass(), event.getPacket(), GeyserSession.this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue