why mojang? why?
This commit is contained in:
parent
562f9ea3e4
commit
1eb2af6443
7 changed files with 8 additions and 45 deletions
BIN
logs/2023-04-28-1.log.gz
Normal file
BIN
logs/2023-04-28-1.log.gz
Normal file
Binary file not shown.
BIN
logs/2023-04-28-2.log.gz
Normal file
BIN
logs/2023-04-28-2.log.gz
Normal file
Binary file not shown.
BIN
logs/2023-04-28-3.log.gz
Normal file
BIN
logs/2023-04-28-3.log.gz
Normal file
Binary file not shown.
BIN
logs/2023-04-28-4.log.gz
Normal file
BIN
logs/2023-04-28-4.log.gz
Normal file
Binary file not shown.
|
@ -1,12 +1,7 @@
|
|||
package net.artelnatif.nicko;
|
||||
|
||||
import com.comphenix.protocol.PacketType;
|
||||
import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.ProtocolManager;
|
||||
import com.comphenix.protocol.events.ListenerPriority;
|
||||
import com.comphenix.protocol.events.PacketAdapter;
|
||||
import com.comphenix.protocol.events.PacketContainer;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import net.artelnatif.nicko.command.NickoCommand;
|
||||
import net.artelnatif.nicko.config.Configuration;
|
||||
import net.artelnatif.nicko.config.ConfigurationManager;
|
||||
|
@ -20,7 +15,6 @@ import net.artelnatif.nicko.mojang.MojangAPI;
|
|||
import net.artelnatif.nicko.placeholder.PlaceHolderHook;
|
||||
import net.artelnatif.nicko.storage.PlayerDataStore;
|
||||
import net.artelnatif.nicko.storage.name.PlayerNameStore;
|
||||
import net.artelnatif.nicko.wrapper.WrapperPlayServerRespawn;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
|
@ -110,35 +104,6 @@ public class NickoBukkit extends JavaPlugin {
|
|||
getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new PlayerQuitListener(), this);
|
||||
|
||||
// For debug purposes
|
||||
protocolManager.addPacketListener(new PacketAdapter(
|
||||
this,
|
||||
ListenerPriority.NORMAL,
|
||||
PacketType.Play.Server.RESPAWN) {
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPacketSending(PacketEvent event) {
|
||||
final PacketContainer packet = event.getPacket();
|
||||
final WrapperPlayServerRespawn respawn = new WrapperPlayServerRespawn(packet);
|
||||
getLogger().info(respawn.getDimension().getName());
|
||||
getLogger().info(String.valueOf(respawn.isCopyMetadata()));
|
||||
getLogger().info(String.valueOf(respawn.getSeed()));
|
||||
getLogger().info(String.valueOf(respawn.getLastDeathLocation().isPresent()));
|
||||
/**
|
||||
* packet.getStructures().getFields().forEach(fieldAccessor -> {
|
||||
* final Field field = fieldAccessor.getField();
|
||||
* getLogger().info("field=[" +
|
||||
* "name=" + field.getName() + "," +
|
||||
* "type=" + field.getType().getSimpleName() +
|
||||
* "]");
|
||||
* });
|
||||
*/
|
||||
}
|
||||
});
|
||||
|
||||
getLogger().info("Nicko (Bukkit) has been enabled.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,16 +142,15 @@ public class AppearanceManager {
|
|||
|
||||
final World world = player.getWorld();
|
||||
final WrapperPlayServerRespawn respawn = new WrapperPlayServerRespawn();
|
||||
respawn.setDimension(world);
|
||||
respawn.setSeed(world.getSeed());
|
||||
respawn.setGameMode(player.getGameMode());
|
||||
respawn.setPreviousGameMode(player.getGameMode());
|
||||
respawn.setDifficulty(world.getDifficulty());
|
||||
respawn.setDimension(world);
|
||||
respawn.setSeed(world.getSeed());
|
||||
respawn.setLastDeathLocation(player.getLocation());
|
||||
respawn.setCopyMetadata(false);
|
||||
respawn.getHandle().getBooleans().write(0, false); // is debug
|
||||
respawn.getHandle().getBooleans().write(1, false); // is flat
|
||||
respawn.sendPacket(player);
|
||||
respawn.broadcastPacket();
|
||||
/*final EntityPlayer cp = ((CraftPlayer) player).getHandle();
|
||||
final PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(cp.cG().Z(), cp.P(), player.getWorld().getSeed(), EnumGamemode.a, EnumGamemode.a, true, true, (byte) 0x00, Optional.empty());
|
||||
cp.b.a(respawn);*/
|
||||
|
|
|
@ -26,8 +26,6 @@ public class WrapperPlayServerRespawn extends AbstractPacket {
|
|||
handle.getModifier().writeDefaults();
|
||||
}
|
||||
|
||||
public WrapperPlayServerRespawn(PacketContainer container) { super(container, TYPE); }
|
||||
|
||||
//.............
|
||||
// Dimension Field (1.8 - Present)
|
||||
// The dimension field has changed numerous times:
|
||||
|
@ -62,8 +60,8 @@ public class WrapperPlayServerRespawn extends AbstractPacket {
|
|||
// GameMode Field
|
||||
//.............
|
||||
|
||||
public void getGameMode() {
|
||||
handle.getGameModes().read(0);
|
||||
public GameMode getGameMode() {
|
||||
return handle.getGameModes().read(0).toBukkit();
|
||||
}
|
||||
|
||||
public void setGameMode(GameMode value) {
|
||||
|
@ -74,8 +72,8 @@ public class WrapperPlayServerRespawn extends AbstractPacket {
|
|||
// Previous GameMode Field
|
||||
//.............
|
||||
|
||||
public void getPreviousGameMode() {
|
||||
handle.getGameModes().read(1);
|
||||
public GameMode getPreviousGameMode() {
|
||||
return handle.getGameModes().read(1).toBukkit();
|
||||
}
|
||||
|
||||
public void setPreviousGameMode(GameMode value) {
|
||||
|
@ -97,6 +95,7 @@ public class WrapperPlayServerRespawn extends AbstractPacket {
|
|||
//.............
|
||||
// Last death location Field
|
||||
// Added in 1.19.
|
||||
// (useless?)
|
||||
//.............
|
||||
|
||||
public Optional<BlockPosition> getLastDeathLocation() {
|
||||
|
|
Loading…
Reference in a new issue