Fix error on sponge servers trying to update players

This commit is contained in:
Lukas Rieger (Blue) 2023-01-01 12:54:37 +01:00
parent e659eb63aa
commit b80088671b
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
2 changed files with 7 additions and 7 deletions

View File

@ -36,7 +36,6 @@
import org.spongepowered.api.entity.living.player.gamemode.GameMode; import org.spongepowered.api.entity.living.player.gamemode.GameMode;
import org.spongepowered.api.entity.living.player.gamemode.GameModes; import org.spongepowered.api.entity.living.player.gamemode.GameModes;
import org.spongepowered.api.entity.living.player.server.ServerPlayer; import org.spongepowered.api.entity.living.player.server.ServerPlayer;
import org.spongepowered.api.world.LightTypes;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
@ -160,8 +159,9 @@ public void update() {
this.rotation = SpongePlugin.fromSpongePoweredVector(player.rotation()); this.rotation = SpongePlugin.fromSpongePoweredVector(player.rotation());
this.sneaking = player.get(Keys.IS_SNEAKING).orElse(false); this.sneaking = player.get(Keys.IS_SNEAKING).orElse(false);
this.skyLight = player.world().light(LightTypes.SKY, player.blockPosition()); // not implemented in sponge
this.blockLight = player.world().light(LightTypes.BLOCK, player.blockPosition()); this.skyLight = 15; //player.world().light(LightTypes.SKY, player.blockPosition());
this.blockLight = 0; //player.world().light(LightTypes.BLOCK, player.blockPosition());
try { try {
var world = SpongePlugin.getInstance().getWorld(player.world()); var world = SpongePlugin.getInstance().getWorld(player.world());

View File

@ -25,9 +25,9 @@
package de.bluecolored.bluemap.sponge; package de.bluecolored.bluemap.sponge;
import com.flowpowered.math.vector.Vector3d; import com.flowpowered.math.vector.Vector3d;
import de.bluecolored.bluemap.common.plugin.text.Text;
import de.bluecolored.bluemap.common.serverinterface.Gamemode; import de.bluecolored.bluemap.common.serverinterface.Gamemode;
import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.serverinterface.Player;
import de.bluecolored.bluemap.common.plugin.text.Text;
import org.spongepowered.api.Sponge; import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.Keys; import org.spongepowered.api.data.Keys;
import org.spongepowered.api.effect.VanishState; import org.spongepowered.api.effect.VanishState;
@ -36,7 +36,6 @@
import org.spongepowered.api.entity.living.player.gamemode.GameMode; import org.spongepowered.api.entity.living.player.gamemode.GameMode;
import org.spongepowered.api.entity.living.player.gamemode.GameModes; import org.spongepowered.api.entity.living.player.gamemode.GameModes;
import org.spongepowered.api.entity.living.player.server.ServerPlayer; import org.spongepowered.api.entity.living.player.server.ServerPlayer;
import org.spongepowered.api.world.LightTypes;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
@ -159,8 +158,9 @@ public void update() {
this.rotation = SpongePlugin.fromSpongePoweredVector(player.rotation()); this.rotation = SpongePlugin.fromSpongePoweredVector(player.rotation());
this.sneaking = player.get(Keys.IS_SNEAKING).orElse(false); this.sneaking = player.get(Keys.IS_SNEAKING).orElse(false);
this.skyLight = player.world().light(LightTypes.SKY, player.blockPosition()); // not implemented in sponge
this.blockLight = player.world().light(LightTypes.BLOCK, player.blockPosition()); this.skyLight = 15; //player.world().light(LightTypes.SKY, player.blockPosition());
this.blockLight = 0; //player.world().light(LightTypes.BLOCK, player.blockPosition());
try { try {
var world = SpongePlugin.getInstance().getWorld(player.world()); var world = SpongePlugin.getInstance().getWorld(player.world());