updated class names

This commit is contained in:
FlorianMichael 2021-09-10 18:30:38 +02:00
parent 98ea2cbbf9
commit 075fc88215
10 changed files with 31 additions and 32 deletions

View File

@ -4,10 +4,10 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.viaversion.viaversion.ViaManagerImpl; import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.data.MappingDataLoader;
import de.enzaxd.viaforge.loader.VRBackwardsLoader; import de.enzaxd.viaforge.loader.BackwardsLoader;
import de.enzaxd.viaforge.loader.VRProviderLoader; import de.enzaxd.viaforge.platform.Injector;
import de.enzaxd.viaforge.platform.VRInjector; import de.enzaxd.viaforge.platform.Platform;
import de.enzaxd.viaforge.platform.VRPlatform; import de.enzaxd.viaforge.platform.ProviderLoader;
import de.enzaxd.viaforge.util.JLoggerToLog4j; import de.enzaxd.viaforge.util.JLoggerToLog4j;
import io.netty.channel.DefaultEventLoopGroup; import io.netty.channel.DefaultEventLoopGroup;
import io.netty.channel.EventLoop; import io.netty.channel.EventLoop;
@ -51,16 +51,16 @@ public class ViaForge {
Via.init( Via.init(
ViaManagerImpl.builder() ViaManagerImpl.builder()
.injector(new VRInjector()) .injector(new Injector())
.loader(new VRProviderLoader()) .loader(new ProviderLoader())
.platform(new VRPlatform(file)) .platform(new Platform(file))
.build() .build()
); );
MappingDataLoader.enableMappingsCache(); MappingDataLoader.enableMappingsCache();
((ViaManagerImpl) Via.getManager()).init(); ((ViaManagerImpl) Via.getManager()).init();
new VRBackwardsLoader(file); new BackwardsLoader(file);
initFuture.complete(null); initFuture.complete(null);
} }

View File

@ -13,12 +13,12 @@ import java.lang.reflect.InvocationTargetException;
import java.util.List; import java.util.List;
@ChannelHandler.Sharable @ChannelHandler.Sharable
public class VRDecodeHandler extends MessageToMessageDecoder<ByteBuf> { public class DecodeHandler extends MessageToMessageDecoder<ByteBuf> {
private final UserConnection info; private final UserConnection info;
private boolean handledCompression; private boolean handledCompression;
private boolean skipDoubleTransform; private boolean skipDoubleTransform;
public VRDecodeHandler(UserConnection info) { public DecodeHandler(UserConnection info) {
this.info = info; this.info = info;
} }

View File

@ -13,11 +13,11 @@ import java.lang.reflect.InvocationTargetException;
import java.util.List; import java.util.List;
@ChannelHandler.Sharable @ChannelHandler.Sharable
public class VREncodeHandler extends MessageToMessageEncoder<ByteBuf> { public class EncodeHandler extends MessageToMessageEncoder<ByteBuf> {
private final UserConnection info; private final UserConnection info;
private boolean handledCompression; private boolean handledCompression;
public VREncodeHandler(UserConnection info) { public EncodeHandler(UserConnection info) {
this.info = info; this.info = info;
} }

View File

@ -5,8 +5,8 @@ import com.viaversion.viaversion.connection.UserConnectionImpl;
import com.viaversion.viaversion.protocol.ProtocolPipelineImpl; import com.viaversion.viaversion.protocol.ProtocolPipelineImpl;
import de.enzaxd.viaforge.ViaForge; import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.handler.CommonTransformer; import de.enzaxd.viaforge.handler.CommonTransformer;
import de.enzaxd.viaforge.handler.VRDecodeHandler; import de.enzaxd.viaforge.handler.DecodeHandler;
import de.enzaxd.viaforge.handler.VREncodeHandler; import de.enzaxd.viaforge.handler.EncodeHandler;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@ -25,8 +25,8 @@ public abstract class MixinNetworkManagerChInit {
new ProtocolPipelineImpl(user); new ProtocolPipelineImpl(user);
channel.pipeline() channel.pipeline()
.addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new VREncodeHandler(user)) .addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new EncodeHandler(user))
.addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new VRDecodeHandler(user)); .addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new DecodeHandler(user));
} }
} }
} }

View File

@ -6,10 +6,10 @@ import de.enzaxd.viaforge.ViaForge;
import java.io.File; import java.io.File;
import java.util.logging.Logger; import java.util.logging.Logger;
public class VRBackwardsLoader implements ViaBackwardsPlatform { public class BackwardsLoader implements ViaBackwardsPlatform {
private final File file; private final File file;
public VRBackwardsLoader(final File file) { public BackwardsLoader(final File file) {
this.init(this.file = new File(file, "ViaBackwards")); this.init(this.file = new File(file, "ViaBackwards"));
} }

View File

@ -5,7 +5,7 @@ import com.viaversion.viaversion.libs.gson.JsonObject;
import de.enzaxd.viaforge.ViaForge; import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.handler.CommonTransformer; import de.enzaxd.viaforge.handler.CommonTransformer;
public class VRInjector implements ViaInjector { public class Injector implements ViaInjector {
@Override @Override
public void inject() { public void inject() {

View File

@ -1,6 +1,5 @@
package de.enzaxd.viaforge.platform; package de.enzaxd.viaforge.platform;
import com.viaversion.viaversion.api.ViaAPI;
import com.viaversion.viaversion.api.command.ViaCommandSender; import com.viaversion.viaversion.api.command.ViaCommandSender;
import com.viaversion.viaversion.api.configuration.ConfigurationProvider; import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig; import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
@ -24,19 +23,19 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.logging.Logger; import java.util.logging.Logger;
public class VRPlatform implements ViaPlatform<UUID> { public class Platform implements ViaPlatform<UUID> {
private final Logger logger = new JLoggerToLog4j(LogManager.getLogger("ViaVersion")); private final Logger logger = new JLoggerToLog4j(LogManager.getLogger("ViaVersion"));
private final VRViaConfig config; private final ViaConfig config;
private final File dataFolder; private final File dataFolder;
private final ViaAPI<UUID> api; private final com.viaversion.viaversion.api.ViaAPI api;
public VRPlatform(File dataFolder) { public Platform(File dataFolder) {
Path configDir = dataFolder.toPath().resolve("ViaVersion"); Path configDir = dataFolder.toPath().resolve("ViaVersion");
config = new VRViaConfig(configDir.resolve("viaversion.yml").toFile()); config = new ViaConfig(configDir.resolve("viaversion.yml").toFile());
this.dataFolder = configDir.toFile(); this.dataFolder = configDir.toFile();
api = new VRViaAPI(); api = new ViaAPI();
} }
public static String legacyToJson(String legacy) { public static String legacyToJson(String legacy) {
@ -125,7 +124,7 @@ public class VRPlatform implements ViaPlatform<UUID> {
} }
@Override @Override
public ViaAPI<UUID> getApi() { public com.viaversion.viaversion.api.ViaAPI getApi() {
return api; return api;
} }

View File

@ -1,4 +1,4 @@
package de.enzaxd.viaforge.loader; package de.enzaxd.viaforge.platform;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
@ -9,7 +9,7 @@ import com.viaversion.viaversion.protocols.base.BaseVersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider; import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
import de.enzaxd.viaforge.ViaForge; import de.enzaxd.viaforge.ViaForge;
public class VRProviderLoader implements ViaPlatformLoader { public class ProviderLoader implements ViaPlatformLoader {
@Override @Override
public void load() { public void load() {

View File

@ -4,5 +4,5 @@ import com.viaversion.viaversion.ViaAPIBase;
import java.util.UUID; import java.util.UUID;
public class VRViaAPI extends ViaAPIBase<UUID> { public class ViaAPI extends ViaAPIBase<UUID> {
} }

View File

@ -8,14 +8,14 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public class VRViaConfig extends AbstractViaConfig { public class ViaConfig extends AbstractViaConfig {
// Based on Sponge ViaVersion // Based on Sponge ViaVersion
private static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "bungee-ping-interval", private static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "bungee-ping-interval",
"bungee-ping-save", "bungee-servers", "quick-move-action-fix", "nms-player-ticking", "bungee-ping-save", "bungee-servers", "quick-move-action-fix", "nms-player-ticking",
"velocity-ping-interval", "velocity-ping-save", "velocity-servers", "velocity-ping-interval", "velocity-ping-save", "velocity-servers",
"blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox"); "blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox");
public VRViaConfig(File configFile) { public ViaConfig(File configFile) {
super(configFile); super(configFile);
// Load config // Load config
reloadConfig(); reloadConfig();