From 4b98412388e2e5e5e6a463a39c816e4914d14c52 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Tue, 24 Oct 2023 21:29:06 +0200 Subject: [PATCH] Even more dummy classes --- settings.gradle | 4 ++-- .../viaforge/common/ViaForgeCommon.java | 2 +- .../common/protocolhack/ViaForgeVLLoader.java | 10 ++-------- .../{ => netty}/ViaForgeVLLegacyPipeline.java | 2 +- .../provider/DummyMovementTransmitter.java | 12 ++++++++++++ 5 files changed, 18 insertions(+), 12 deletions(-) rename src/main/java/de/florianmichael/viaforge/common/protocolhack/{ => netty}/ViaForgeVLLegacyPipeline.java (96%) create mode 100644 src/main/java/de/florianmichael/viaforge/common/protocolhack/provider/DummyMovementTransmitter.java diff --git a/settings.gradle b/settings.gradle index 193a6eb..478369d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -19,11 +19,11 @@ pluginManagement { rootProject.name = "ViaForge" include "viaforge-mc112" +include "viaforge-mc114" +include "viaforge-mc115" include "viaforge-mc116" include "viaforge-mc117" include "viaforge-mc118" include "viaforge-mc119" include "viaforge-mc120" -include "viaforge-mc115" -include "viaforge-mc114" diff --git a/src/main/java/de/florianmichael/viaforge/common/ViaForgeCommon.java b/src/main/java/de/florianmichael/viaforge/common/ViaForgeCommon.java index 287f31a..71876fe 100644 --- a/src/main/java/de/florianmichael/viaforge/common/ViaForgeCommon.java +++ b/src/main/java/de/florianmichael/viaforge/common/ViaForgeCommon.java @@ -23,7 +23,7 @@ import com.viaversion.viaversion.protocol.ProtocolPipelineImpl; import de.florianmichael.viaforge.common.platform.VFPlatform; import de.florianmichael.viaforge.common.platform.ViaForgeConfig; import de.florianmichael.viaforge.common.protocolhack.ViaForgeVLInjector; -import de.florianmichael.viaforge.common.protocolhack.ViaForgeVLLegacyPipeline; +import de.florianmichael.viaforge.common.protocolhack.netty.ViaForgeVLLegacyPipeline; import de.florianmichael.viaforge.common.protocolhack.ViaForgeVLLoader; import io.netty.channel.Channel; import io.netty.channel.socket.SocketChannel; diff --git a/src/main/java/de/florianmichael/viaforge/common/protocolhack/ViaForgeVLLoader.java b/src/main/java/de/florianmichael/viaforge/common/protocolhack/ViaForgeVLLoader.java index 554a355..2826e17 100644 --- a/src/main/java/de/florianmichael/viaforge/common/protocolhack/ViaForgeVLLoader.java +++ b/src/main/java/de/florianmichael/viaforge/common/protocolhack/ViaForgeVLLoader.java @@ -18,10 +18,10 @@ package de.florianmichael.viaforge.common.protocolhack; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.platform.providers.ViaProviders; import com.viaversion.viaversion.api.protocol.version.VersionProvider; import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider; +import de.florianmichael.viaforge.common.protocolhack.provider.DummyMovementTransmitter; import de.florianmichael.viaforge.common.protocolhack.provider.ViaForgeVersionProvider; import net.raphimc.vialoader.impl.viaversion.VLLoader; @@ -34,12 +34,6 @@ public class ViaForgeVLLoader extends VLLoader { final ViaProviders providers = Via.getManager().getProviders(); providers.use(VersionProvider.class, new ViaForgeVersionProvider()); - providers.use(MovementTransmitterProvider.class, new MovementTransmitterProvider() { - - @Override - public void sendPlayer(UserConnection userConnection) { - // We are on the client side, so we can handle the idle packet properly - } - }); + providers.use(MovementTransmitterProvider.class, new DummyMovementTransmitter()); } } diff --git a/src/main/java/de/florianmichael/viaforge/common/protocolhack/ViaForgeVLLegacyPipeline.java b/src/main/java/de/florianmichael/viaforge/common/protocolhack/netty/ViaForgeVLLegacyPipeline.java similarity index 96% rename from src/main/java/de/florianmichael/viaforge/common/protocolhack/ViaForgeVLLegacyPipeline.java rename to src/main/java/de/florianmichael/viaforge/common/protocolhack/netty/ViaForgeVLLegacyPipeline.java index 50776ae..ea0427f 100644 --- a/src/main/java/de/florianmichael/viaforge/common/protocolhack/ViaForgeVLLegacyPipeline.java +++ b/src/main/java/de/florianmichael/viaforge/common/protocolhack/netty/ViaForgeVLLegacyPipeline.java @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package de.florianmichael.viaforge.common.protocolhack; +package de.florianmichael.viaforge.common.protocolhack.netty; import com.viaversion.viaversion.api.connection.UserConnection; import net.raphimc.vialoader.netty.VLLegacyPipeline; diff --git a/src/main/java/de/florianmichael/viaforge/common/protocolhack/provider/DummyMovementTransmitter.java b/src/main/java/de/florianmichael/viaforge/common/protocolhack/provider/DummyMovementTransmitter.java new file mode 100644 index 0000000..e4e046e --- /dev/null +++ b/src/main/java/de/florianmichael/viaforge/common/protocolhack/provider/DummyMovementTransmitter.java @@ -0,0 +1,12 @@ +package de.florianmichael.viaforge.common.protocolhack.provider; + +import com.viaversion.viaversion.api.connection.UserConnection; +import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider; + +public class DummyMovementTransmitter extends MovementTransmitterProvider { + + @Override + public void sendPlayer(UserConnection userConnection) { + // We are on the client side, so we can handle the idle packet properly + } +}