Removed useless things 0 idea

This commit is contained in:
ImHacking 2022-07-05 15:30:43 -04:00
parent c648da98b7
commit dbbd6c3f3c
3 changed files with 3 additions and 46 deletions

View File

@ -50,7 +50,8 @@ public class eSpigot {
}
public void addPacketHandler(PacketHandler handler) {
Bukkit.getLogger().info("Adding packet handler: " + handler.getClass().getPackage().getName() + "." + handler.getClass().getSimpleName());
Bukkit.getLogger().info("Adding packet handler: " + handler.getClass().getPackage().getName() + "." + handler.getClass().getSimpleName() +
" (Cancellable: " + handler.handlesCancellable() + ")");
if (handler.handlesCancellable()) this.cancellablePacketHandlers.add(handler);
this.packetHandlers.add(handler);
}

View File

@ -164,9 +164,9 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
if (this.channel.isOpen()) {
try {
packet.a(this.m);
if (this.m instanceof PlayerConnection) {
//ImHacking Start
for (PacketHandler handler : eSpigot.getInstance().getCancellablePacketHandlers()) {
try {
if (!handler.handleReceivedPacketCancellable((PlayerConnection) this.m, packet)) {
@ -193,7 +193,6 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
public void a(PacketListener packetlistener) {
Validate.notNull(packetlistener, "packetListener");
// NetworkManager.g.debug("Set listener of {} to {}", new Object[] { this, packetlistener});
this.m = packetlistener;
}
@ -404,14 +403,6 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
return this.channel instanceof LocalChannel || this.channel instanceof LocalServerChannel;
}
// Paper start
/*
public void setEncryptionKey(SecretKey secretkey) {
this.o = true;
this.channel.pipeline().addBefore("splitter", "decrypt", new PacketDecrypter(MinecraftEncryption.a(2, secretkey)));
this.channel.pipeline().addBefore("prepender", "encrypt", new PacketEncrypter(MinecraftEncryption.a(1, secretkey)));
}*/
public void setupEncryption(javax.crypto.SecretKey key) throws CryptException {
if (!this.encrypted) { // Nacho - deobfuscate encrypted
try {

View File

@ -867,33 +867,6 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
if (entity != null) {
this.player.setSpectatorTarget(this.player);
this.player.mount(null);
/* CraftBukkit start - replace with bukkit handling for multi-world
if (entity.world != this.player.world) {
WorldServer worldserver1 = this.player.u();
WorldServer worldserver2 = (WorldServer) entity.world;
this.player.dimension = entity.dimension;
this.sendPacket(new PacketPlayOutRespawn(this.player.dimension, worldserver1.getDifficulty(), worldserver1.getWorldData().getType(), this.player.playerInteractManager.getGameMode()));
worldserver1.removeEntity(this.player);
this.player.dead = false;
this.player.setPositionRotation(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch);
if (this.player.isAlive()) {
worldserver1.entityJoinedWorld(this.player, false);
worldserver2.addEntity(this.player);
worldserver2.entityJoinedWorld(this.player, false);
}
this.player.spawnIn(worldserver2);
this.minecraftServer.getPlayerList().a(this.player, worldserver1);
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
this.player.playerInteractManager.a(worldserver2);
this.minecraftServer.getPlayerList().b(this.player, worldserver2);
this.minecraftServer.getPlayerList().updateClient(this.player);
} else {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
}
*/
this.player.getBukkitEntity().teleport(entity.getBukkitEntity(), PlayerTeleportEvent.TeleportCause.SPECTATE);
// CraftBukkit end
}
@ -922,14 +895,6 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
// CraftBukkit end
PlayerConnection.c.info(this.player.getName() + " lost connection: " + ichatbasecomponent.c()); // CraftBukkit: Don't toString(). // PAIL: Rename
// CraftBukkit start - Replace vanilla quit message handling with our own.
/*
this.minecraftServer.aH();
ChatMessage chatmessage = new ChatMessage("multiplayer.player.left", new Object[] { this.player.getScoreboardDisplayName()});
chatmessage.getChatModifier().setColor(EnumChatFormat.YELLOW);
this.minecraftServer.getPlayerList().sendMessage(chatmessage);
*/
this.player.q();
String quitMessage = this.minecraftServer.getPlayerList().disconnect(this.player);
if ((quitMessage != null) && (quitMessage.length() > 0)) {