Removed unused variable

This commit is contained in:
RaphiMC 2023-03-29 23:43:06 +02:00
parent 5befe8802b
commit cb89d3a413
3 changed files with 8 additions and 9 deletions

View File

@ -28,7 +28,6 @@ import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.IntTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.Protocol1_17To1_16_4;
import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.types.Chunk1_17Type;
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.model.ClassicLevel;
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicWorldHeightProvider;
@ -41,7 +40,7 @@ import java.util.List;
public class ClassicWorldHeightInjection {
public static PacketHandler handleJoinGame(final Protocol1_17To1_16_4 protocol, final PacketHandler parentHandler) {
public static PacketHandler handleJoinGame(final PacketHandler parentHandler) {
return wrapper -> {
parentHandler.handle(wrapper);
if (wrapper.isCancelled()) return;
@ -55,7 +54,7 @@ public class ClassicWorldHeightInjection {
};
}
public static PacketHandler handleRespawn(final Protocol1_17To1_16_4 protocol, final PacketHandler parentHandler) {
public static PacketHandler handleRespawn(final PacketHandler parentHandler) {
return wrapper -> {
parentHandler.handle(wrapper);
if (wrapper.isCancelled()) return;
@ -66,7 +65,7 @@ public class ClassicWorldHeightInjection {
};
}
public static PacketHandler handleChunkData(final Protocol1_17To1_16_4 protocol, final PacketHandler parentHandler) {
public static PacketHandler handleChunkData(final PacketHandler parentHandler) {
return wrapper -> {
parentHandler.handle(wrapper);
if (wrapper.isCancelled()) return;
@ -101,7 +100,7 @@ public class ClassicWorldHeightInjection {
};
}
public static PacketHandler handleUpdateLight(final Protocol1_17To1_16_4 protocol, final PacketHandler parentHandler) {
public static PacketHandler handleUpdateLight(final PacketHandler parentHandler) {
final PacketHandler classicLightHandler = new PacketHandlers() {
@Override
public void register() {

View File

@ -33,8 +33,8 @@ public abstract class MixinEntityPackets1_17 {
@Redirect(method = "registerPackets", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/protocols/protocol1_17to1_16_4/Protocol1_17To1_16_4;registerClientbound(Lcom/viaversion/viaversion/api/protocol/packet/ClientboundPacketType;Lcom/viaversion/viaversion/api/protocol/remapper/PacketHandler;)V"))
private void handleClassicWorldHeight(Protocol1_17To1_16_4 instance, ClientboundPacketType packetType, PacketHandler packetHandler) {
if (packetType == ClientboundPackets1_16_2.JOIN_GAME) packetHandler = ClassicWorldHeightInjection.handleJoinGame(instance, packetHandler);
if (packetType == ClientboundPackets1_16_2.RESPAWN) packetHandler = ClassicWorldHeightInjection.handleRespawn(instance, packetHandler);
if (packetType == ClientboundPackets1_16_2.JOIN_GAME) packetHandler = ClassicWorldHeightInjection.handleJoinGame(packetHandler);
if (packetType == ClientboundPackets1_16_2.RESPAWN) packetHandler = ClassicWorldHeightInjection.handleRespawn(packetHandler);
((Protocol) instance).registerClientbound(packetType, packetHandler);
}

View File

@ -33,8 +33,8 @@ public abstract class MixinWorldPackets1_17 {
@Redirect(method = "register", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/protocols/protocol1_17to1_16_4/Protocol1_17To1_16_4;registerClientbound(Lcom/viaversion/viaversion/api/protocol/packet/ClientboundPacketType;Lcom/viaversion/viaversion/api/protocol/remapper/PacketHandler;)V"))
private static void handleClassicWorldHeight(Protocol1_17To1_16_4 instance, ClientboundPacketType packetType, PacketHandler packetHandler) {
if (packetType == ClientboundPackets1_16_2.CHUNK_DATA) packetHandler = ClassicWorldHeightInjection.handleChunkData(instance, packetHandler);
if (packetType == ClientboundPackets1_16_2.UPDATE_LIGHT) packetHandler = ClassicWorldHeightInjection.handleUpdateLight(instance, packetHandler);
if (packetType == ClientboundPackets1_16_2.CHUNK_DATA) packetHandler = ClassicWorldHeightInjection.handleChunkData(packetHandler);
if (packetType == ClientboundPackets1_16_2.UPDATE_LIGHT) packetHandler = ClassicWorldHeightInjection.handleUpdateLight(packetHandler);
((Protocol) instance).registerClientbound(packetType, packetHandler);
}