updated ViaLoadingBase

This commit is contained in:
FlorianMichael 2023-02-25 21:12:16 +01:00
parent b92e0737da
commit dd45f40ee1
11 changed files with 18 additions and 27 deletions

View File

@ -6,9 +6,8 @@ import de.florianmichael.viafabricplus.platform.ProtocolRange;
import de.florianmichael.viafabricplus.value.impl.ProtocolSyncBooleanValue;
import de.florianmichael.viafabricplus_visual.definition.c0_30.ClassicItemSelectionScreen;
import de.florianmichael.viafabricplus_visual.definition.v1_8_x.ArmorPointsDefinition;
import de.florianmichael.vialoadingbase.api.version.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.api.version.InternalProtocolList;
import net.fabricmc.api.ClientModInitializer;
import de.florianmichael.vialoadingbase.platform.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.platform.InternalProtocolList;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
public class ViaFabricPlusVisual implements ViaFabricPlusAddon {
@ -34,7 +33,6 @@ public class ViaFabricPlusVisual implements ViaFabricPlusAddon {
@Override
public void onPostLoad() {
System.out.println("Test");
ArmorPointsDefinition.load();
ClassicItemSelectionScreen.create(InternalProtocolList.fromProtocolVersion(LegacyProtocolVersion.c0_28toc0_30));
}

View File

@ -1,6 +1,6 @@
package de.florianmichael.viafabricplus_visual.definition.c0_30;
import de.florianmichael.vialoadingbase.api.version.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.platform.ComparableProtocolVersion;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.sound.PositionedSoundInstance;

View File

@ -5,11 +5,11 @@ minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
loader_version=0.14.14
mod_version=1.3.6
mod_version=1.3.7
maven_group=de.florianmichael
archives_base_name=viafabricplus
vialoadingbase_version=f8468a707c
vialoadingbase_version=f4f9949531
viaversion_version=4.6.0-23w07a-SNAPSHOT
viabackwards_version=4.6.0-23w07a-SNAPSHOT
vialegacy_version=29a7082d7f

View File

@ -14,7 +14,7 @@ import de.florianmichael.viafabricplus.platform.ViaLegacyPlatformImpl;
import de.florianmichael.viafabricplus.provider.*;
import de.florianmichael.viafabricplus.util.SavingSystem;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import de.florianmichael.vialoadingbase.api.SubPlatform;
import de.florianmichael.vialoadingbase.platform.SubPlatform;
import io.netty.channel.DefaultEventLoop;
import io.netty.util.AttributeKey;
import net.fabricmc.loader.api.FabricLoader;
@ -69,13 +69,13 @@ public class ViaFabricPlus {
builder = builder.runDirectory(RUN_DIRECTORY);
builder = builder.nativeVersion(SharedConstants.getProtocolVersion());
builder = builder.singlePlayerProvider(() -> {
builder = builder.forceNativeVersionCondition(() -> {
if (MinecraftClient.getInstance() == null) return true;
return MinecraftClient.getInstance().isInSingleplayer();
});
builder = builder.eventLoop(new DefaultEventLoop());
builder = builder.dumpCreator(() -> {
builder = builder.dumpSupplier(() -> {
final JsonObject parentNode = new JsonObject();
final JsonArray modsNode = new JsonArray();
for (ModContainer mod : FabricLoader.getInstance().getAllMods()) {
@ -104,7 +104,7 @@ public class ViaFabricPlus {
parentNode.addProperty("native version", SharedConstants.getProtocolVersion());
return parentNode;
});
builder = builder.viaProviderCreator(providers -> {
builder = builder.providers(providers -> {
providers.use(MovementTransmitterProvider.class, new ViaFabricPlusMovementTransmitterProvider());
providers.use(HandItemProvider.class, new ViaFabricPlusHandItemProvider());
@ -116,7 +116,7 @@ public class ViaFabricPlus {
providers.use(GameProfileFetcher.class, new ViaFabricPlusGameProfileFetcher());
providers.use(ClassicMPPassProvider.class, new ViaFabricPlusClassicMPPassProvider());
});
builder = builder.protocolReloader(protocolVersion -> {
builder = builder.onProtocolReload(protocolVersion -> {
FabricLoader.getInstance().getEntrypoints("viafabricplus", ViaFabricPlusAddon.class).forEach(viaFabricPlusAddon -> viaFabricPlusAddon.onChangeVersion(protocolVersion));
ItemReleaseVersionDefinition.reload(protocolVersion);
});

View File

@ -1,6 +1,6 @@
package de.florianmichael.viafabricplus;
import de.florianmichael.vialoadingbase.api.version.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.platform.ComparableProtocolVersion;
public interface ViaFabricPlusAddon {

View File

@ -2,7 +2,7 @@ package de.florianmichael.viafabricplus.definition;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.viafabricplus.platform.ProtocolRange;
import de.florianmichael.vialoadingbase.api.version.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.platform.ComparableProtocolVersion;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;

View File

@ -1,7 +1,7 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.item;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import de.florianmichael.vialoadingbase.api.version.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.platform.ComparableProtocolVersion;
import net.minecraft.item.ItemGroups;
import net.minecraft.resource.featuretoggle.FeatureSet;
import org.spongepowered.asm.mixin.Mixin;

View File

@ -1,7 +1,7 @@
package de.florianmichael.viafabricplus.injection.mixin.vialoadingbase;
import com.viaversion.viaversion.configuration.AbstractViaConfig;
import de.florianmichael.vialoadingbase.internal.viaversion.CustomViaConfig;
import de.florianmichael.vialoadingbase.defaults.viaversion.CustomViaConfig;
import org.spongepowered.asm.mixin.Mixin;
import java.io.File;

View File

@ -1,8 +1,8 @@
package de.florianmichael.viafabricplus.platform;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.vialoadingbase.api.version.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.api.version.InternalProtocolList;
import de.florianmichael.vialoadingbase.platform.ComparableProtocolVersion;
import de.florianmichael.vialoadingbase.platform.InternalProtocolList;
public class ProtocolRange {
private final ComparableProtocolVersion lowerBound;
@ -36,13 +36,6 @@ public class ProtocolRange {
return true;
}
public ProtocolRange[] inverse() {
return new ProtocolRange[] {
ProtocolRange.andNewer(lowerBound),
ProtocolRange.andOlder(upperBound)
};
}
@Override
public String toString() {
if (lowerBound == null) return upperBound.getName() + "+";

View File

@ -2,7 +2,7 @@ package de.florianmichael.viafabricplus.screen;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import de.florianmichael.vialoadingbase.api.version.InternalProtocolList;
import de.florianmichael.vialoadingbase.platform.InternalProtocolList;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.screen.Screen;

View File

@ -7,7 +7,7 @@ import de.florianmichael.viafabricplus.ViaFabricPlus;
import de.florianmichael.viafabricplus.value.AbstractValue;
import de.florianmichael.viafabricplus.value.ValueHolder;
import de.florianmichael.vialoadingbase.ViaLoadingBase;
import de.florianmichael.vialoadingbase.api.version.InternalProtocolList;
import de.florianmichael.vialoadingbase.platform.InternalProtocolList;
import java.io.*;