Hotfix leaving BE players
Dieser Commit ist enthalten in:
Ursprung
d74f08b179
Commit
dc2d6c9a89
@ -5,12 +5,16 @@ import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.events.PacketAdapter;
|
||||
import com.comphenix.protocol.events.PacketContainer;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.injector.server.TemporaryPlayer;
|
||||
import com.comphenix.protocol.reflect.StructureModifier;
|
||||
import de.steamwar.chunk.*;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class ChunkListener {
|
||||
private ChunkListener(){}
|
||||
|
||||
@ -19,10 +23,18 @@ public class ChunkListener {
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent e) {
|
||||
Player p = e.getPlayer();
|
||||
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
||||
if(!user.isBedrock())
|
||||
if(p instanceof TemporaryPlayer)
|
||||
return;
|
||||
|
||||
try{
|
||||
SteamwarUser user = SteamwarUser.get(p.getUniqueId());
|
||||
if(!user.isBedrock())
|
||||
return;
|
||||
}catch(UnsupportedOperationException ex){
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Could not get uuid", ex);
|
||||
return;
|
||||
}
|
||||
|
||||
PacketContainer packet = e.getPacket();
|
||||
StructureModifier<Boolean> fullChunk = packet.getBooleans();
|
||||
if(fullChunk.read(0))
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren