mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-11-22 06:46:39 +01:00
Fix NPE with dimension handling in online mode
This change should be fine since all dimensions are iterated through in the registry cache
This commit is contained in:
parent
26c4c5250a
commit
4820893792
1 changed files with 4 additions and 3 deletions
|
@ -716,9 +716,10 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
|
|||
* Send all necessary packets to load Bedrock into the server
|
||||
*/
|
||||
public void connect() {
|
||||
int minY = this.dimensionType.minY();
|
||||
int maxY = this.dimensionType.maxY();
|
||||
for (JavaDimension javaDimension : this.getRegistryCache().dimensions().values()) {
|
||||
// Note: this.dimensionType may be null here if the player is connecting from online mode
|
||||
int minY = BedrockDimension.OVERWORLD.minY();
|
||||
int maxY = BedrockDimension.OVERWORLD.maxY();
|
||||
for (JavaDimension javaDimension : this.registryCache.dimensions().values()) {
|
||||
if (javaDimension.bedrockId() == BedrockDimension.OVERWORLD_ID) {
|
||||
minY = Math.min(minY, javaDimension.minY());
|
||||
maxY = Math.max(maxY, javaDimension.maxY());
|
||||
|
|
Loading…
Reference in a new issue