Add visuals fabric mod, add loading cycle entrypoint for addons

This commit is contained in:
FlorianMichael 2024-12-24 17:16:44 +01:00
parent 50a8c1e1dd
commit 10bcd408b1
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
72 changed files with 745 additions and 278 deletions

View File

@ -4,5 +4,7 @@ plugins {
dependencies {
compileOnly project(":viafabricplus-api")
// They don't matter and are only used to compile against
compileOnly "com.viaversion:viaversion-common:5.2.1-SNAPSHOT"
}

View File

@ -0,0 +1,44 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.florianmichael.viafabricplus.fixes.data;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.minecraft.item.Item;
/**
* Please migrate to the general {@link com.viaversion.viafabricplus.ViaFabricPlus} API point.
*/
@Deprecated
public class ItemRegistryDiff {
@Deprecated
public static boolean keepItem(final Item item) {
return ViaFabricPlus.getImpl().itemExistsInConnection(item);
}
@Deprecated
public static boolean contains(final Item item, final ProtocolVersion version) {
return ViaFabricPlus.getImpl().itemExists(item, version);
}
}

View File

@ -3,6 +3,7 @@ plugins {
}
dependencies {
// They don't matter and are only used to compile against
compileOnly "com.viaversion:viaversion-common:5.2.1-SNAPSHOT"
compileOnly ("net.raphimc:ViaLoader:3.0.4") {
exclude group: "com.google.guava", module: "guava"

View File

@ -139,7 +139,8 @@ public interface ViaFabricPlusBase {
void registerOnChangeProtocolVersionCallback(final ChangeProtocolVersionCallback callback);
/**
* Register a callback for the loading cycle which covers most of the loading process of the mod.
* Register a callback for the loading cycle which covers most of the loading process of the mod. Intended to be used
* inside {@link com.viaversion.viafabricplus.api.entrypoint.ViaFabricPlusLoadEntrypoint} implementations.
*
* @param callback the callback
*/

View File

@ -0,0 +1,36 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.api.entrypoint;
import com.viaversion.viafabricplus.api.ViaFabricPlusBase;
/**
* Entrypoint called before the ViaFabricPlus loading cycle starts. To be used by addons to register their own callbacks.
* <p>
* See {@link com.viaversion.viafabricplus.api.events.LoadingCycleCallback} for more information.
*/
@FunctionalInterface
public interface ViaFabricPlusLoadEntrypoint {
void onPlatformLoad(final ViaFabricPlusBase platform);
}

View File

@ -28,11 +28,6 @@ public interface LoadingCycleCallback {
enum LoadingCycle {
/**
* Earliest stage before ViaFabricPlus loads anything.
*/
INITIAL_LOAD,
/**
* Before the settings are loaded.
*/

View File

@ -21,7 +21,7 @@
package com.viaversion.viafabricplus.screen;
import com.viaversion.viafabricplus.ViaFabricPlusImpl;
import com.viaversion.viafabricplus.ViaFabricPlus;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ConfirmLinkScreen;
@ -233,7 +233,7 @@ public class VFPScreen extends Screen {
* @param next The screen which should be opened after the error screen is closed
*/
public static void showErrorScreen(final Text title, final Throwable throwable, final Screen next) {
ViaFabricPlusImpl.INSTANCE.logger().error("Something went wrong!", throwable);
ViaFabricPlus.getImpl().logger().error("Something went wrong!", throwable);
final MinecraftClient client = MinecraftClient.getInstance();
client.execute(() -> client.setScreen(new NoticeScreen(() -> client.setScreen(next), title, Text.translatable("base.viafabricplus.something_went_wrong").append("\n" + throwable.getMessage()), Text.translatable("base.viafabricplus.cancel"), false)));

View File

@ -30,7 +30,7 @@ dependencies {
// Manually include to ignore dependencies
include implementation(project(path: ":viafabricplus-api", configuration: "namedElements"))
include implementation(project(path: ":viafabricplus-visual-changes", configuration: "namedElements"))
include implementation(project(path: ":viafabricplus-visuals", configuration: "namedElements"))
// Will be removed in future versions
include implementation(project(":viafabricplus-api-legacy"))

View File

@ -15,7 +15,7 @@ includeBuild("build-logic")
setupViaSubproject("api")
setupViaSubproject("api-legacy")
setupViaSubproject("generator-tools")
setupViaSubproject("visual-changes")
setupViaSubproject("visuals")
void setupViaSubproject(String name) {
var pName = "viafabricplus-" + name

View File

@ -21,17 +21,19 @@
package com.viaversion.viafabricplus;
import com.viaversion.viafabricplus.api.entrypoint.ViaFabricPlusLoadEntrypoint;
import com.viaversion.viafabricplus.api.events.ChangeProtocolVersionCallback;
import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.api.ViaFabricPlusBase;
import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.api.settings.SettingGroup;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.base.overriding_jars.ClassLoaderPriorityUtil;
import com.viaversion.viafabricplus.features.item.filter_creative_tabs.ItemRegistryDiff;
import com.viaversion.viafabricplus.features.item.negative_items.NegativeItemUtil;
import com.viaversion.viafabricplus.injection.access.base.IClientConnection;
import com.viaversion.viafabricplus.injection.access.base.IServerInfo;
import com.viaversion.viafabricplus.protocoltranslator.translator.ItemTranslator;
import com.viaversion.viafabricplus.util.ChatUtil;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.base.sync_tasks.SyncTasks;
import com.viaversion.viafabricplus.save.SaveManager;
import com.viaversion.viafabricplus.screen.impl.ProtocolSelectionScreen;
@ -102,6 +104,9 @@ public final class ViaFabricPlusImpl implements ViaFabricPlusBase {
public void init() {
ViaFabricPlus.init(this);
FabricLoader.getInstance().getEntrypointContainers("viafabricplus", ViaFabricPlusLoadEntrypoint.class).forEach(container -> {
container.getEntrypoint().onPlatformLoad(this);
});
// Create the directory if it doesn't exist
if (!Files.exists(path)) {
@ -133,6 +138,7 @@ public final class ViaFabricPlusImpl implements ViaFabricPlusBase {
loadingFuture.join();
SaveManager.INSTANCE.postInit();
});
Events.LOADING_CYCLE.invoker().onLoadCycle(LoadingCycleCallback.LoadingCycle.FINAL_LOAD);
}
// --------------------------------------------------------------------------------------------
@ -262,4 +268,5 @@ public final class ViaFabricPlusImpl implements ViaFabricPlusBase {
public int getStackCount(ItemStack stack) {
return NegativeItemUtil.getCount(stack);
}
}

View File

@ -40,4 +40,4 @@ public final class Events {
}
});
}
}

View File

@ -23,22 +23,17 @@ package com.viaversion.viafabricplus.features;
import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.features.block.CollisionShapes;
import com.viaversion.viafabricplus.features.cpe_extensions.CPEAdditions;
import com.viaversion.viafabricplus.features.footstep_particle.FootStepParticle1_12_2;
import com.viaversion.viafabricplus.features.networking.resource_pack_header.ResourcePackHeaderDiff;
import com.viaversion.viafabricplus.features.recipe_emulation.Recipes1_11_2;
import com.viaversion.viafabricplus.features.filter_non_existing_characters.UnicodeFontFix1_12_2;
import com.viaversion.viafabricplus.features.ui.armor_hud.ArmorHudEmulation1_8;
import com.viaversion.viafabricplus.features.ui.classic_creative_menu.GridItemSelectionScreen;
import com.viaversion.viafabricplus.features.entity.EntityDimensionDiff;
import com.viaversion.viafabricplus.features.entity.enchantment_attributes.EnchantmentAttributesEmulation1_20_6;
import com.viaversion.viafabricplus.base.sync_tasks.DataCustomPayload;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.minecraft.client.MinecraftClient;
import net.raphimc.viaaprilfools.api.AprilFoolsProtocolVersion;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
public final class FeaturesLoading {
@ -46,24 +41,18 @@ public final class FeaturesLoading {
ResourcePackHeaderDiff.init();
CPEAdditions.init();
DataCustomPayload.init();
UnicodeFontFix1_12_2.init();
FootStepParticle1_12_2.init();
Events.LOADING_CYCLE.register(cycle -> {
if (cycle == LoadingCycleCallback.LoadingCycle.POST_GAME_LOAD) {
EntityDimensionDiff.init();
EnchantmentAttributesEmulation1_20_6.init();
ArmorHudEmulation1_8.init();
}
});
Events.CHANGE_PROTOCOL_VERSION.register((oldVersion, newVersion) -> MinecraftClient.getInstance().execute(() -> {
VisualSettings.INSTANCE.filterNonExistingGlyphs.onValueChanged();
CollisionShapes.reloadBlockShapes();
if (newVersion.olderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) {
GridItemSelectionScreen.INSTANCE.itemGrid = null;
}
if (newVersion.olderThanOrEqualTo(ProtocolVersion.v1_11_1)) {
Recipes1_11_2.reset();
}

View File

@ -22,8 +22,6 @@
package com.viaversion.viafabricplus.injection.mixin.base;
import com.viaversion.viafabricplus.ViaFabricPlusImpl;
import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.base.Events;
import net.minecraft.client.main.Main;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@ -35,9 +33,7 @@ public abstract class MixinMain {
@Inject(method = "main", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Util;startTimerHack()V"))
private static void bootstrap(CallbackInfo ci) {
Events.LOADING_CYCLE.invoker().onLoadCycle(LoadingCycleCallback.LoadingCycle.INITIAL_LOAD);
ViaFabricPlusImpl.INSTANCE.init();
Events.LOADING_CYCLE.invoker().onLoadCycle(LoadingCycleCallback.LoadingCycle.FINAL_LOAD);
}
}

View File

@ -0,0 +1,61 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.base.ui;
import com.google.common.collect.Lists;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.viaversion.viafabricplus.injection.access.base.IServerInfo;
import com.viaversion.viafabricplus.settings.impl.GeneralSettings;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import java.util.ArrayList;
import java.util.List;
@Mixin(MultiplayerServerListWidget.ServerEntry.class)
public abstract class MixinMultiplayerServerListWidget_ServerEntry {
@Shadow @Final private ServerInfo server;
@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/multiplayer/MultiplayerScreen;setTooltip(Lnet/minecraft/text/Text;)V"))
private void drawTranslatingState(MultiplayerScreen instance, Text text, Operation<Void> original) {
final List<Text> tooltips = new ArrayList<>();
tooltips.add(text);
if (GeneralSettings.INSTANCE.showAdvertisedServerVersion.getValue()) {
final ProtocolVersion version = ((IServerInfo) server).viaFabricPlus$translatingVersion();
if (version != null) {
tooltips.add(Text.translatable("base.viafabricplus.via_translates_to", version.getName() + " (" + version.getOriginalVersion() + ")"));
tooltips.add(Text.translatable("base.viafabricplus.server_version", server.version.getString() + " (" + server.protocolVersion + ")"));
}
}
instance.setTooltip(Lists.transform(tooltips, Text::asOrderedText));
}
}

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.book_edit_page_limitations;
package com.viaversion.viafabricplus.injection.mixin.features.book_edit_page_limitations;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;

View File

@ -36,7 +36,6 @@ import com.viaversion.viafabricplus.injection.access.IScreenHandler;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.protocoltranslator.impl.provider.viaversion.ViaFabricPlusHandItemProvider;
import com.viaversion.viafabricplus.protocoltranslator.translator.ItemTranslator;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.SnowBlock;
@ -326,13 +325,6 @@ public abstract class MixinClientPlayerInteractionManager implements IClientPlay
}
}
@Inject(method = "hasExperienceBar", at = @At("HEAD"), cancellable = true)
private void removeExperienceBar(CallbackInfoReturnable<Boolean> cir) {
if (VisualSettings.INSTANCE.hideModernHUDElements.isEnabled()) {
cir.setReturnValue(false);
}
}
@Unique
private boolean viaFabricPlus$extinguishFire(BlockPos blockPos, final Direction direction) {
blockPos = blockPos.offset(direction);

View File

@ -25,7 +25,6 @@ import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.sugar.Local;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
@ -214,11 +213,6 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
}
}
@Redirect(method = "onGameJoin", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;isSecureChatEnforced()Z"))
private boolean removeSecureChatWarning(ClientPlayNetworkHandler instance) {
return isSecureChatEnforced() || VisualSettings.INSTANCE.disableSecureChatWarning.isEnabled();
}
@SuppressWarnings({"InvalidInjectorMethodSignature"})
@ModifyConstant(method = "onEntityPassengersSet", constant = @Constant(classValue = AbstractBoatEntity.class))
private Class<?> dontChangeYawWhenMountingBoats(Object entity, Class<?> boatClass) {

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.sign_editor_reach;
package com.viaversion.viafabricplus.injection.mixin.features.sign_editor_reach;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.triple_chests;
package com.viaversion.viafabricplus.injection.mixin.features.triple_chests;
import com.llamalad7.mixinextras.sugar.Local;
import com.viaversion.viafabricplus.base.sync_tasks.SyncTasks;

View File

@ -25,8 +25,6 @@ import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.features.entity.riding_offsets.EntityRidingOffsetsPre1_20_2;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.settings.impl.DebugSettings;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import net.minecraft.block.BlockState;
import net.minecraft.block.TrapdoorBlock;
import net.minecraft.entity.*;
@ -73,9 +71,6 @@ public abstract class MixinLivingEntity extends Entity {
@Shadow
public abstract boolean hasStatusEffect(RegistryEntry<StatusEffect> effect);
@Shadow
public float bodyYaw;
public MixinLivingEntity(EntityType<?> type, World world) {
super(type, world);
}
@ -98,20 +93,6 @@ public abstract class MixinLivingEntity extends Entity {
}
}
@Redirect(method = "turnHead", at = @At(value = "INVOKE", target = "Ljava/lang/Math;abs(F)F"))
private float changeBodyRotationInterpolation(float g) {
if (VisualSettings.INSTANCE.changeBodyRotationInterpolation.isEnabled()) {
g = MathHelper.clamp(g, -75.0F, 75.0F);
this.bodyYaw = this.getYaw() - g;
if (Math.abs(g) > 50.0F) {
this.bodyYaw += g * 0.2F;
}
return Float.MIN_VALUE; // Causes the if to always fail
} else {
return Math.abs(g);
}
}
@Inject(method = "tickCramming", at = @At("HEAD"), cancellable = true)
private void preventEntityPush(CallbackInfo ci) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_8)) {
@ -218,15 +199,6 @@ public abstract class MixinLivingEntity extends Entity {
}
}
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;abs(F)F"))
private float alwaysRotateWhenWalkingBackwards(float value) {
if (VisualSettings.INSTANCE.sidewaysBackwardsRunning.isEnabled()) {
return 0F;
} else {
return MathHelper.abs(value);
}
}
@Inject(method = "getPreferredEquipmentSlot", at = @At("HEAD"), cancellable = true)
private void removeShieldSlotPreference(ItemStack stack, CallbackInfoReturnable<EquipmentSlot> cir) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_9_3) && stack.isOf(Items.SHIELD)) {

View File

@ -26,11 +26,9 @@ import com.llamalad7.mixinextras.sugar.Local;
import com.llamalad7.mixinextras.sugar.ref.LocalFloatRef;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import net.minecraft.block.BlockState;
import net.minecraft.entity.*;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerAbilities;
@ -74,9 +72,6 @@ public abstract class MixinPlayerEntity extends LivingEntity {
private static final EntityDimensions viaFabricPlus$sneaking_dimensions_v1_8 = EntityDimensions.changing(0.6F, 1.8F).withEyeHeight(1.54F).
withAttachments(EntityAttachments.builder().add(EntityAttachmentType.VEHICLE, PlayerEntity.VEHICLE_ATTACHMENT_POS));
@Unique
private static final SoundEvent viaFabricPlus$oof_hurt = SoundEvent.of(Identifier.of("viafabricplus", "oof.hurt"));
@Unique
public boolean viaFabricPlus$isSprinting;
@ -237,11 +232,4 @@ public abstract class MixinPlayerEntity extends LivingEntity {
}
}
@Inject(method = "getHurtSound", at = @At("HEAD"), cancellable = true)
private void replaceSound(DamageSource source, CallbackInfoReturnable<SoundEvent> cir) {
if (VisualSettings.INSTANCE.replaceHurtSoundWithOOFSound.isEnabled()) {
cir.setReturnValue(viaFabricPlus$oof_hurt);
}
}
}

View File

@ -25,7 +25,6 @@ import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.save.impl.AccountsSave;
import com.viaversion.viafabricplus.save.impl.SettingsSave;
import com.viaversion.viafabricplus.settings.SettingsManager;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -60,6 +60,10 @@ public final class SettingsSave extends AbstractSave {
final String translationKey = ChatUtil.uncoverTranslationKey(group.getName());
final JsonObject groupObject = object.getAsJsonObject(AbstractSetting.mapTranslationKey(translationKey));
if (groupObject == null) {
continue;
}
for (AbstractSetting<?> setting : group.getSettings()) {
if (groupObject.has(setting.getTranslationKey())) {
setting.read(groupObject);

View File

@ -22,8 +22,8 @@
package com.viaversion.viafabricplus.settings;
import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.api.settings.SettingGroup;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.settings.impl.*;
import java.util.ArrayList;
@ -43,7 +43,6 @@ public final class SettingsManager {
GeneralSettings.INSTANCE,
BedrockSettings.INSTANCE,
AuthenticationSettings.INSTANCE,
VisualSettings.INSTANCE,
DebugSettings.INSTANCE
);

View File

@ -1,36 +1,24 @@
accessWidener v1 named
accessible field net/minecraft/network/ClientConnection channel Lio/netty/channel/Channel;
accessible field net/minecraft/client/MinecraftClient fontManager Lnet/minecraft/client/font/FontManager;
accessible field net/minecraft/client/network/AllowedAddressResolver redirectResolver Lnet/minecraft/client/network/RedirectResolver;
accessible field net/minecraft/client/font/FontManager fontStorages Ljava/util/Map;
accessible field net/minecraft/client/gui/screen/GameMenuScreen exitButton Lnet/minecraft/client/gui/widget/ButtonWidget;
accessible field net/minecraft/client/font/FontStorage$GlyphPair MISSING Lnet/minecraft/client/font/FontStorage$GlyphPair;
accessible field net/minecraft/network/ClientConnection packetSizeLogger Lnet/minecraft/network/handler/PacketSizeLogger;
accessible field net/minecraft/entity/boss/dragon/EnderDragonEntity body Lnet/minecraft/entity/boss/dragon/EnderDragonPart;
accessible field net/minecraft/entity/passive/AbstractHorseEntity lastAngryAnimationProgress F
accessible field net/minecraft/client/font/FontStorage bakedGlyphCache Lnet/minecraft/client/font/GlyphContainer;
accessible field net/minecraft/entity/vehicle/AbstractBoatEntity yawVelocity F
accessible field net/minecraft/client/font/FontStorage glyphCache Lnet/minecraft/client/font/GlyphContainer;
accessible field net/minecraft/entity/EntityType dimensions Lnet/minecraft/entity/EntityDimensions;
accessible field net/minecraft/block/AbstractBlock velocityMultiplier F
accessible field net/minecraft/client/gui/screen/world/WorldIcon UNKNOWN_SERVER_ID Lnet/minecraft/util/Identifier;
accessible field net/minecraft/client/gui/widget/TexturedButtonWidget textures Lnet/minecraft/client/gui/screen/ButtonTextures;
accessible field net/minecraft/client/gui/screen/option/ControlsListWidget$KeyBindingEntry RESET_TEXT Lnet/minecraft/text/Text;
accessible field net/minecraft/client/gui/screen/multiplayer/SocialInteractionsScreen TITLE Lnet/minecraft/text/Text;
accessible field net/minecraft/client/resource/language/TranslationStorage translations Ljava/util/Map;
accessible method net/minecraft/screen/GenericContainerScreenHandler <init> (Lnet/minecraft/screen/ScreenHandlerType;ILnet/minecraft/entity/player/PlayerInventory;I)V
accessible method net/minecraft/client/font/FontStorage$GlyphPair <init> (Lnet/minecraft/client/font/Glyph;Lnet/minecraft/client/font/Glyph;)V
accessible method net/minecraft/entity/passive/CamelEntity getPassengerAttachmentY (ZFLnet/minecraft/entity/EntityDimensions;F)D
accessible method net/minecraft/entity/vehicle/AbstractBoatEntity getMaxPassengers ()I
accessible method net/minecraft/client/gui/screen/multiplayer/ConnectScreen setStatus (Lnet/minecraft/text/Text;)V
accessible method net/minecraft/item/BlockItem getPlacementState (Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;
accessible method net/minecraft/block/AbstractBlock getPickStack (Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Z)Lnet/minecraft/item/ItemStack;
accessible class net/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection
accessible class net/minecraft/client/font/FontStorage$GlyphPair
accessible class net/minecraft/client/font/TextRenderer$Drawer
mutable field net/minecraft/entity/EntityType dimensions Lnet/minecraft/entity/EntityDimensions;
mutable field net/minecraft/block/AbstractBlock velocityMultiplier F
accessible class net/minecraft/client/font/TextRenderer$Drawer

View File

@ -31,6 +31,7 @@
"base.ui.MixinDirectConnectScreen",
"base.ui.MixinDownloadingTerrainScreen",
"base.ui.MixinMultiplayerScreen",
"base.ui.MixinMultiplayerServerListWidget_ServerEntry",
"compat.classic4j.MixinCCAuthenticationResponse",
"compat.classic4j.MixinTextFieldWidget",
"compat.fabricapi.MixinClientRegistrySyncHandler",
@ -75,6 +76,7 @@
"features.block.interactions.MixinNoteBlock",
"features.block.mining_calculations.MixinAbstractBlock",
"features.block.mining_calculations.MixinAbstractBlock_AbstractBlockState",
"features.book_edit_page_limitations.MixinBookEditScreen",
"features.classic_world_height.MixinBuiltChunk",
"features.classic_world_height.MixinEntityPacketRewriter1_17",
"features.classic_world_height.MixinWorldPacketRewriter1_16_2",
@ -84,6 +86,7 @@
"features.cpe_extensions.MixinProtocolc0_30cpeToc0_28_30",
"features.cpe_extensions.MixinWeatherRendering",
"features.entity.allow_duplicated_uuids.MixinEntityIndex",
"features.entity.enchantment_attributes.MixinLivingEntity",
"features.entity.interactions.MixinAbstractClientPlayerEntity",
"features.entity.interactions.MixinAbstractHorseEntity",
"features.entity.interactions.MixinAnimalEntity",
@ -95,11 +98,14 @@
"features.entity.interactions.MixinCreeperEntity",
"features.entity.interactions.MixinMobEntity",
"features.entity.interactions.MixinMooshroomEntity",
"features.entity.interactions.MixinSquidEntity",
"features.entity.interactions.MixinWolfEntity",
"features.entity.interactions.MixinZombieVillagerEntity",
"features.entity.metadata_handling.MixinCommonBoss",
"features.entity.metadata_handling.MixinEntityPacketRewriter1_15",
"features.entity.metadata_handling.MixinEntityPacketRewriter1_9",
"features.entity.metadata_handling.MixinEntityTracker1_9",
"features.entity.pose.MixinOtherClientPlayerEntity",
"features.entity.riding_offsets.MixinCamelEntity",
"features.entity.v1_8_boat.MixinAbstractBoatEntity",
"features.entity.v1_8_boat.MixinEntityModels",
@ -107,20 +113,23 @@
"features.execute_inputs_sync.MixinKeyboard",
"features.execute_inputs_sync.MixinMinecraftClient",
"features.execute_inputs_sync.MixinMouse",
"features.filter_non_existing_characters.MixinFontStorage",
"features.filter_non_existing_characters.MixinLanguageManager",
"features.footstep_particle.MixinMappingDataBase",
"features.footstep_particle.MixinParticleIdMappings1_13",
"features.footstep_particle.MixinParticleMappings",
"features.footstep_particle.MixinRegistrySyncManager",
"features.instant_sneaking.MixinCamera",
"features.interaction.MixinBlockItemPacketRewriter1_21_4",
"features.interaction.MixinClientPlayerInteractionManager",
"features.interaction.MixinEntityPacketRewriter1_20_5",
"features.interaction.MixinItemPacketRewriter1_17",
"features.interaction.MixinItemPlacementContext",
"features.interaction.MixinMinecraftClient",
"features.interaction.MixinScreenHandler",
"features.interaction.MixinWorldPacketRewriter1_19",
"features.interaction.inventory_clicking.MixinAbstractFurnaceScreenHandler",
"features.interaction.inventory_clicking.MixinBrewingStandScreenHandler_FuelSlot",
"features.interaction.inventory_clicking.MixinCraftingScreenHandler",
"features.interaction.inventory_clicking.MixinPlayerScreenHandler",
"features.interaction.merchant_emulation.MixinMerchantScreenHandler",
"features.item.MixinItemEntity",
"features.item.attributes.MixinItemPacketRewriter1_9",
"features.item.cooldown.MixinItemCooldownManager",
@ -141,10 +150,8 @@
"features.item.interactions.MixinShovelItem",
"features.item.interactions.MixinSwordItem",
"features.item.mining_speeds.MixinBlockItemPacketRewriter1_20_5",
"features.item.missing_model.MixinItemRenderer",
"features.item.negative_items.MixinDrawContext",
"features.item.tooltip_changes.MixinItemStack",
"features.item.v1_7_tilt.MixinHeldItemRenderer",
"features.legacy_skin_loading.MixinPlayerListEntry",
"features.legacy_tab_completions.MixinAbstractCommandBlockScreen",
"features.legacy_tab_completions.MixinChatInputSuggestor",
@ -160,6 +167,7 @@
"features.movement.block.MixinHoneyBlock",
"features.movement.block.MixinSoulSandBlock",
"features.movement.elytra.MixinFireworkRocketItem",
"features.movement.entity.MixinSkeletonHorseEntity",
"features.movement.item.MixinEnderEyeItem",
"features.movement.levitation_value.MixinStatusEffectInstance",
"features.networking.config_state_fixes.MixinClientConfigurationNetworkHandler",
@ -169,8 +177,6 @@
"features.networking.config_state_fixes.MixinProtocol1_20To1_20_2",
"features.networking.downloading_terrain_handling.MixinClientPlayNetworkHandler",
"features.networking.downloading_terrain_handling.MixinDownloadingTerrainScreen",
"features.networking.legacy_chat_signatures.MixinChatHud",
"features.networking.legacy_chat_signatures.MixinChatScreen",
"features.networking.legacy_chat_signatures.MixinConnectScreen_1",
"features.networking.legacy_chat_signatures.MixinKeyPairResponse",
"features.networking.legacy_chat_signatures.MixinPlayerPublicKey_PublicKeyData",
@ -199,26 +205,11 @@
"features.recipe_emulation.MixinEntityPacketRewriter1_12",
"features.recipe_emulation.MixinPlayerScreenHandler",
"features.run_command_action_handling.MixinScreen",
"features.sign_editor_reach.MixinAbstractSignEditScreen",
"features.strike_through_offset.MixinTextRenderer_Drawer",
"features.swinging.MixinInventoryTracker1_16",
"features.swinging.MixinMinecraftClient",
"features.ui.book_edit_page_limitations.MixinBookEditScreen",
"features.ui.classic_creative_menu.MixinCreativeInventoryScreen",
"features.ui.disable_server_pinging.MixinMultiplayerServerListWidget_ServerEntry",
"features.ui.downloading_terrain_transitions.MixinDownloadingTerrainScreen",
"features.ui.filter_game_mode_selections.MixinGameModeSelectionScreen",
"features.ui.filter_game_mode_selections.MixinGameModeSelectionScreen_GameModeSelection",
"features.ui.hud_element_changes.MixinInGameHud",
"features.ui.remove_newer_screen_features.MixinCommandBlockScreen",
"features.ui.remove_newer_screen_features.MixinGameMenuScreen",
"features.ui.remove_newer_screen_features.MixinJigsawBlockScreen",
"features.ui.remove_newer_screen_features.MixinScreen",
"features.ui.remove_newer_screen_features.MixinStructureBlockScreen_1",
"features.ui.sign_editor_reach.MixinAbstractSignEditScreen",
"features.ui.triple_chests.MixinItemPacketRewriter1_14",
"features.ui.v1_7_tab_list_style.MixinClientPlayNetworkHandler",
"features.ui.v1_7_tab_list_style.MixinPlayerListEntry",
"features.ui.v1_7_tab_list_style.MixinPlayerListHud",
"features.triple_chests.MixinItemPacketRewriter1_14",
"features.world.always_tick_entities.MixinClientWorld",
"features.world.always_tick_entities.MixinEntity",
"features.world.disable_sequencing.MixinClientWorld",
@ -228,31 +219,16 @@
"integration.viabedrock.MixinJoinPackets",
"integration.vialegacy.MixinViaLegacyConfig",
"old.minecraft.MixinMinecraftClient",
"old.minecraft.entity.MixinBipedEntityModel",
"old.minecraft.entity.MixinClientPlayerEntity",
"old.minecraft.entity.MixinEntity",
"old.minecraft.entity.MixinLivingEntity",
"features.entity.pose.MixinOtherClientPlayerEntity",
"old.minecraft.entity.MixinPlayerEntity",
"old.minecraft.entity.MixinPlayerEntityRenderer",
"features.movement.entity.MixinSkeletonHorseEntity",
"features.entity.interactions.MixinSquidEntity",
"old.minecraft.entity.MixinVillagerClothingFeatureRenderer",
"features.entity.interactions.MixinWolfEntity",
"features.interaction.inventory_clicking.MixinAbstractFurnaceScreenHandler",
"features.interaction.inventory_clicking.MixinBrewingStandScreenHandler_FuelSlot",
"features.interaction.inventory_clicking.MixinCraftingScreenHandler",
"features.interaction.merchant_emulation.MixinMerchantScreenHandler",
"features.interaction.inventory_clicking.MixinPlayerScreenHandler",
"features.interaction.MixinScreenHandler"
"old.minecraft.entity.MixinPlayerEntityRenderer"
],
"injectors": {
"defaultRequire": 1
},
"overwrites": {
"requireAnnotations": true
},
"mixins": [
"features.entity.enchantment_attributes.MixinLivingEntity"
]
}
}

30
visuals/build.gradle Normal file
View File

@ -0,0 +1,30 @@
plugins {
id "vfp.base-conventions"
}
loom {
accessWidenerPath = file("src/main/resources/viafabricplus-visuals.accesswidener")
}
dependencies {
compileOnly project(":viafabricplus-api")
modCompileOnly fabricApi.module("fabric-api-base", project.fabric_api_version)
modCompileOnly fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api_version)
// They don't matter and are only used to compile against
compileOnly "com.viaversion:viaversion-common:5.2.1-SNAPSHOT"
compileOnly ("net.raphimc:ViaLoader:3.0.4") {
exclude group: "com.google.guava", module: "guava"
exclude group: "org.slf4j", module: "slf4j-api"
}
compileOnly "net.raphimc:ViaLegacy:3.0.7-SNAPSHOT"
}
processResources {
filesMatching("fabric.mod.json") {
expand(
"version": project.version,
"description": project.description
)
}
}

View File

@ -0,0 +1 @@
maven_description=Additional mod for ViaFabricPlus to add visual-only changes.

View File

@ -0,0 +1,58 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.visuals;
import com.viaversion.viafabricplus.api.ViaFabricPlusBase;
import com.viaversion.viafabricplus.api.entrypoint.ViaFabricPlusLoadEntrypoint;
import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters.UnicodeFontFix1_12_2;
import com.viaversion.viafabricplus.visuals.features.armor_hud.ArmorHudEmulation1_8;
import com.viaversion.viafabricplus.visuals.features.classic_creative_menu.GridItemSelectionScreen;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.MinecraftClient;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
public class ViaFabricPlusVisuals implements ViaFabricPlusLoadEntrypoint {
@Override
public void onPlatformLoad(ViaFabricPlusBase platform) {
UnicodeFontFix1_12_2.init();
platform.registerLoadingCycleCallback(cycle -> {
if (cycle == LoadingCycleCallback.LoadingCycle.POST_SETTINGS_LOAD) {
platform.addSettingGroup(VisualSettings.INSTANCE);
}
if (cycle == LoadingCycleCallback.LoadingCycle.POST_GAME_LOAD) {
ArmorHudEmulation1_8.init();
}
});
platform.registerOnChangeProtocolVersionCallback((oldVersion, newVersion) -> MinecraftClient.getInstance().execute(() -> {
VisualSettings.INSTANCE.filterNonExistingGlyphs.onValueChanged();
if (newVersion.olderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) {
GridItemSelectionScreen.INSTANCE.itemGrid = null;
}
}));
}
}

View File

@ -19,17 +19,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.features.ui.armor_hud;
package com.viaversion.viafabricplus.visuals.features.armor_hud;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.protocols.v1_8to1_9.Protocol1_8To1_9;
import com.viaversion.viaversion.protocols.v1_8to1_9.data.ArmorTypes1_8;
import com.viaversion.viaversion.protocols.v1_8to1_9.packet.ClientboundPackets1_9;
import com.viaversion.viafabricplus.ViaFabricPlusImpl;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.item.ItemStack;
@ -50,12 +49,12 @@ public final class ArmorHudEmulation1_8 {
}
if (MinecraftClient.getInstance().player != null) {
final UserConnection userConnection = ProtocolTranslator.getPlayNetworkUserConnection();
final UserConnection userConnection = ViaFabricPlus.getImpl().getPlayNetworkUserConnection();
if (userConnection != null) {
try {
sendArmorUpdate(userConnection);
} catch (Throwable t) {
ViaFabricPlusImpl.INSTANCE.logger().error("Error sending armor update", t);
ViaFabricPlus.getImpl().logger().error("Error sending armor update", t);
}
}
} else {

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.features.ui.classic_creative_menu;
package com.viaversion.viafabricplus.visuals.features.classic_creative_menu;
import com.viaversion.viafabricplus.features.item.filter_creative_tabs.ItemRegistryDiff;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viafabricplus.screen.VFPScreen;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.item.Item;
@ -59,8 +59,10 @@ public final class GridItemSelectionScreen extends VFPScreen {
final List<Item> allowedItems = new ArrayList<>();
// Calculate all visible items
for (Item item : Registries.ITEM) {
if (item == Items.AIR || !item.getRequiredFeatures().contains(FeatureFlags.VANILLA)) continue;
if (ItemRegistryDiff.keepItem(item)) {
if (item == Items.AIR || !item.getRequiredFeatures().contains(FeatureFlags.VANILLA)) {
continue;
}
if (ViaFabricPlus.getImpl().itemExistsInConnection(item)) {
allowedItems.add(item);
}
}

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.features.filter_non_existing_characters;
package com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters;
import com.viaversion.viafabricplus.injection.mixin.features.filter_non_existing_characters.MixinFontStorage;
import com.viaversion.viafabricplus.visuals.injection.mixin.filter_non_existing_characters.MixinFontStorage;
import net.minecraft.client.font.BakedGlyph;
import net.minecraft.client.font.Glyph;
import net.minecraft.client.font.RenderableGlyph;

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.features.filter_non_existing_characters;
package com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters;
import java.util.Map;

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.features.filter_non_existing_characters;
package com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntConsumer;
@ -977,7 +977,7 @@ public final class RenderableGlyphDiff {
* @return true if the given code point is renderable in the current version of the game
*/
public static boolean isGlyphRenderable(final int codePoint) {
final ProtocolVersion targetVersion = ProtocolTranslator.getTargetVersion();
final ProtocolVersion targetVersion = ViaFabricPlus.getImpl().getTargetVersion();
if (targetVersion.newerThanOrEqualTo(v1_20)) { // 1.20 switched to using Unihex as a main font
return !RENDERABLE_GLYPH_DIFF.containsKey(codePoint) || targetVersion.newerThanOrEqualTo(RENDERABLE_GLYPH_DIFF.get(codePoint));

View File

@ -19,11 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.features.filter_non_existing_characters;
package com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.SimpleOption;
@ -40,7 +40,9 @@ public final class UnicodeFontFix1_12_2 {
private static Runnable task = null;
static {
Events.CHANGE_PROTOCOL_VERSION.register((oldVersion, newVersion) -> updateUnicodeFontOverride(newVersion));
ViaFabricPlus.getImpl().registerOnChangeProtocolVersionCallback((oldVersion, newVersion) -> {
updateUnicodeFontOverride(newVersion);
});
ClientTickEvents.START_CLIENT_TICK.register(client -> {
// Prevent usages of RenderSystem.recordRenderCall()

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.features.ui.v1_7_tab_list_style;
package com.viaversion.viafabricplus.visuals.features.v1_7_tab_list_style;
public final class LegacyTabList {

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style;
package com.viaversion.viafabricplus.visuals.injection.access;
public interface IPlayerListEntry {

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style;
package com.viaversion.viafabricplus.visuals.injection.access;
public interface IPlayerListHud {

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.classic_creative_menu;
package com.viaversion.viafabricplus.visuals.injection.mixin.classic_creative_menu;
import com.viaversion.viafabricplus.features.ui.classic_creative_menu.GridItemSelectionScreen;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.features.classic_creative_menu.GridItemSelectionScreen;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import org.spongepowered.asm.mixin.Mixin;

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.entity;
package com.viaversion.viafabricplus.visuals.injection.mixin.classic_walking_animation;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.client.render.entity.state.BipedEntityRenderState;
@ -31,7 +31,6 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(BipedEntityModel.class)
@ -45,15 +44,6 @@ public abstract class MixinBipedEntityModel<T extends BipedEntityRenderState> {
@Final
public ModelPart leftArm;
@Redirect(method = "positionBlockingArm", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F"))
private float preventArmFollowingThirdPersonRotation(float value, float min, float max) {
if (VisualSettings.INSTANCE.lockBlockingArmRotation.isEnabled()) {
return 0.0F;
} else {
return MathHelper.clamp(value, min, max);
}
}
@Inject(method = "setAngles(Lnet/minecraft/client/render/entity/state/BipedEntityRenderState;)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelPart;roll:F", ordinal = 1, shift = At.Shift.AFTER))
private void addOldWalkAnimation(T bipedEntityRenderState, CallbackInfo ci) {
if (VisualSettings.INSTANCE.oldWalkingAnimation.isEnabled()) {
@ -68,4 +58,4 @@ public abstract class MixinBipedEntityModel<T extends BipedEntityRenderState> {
}
}
}
}

View File

@ -19,15 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.disable_server_pinging;
package com.viaversion.viafabricplus.visuals.injection.mixin.disable_server_pinging;
import com.google.common.collect.Lists;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.injection.access.base.IServerInfo;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.settings.impl.GeneralSettings;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
@ -44,12 +41,11 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.function.Function;
@Mixin(MultiplayerServerListWidget.ServerEntry.class)
@Mixin(value = MultiplayerServerListWidget.ServerEntry.class, priority = 1001) // Apply after the mixin in the main project
public abstract class MixinMultiplayerServerListWidget_ServerEntry {
@Shadow
@ -66,8 +62,10 @@ public abstract class MixinMultiplayerServerListWidget_ServerEntry {
@WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/concurrent/ThreadPoolExecutor;submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;"))
private boolean disableServerPinging(ThreadPoolExecutor instance, Runnable runnable) {
ProtocolVersion version = ((IServerInfo) server).viaFabricPlus$forcedVersion();
if (version == null) version = ProtocolTranslator.getTargetVersion();
ProtocolVersion version = ViaFabricPlus.getImpl().getServerVersion(server);
if (version == null) {
version = ViaFabricPlus.getImpl().getTargetVersion();
}
viaFabricPlus$disableServerPinging = VisualSettings.INSTANCE.disableServerPinging.isEnabled(version);
if (viaFabricPlus$disableServerPinging) {
@ -121,21 +119,9 @@ public abstract class MixinMultiplayerServerListWidget_ServerEntry {
}
}
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/multiplayer/MultiplayerScreen;setTooltip(Lnet/minecraft/text/Text;)V"))
private void drawTranslatingState(MultiplayerScreen instance, Text text) {
if (viaFabricPlus$disableServerPinging) { // Remove ping bar tooltip
return;
}
final List<Text> tooltips = new ArrayList<>();
tooltips.add(text);
if (GeneralSettings.INSTANCE.showAdvertisedServerVersion.getValue()) {
final ProtocolVersion version = ((IServerInfo) server).viaFabricPlus$translatingVersion();
if (version != null) {
tooltips.add(Text.translatable("base.viafabricplus.via_translates_to", version.getName() + " (" + version.getOriginalVersion() + ")"));
tooltips.add(Text.translatable("base.viafabricplus.server_version", server.version.getString() + " (" + server.protocolVersion + ")"));
}
}
instance.setTooltip(Lists.transform(tooltips, Text::asOrderedText));
@WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/multiplayer/MultiplayerScreen;setTooltip(Lnet/minecraft/text/Text;)V"))
private boolean disableServerPinging(MultiplayerScreen instance, Text text) {
return !viaFabricPlus$disableServerPinging; // Remove ping bar tooltip
}
}

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.downloading_terrain_transitions;
package com.viaversion.viafabricplus.visuals.injection.mixin.downloading_terrain_transitions;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.filter_game_mode_selections;
package com.viaversion.viafabricplus.visuals.injection.mixin.filter_game_mode_selections;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import net.minecraft.client.gui.screen.GameModeSelectionScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;
@ -54,11 +54,11 @@ public abstract class MixinGameModeSelectionScreen extends Screen {
@Inject(method = "<init>", at = @At("RETURN"))
private void fixUIWidth(CallbackInfo ci) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_7_6)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_7_6)) {
final List<GameModeSelectionScreen.GameModeSelection> selections = new ArrayList<>(Arrays.stream(GameModeSelectionScreen.GameModeSelection.values()).toList());
selections.remove(GameModeSelectionScreen.GameModeSelection.SPECTATOR);
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
selections.remove(GameModeSelectionScreen.GameModeSelection.ADVENTURE);
}
@ -69,7 +69,7 @@ public abstract class MixinGameModeSelectionScreen extends Screen {
@Redirect(method = "init", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection;VALUES:[Lnet/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection;"))
private GameModeSelectionScreen.GameModeSelection[] removeNewerGameModes() {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_7_6)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_7_6)) {
return viaFabricPlus$unwrappedGameModes;
} else {
return GameModeSelectionScreen.GameModeSelection.values();
@ -78,7 +78,7 @@ public abstract class MixinGameModeSelectionScreen extends Screen {
@Inject(method = "init", at = @At("HEAD"))
private void disableInClassic(CallbackInfo ci) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { // survival mode was added in a1.0.15
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { // survival mode was added in a1.0.15
this.close();
}
}

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.filter_game_mode_selections;
package com.viaversion.viafabricplus.visuals.injection.mixin.filter_game_mode_selections;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.GameModeSelectionScreen;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
@ -47,11 +47,11 @@ public abstract class MixinGameModeSelectionScreen_GameModeSelection {
@Inject(method = "next", at = @At("HEAD"), cancellable = true)
private void unwrapGameModes(CallbackInfoReturnable<GameModeSelectionScreen.GameModeSelection> cir) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_7_6)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_7_6)) {
switch ((GameModeSelectionScreen.GameModeSelection) (Object) this) {
case CREATIVE -> cir.setReturnValue(SURVIVAL);
case SURVIVAL -> {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
cir.setReturnValue(CREATIVE);
} else {
cir.setReturnValue(GameModeSelectionScreen.GameModeSelection.ADVENTURE);
@ -64,7 +64,7 @@ public abstract class MixinGameModeSelectionScreen_GameModeSelection {
@Inject(method = "getCommand", at = @At("HEAD"), cancellable = true)
private void oldCommand(CallbackInfoReturnable<String> cir) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
cir.setReturnValue(
"gamemode " + MinecraftClient.getInstance().getSession().getUsername() + ' ' + switch (((Enum<?>) (Object) this).ordinal()) {
case 0, 3 -> 1;

View File

@ -19,11 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.filter_non_existing_characters;
package com.viaversion.viafabricplus.visuals.injection.mixin.filter_non_existing_characters;
import com.viaversion.viafabricplus.features.filter_non_existing_characters.RenderableGlyphDiff;
import com.viaversion.viafabricplus.features.filter_non_existing_characters.BuiltinEmptyGlyph1_12_2;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters.RenderableGlyphDiff;
import com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters.BuiltinEmptyGlyph1_12_2;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.*;
import net.minecraft.util.Identifier;

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.filter_non_existing_characters;
package com.viaversion.viafabricplus.visuals.injection.mixin.filter_non_existing_characters;
import com.viaversion.viafabricplus.features.filter_non_existing_characters.UnicodeFontFix1_12_2;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viafabricplus.visuals.features.filter_non_existing_characters.UnicodeFontFix1_12_2;
import net.minecraft.client.resource.language.LanguageManager;
import net.minecraft.resource.ResourceManager;
import org.spongepowered.asm.mixin.Mixin;
@ -35,7 +35,7 @@ public abstract class MixinLanguageManager {
@Inject(method = "reload", at = @At("RETURN"))
private void updateUnicodeFontOverride(ResourceManager manager, CallbackInfo ci) {
UnicodeFontFix1_12_2.updateUnicodeFontOverride(ProtocolTranslator.getTargetVersion());
UnicodeFontFix1_12_2.updateUnicodeFontOverride(ViaFabricPlus.getImpl().getTargetVersion());
}
}

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.networking.legacy_chat_signatures;
package com.viaversion.viafabricplus.visuals.injection.mixin.hud_element_changes;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.gui.hud.MessageIndicator;
import org.spongepowered.asm.mixin.Mixin;

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.networking.legacy_chat_signatures;
package com.viaversion.viafabricplus.visuals.injection.mixin.hud_element_changes;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.gui.hud.ChatHud;
import net.minecraft.client.gui.hud.MessageIndicator;
import net.minecraft.client.gui.screen.ChatScreen;

View File

@ -0,0 +1,41 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.visuals.injection.mixin.hud_element_changes;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ClientPlayerInteractionManager.class)
public abstract class MixinClientPlayerInteractionManager {
@Inject(method = "hasExperienceBar", at = @At("HEAD"), cancellable = true)
private void removeExperienceBar(CallbackInfoReturnable<Boolean> cir) {
if (VisualSettings.INSTANCE.hideModernHUDElements.isEnabled()) {
cir.setReturnValue(false);
}
}
}

View File

@ -19,14 +19,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.hud_element_changes;
package com.viaversion.viafabricplus.visuals.injection.mixin.hud_element_changes;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.InGameHud;

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.instant_sneaking;
package com.viaversion.viafabricplus.visuals.injection.mixin.instant_sneaking;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.render.Camera;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;

View File

@ -0,0 +1,48 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.visuals.injection.mixin.oof_sound;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerEntity.class)
public abstract class MixinPlayerEntity {
@Unique
private static final SoundEvent viaFabricPlus$oof_hurt = SoundEvent.of(Identifier.of("viafabricplus-visuals", "oof.hurt"));
@Inject(method = "getHurtSound", at = @At("HEAD"), cancellable = true)
private void replaceSound(DamageSource source, CallbackInfoReturnable<SoundEvent> cir) {
if (VisualSettings.INSTANCE.replaceHurtSoundWithOOFSound.isEnabled()) {
cir.setReturnValue(viaFabricPlus$oof_hurt);
}
}
}

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.item.missing_model;
package com.viaversion.viafabricplus.visuals.injection.mixin.petrified_oak_slab_model;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.item.ItemModelManager;
import net.minecraft.component.ComponentType;
import net.minecraft.item.ItemStack;

View File

@ -0,0 +1,43 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.visuals.injection.mixin.player_rotations;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.util.math.MathHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(BipedEntityModel.class)
public abstract class MixinBipedEntityModel {
@Redirect(method = "positionBlockingArm", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F"))
private float preventArmFollowingThirdPersonRotation(float value, float min, float max) {
if (VisualSettings.INSTANCE.lockBlockingArmRotation.isEnabled()) {
return 0.0F;
} else {
return MathHelper.clamp(value, min, max);
}
}
}

View File

@ -0,0 +1,68 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.visuals.injection.mixin.player_rotations;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(LivingEntity.class)
public abstract class MixinLivingEntity extends Entity {
@Shadow
public float bodyYaw;
public MixinLivingEntity(EntityType<?> type, World world) {
super(type, world);
}
@Redirect(method = "turnHead", at = @At(value = "INVOKE", target = "Ljava/lang/Math;abs(F)F"))
private float changeBodyRotationInterpolation(float g) {
if (VisualSettings.INSTANCE.changeBodyRotationInterpolation.isEnabled()) {
g = MathHelper.clamp(g, -75.0F, 75.0F);
this.bodyYaw = this.getYaw() - g;
if (Math.abs(g) > 50.0F) {
this.bodyYaw += g * 0.2F;
}
return Float.MIN_VALUE; // Causes the if to always fail
} else {
return Math.abs(g);
}
}
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;abs(F)F"))
private float alwaysRotateWhenWalkingBackwards(float value) {
if (VisualSettings.INSTANCE.sidewaysBackwardsRunning.isEnabled()) {
return 0F;
} else {
return MathHelper.abs(value);
}
}
}

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.remove_newer_screen_features;
package com.viaversion.viafabricplus.visuals.injection.mixin.remove_newer_screen_features;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.block.entity.CommandBlockBlockEntity;
import net.minecraft.client.gui.screen.ingame.CommandBlockScreen;
import net.minecraft.client.gui.widget.CyclingButtonWidget;

View File

@ -19,14 +19,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.remove_newer_screen_features;
package com.viaversion.viafabricplus.visuals.injection.mixin.remove_newer_screen_features;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.OpenToLanScreen;
@ -97,18 +97,18 @@ public abstract class MixinGameMenuScreen extends Screen {
private ButtonWidget replaceButtons(GameMenuScreen instance, Text text, Supplier<Screen> screenSupplier, Operation<ButtonWidget> original) {
if (VisualSettings.INSTANCE.changeGameMenuScreenLayout.getIndex() == 0) {
// Player reporting -> share to lan
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_19) && text.equals(PLAYER_REPORTING_TEXT)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_19) && text.equals(PLAYER_REPORTING_TEXT)) {
final ButtonWidget button = ButtonWidget.builder(SHARE_TO_LAN_TEXT, buttonWidget -> new OpenToLanScreen(instance)).width(NORMAL_BUTTON_WIDTH).build();
button.active = false;
return button;
}
// Advancements -> disconnect
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.b1_4tob1_4_1) && text.equals(ADVANCEMENTS_TEXT)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.b1_4tob1_4_1) && text.equals(ADVANCEMENTS_TEXT)) {
return ButtonWidget.builder(ScreenTexts.DISCONNECT, viaFabricPlus$disconnectSupplier).width(viaFabricPlus$disconnectButtonWidth).build();
}
} else if (VisualSettings.INSTANCE.changeGameMenuScreenLayout.getIndex() == 1) {
// Player reporting -> Social interactions
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_19) && text.equals(PLAYER_REPORTING_TEXT)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_19) && text.equals(PLAYER_REPORTING_TEXT)) {
return createButton(SocialInteractionsScreen.TITLE, () -> new SocialInteractionsScreen(instance));
}
}
@ -117,7 +117,7 @@ public abstract class MixinGameMenuScreen extends Screen {
@WrapWithCondition(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/GameMenuScreen;addFeedbackAndBugsButtons(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/client/gui/widget/GridWidget$Adder;)V"), require = 0)
private boolean removeFeedbackAndBugsButtons(Screen parentScreen, GridWidget.Adder gridAdder) {
return VisualSettings.INSTANCE.changeGameMenuScreenLayout.getIndex() != 0 || ProtocolTranslator.getTargetVersion().newerThan(ProtocolVersion.v1_13_2);
return VisualSettings.INSTANCE.changeGameMenuScreenLayout.getIndex() != 0 || ViaFabricPlus.getImpl().getTargetVersion().newerThan(ProtocolVersion.v1_13_2);
}
@Inject(method = "initWidgets", at = @At("RETURN"))
@ -129,7 +129,7 @@ public abstract class MixinGameMenuScreen extends Screen {
final Consumer<ButtonWidget> moveDown = buttonWidget -> buttonWidget.setY(buttonWidget.getY() + ButtonWidget.DEFAULT_HEIGHT);
// Move all buttons below feebdack/bug down since they are removed
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_13_2)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_13_2)) {
viaFabricPlus$applyTo(OPTIONS_TEXT, moveDown);
viaFabricPlus$applyTo(SHARE_TO_LAN_TEXT, moveDown);
viaFabricPlus$applyTo(ScreenTexts.DISCONNECT, moveDown);
@ -142,7 +142,7 @@ public abstract class MixinGameMenuScreen extends Screen {
}
// Make options button wider since lan is removed
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
viaFabricPlus$applyTo(OPTIONS_TEXT, buttonWidget -> {
buttonWidget.setX(returnToGame.getX());
buttonWidget.setWidth(returnToGame.getWidth());
@ -150,7 +150,7 @@ public abstract class MixinGameMenuScreen extends Screen {
}
// Make space between return to game and options, put disconnect button below options
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.b1_4tob1_4_1)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.b1_4tob1_4_1)) {
viaFabricPlus$applyTo(OPTIONS_TEXT, moveDown);
viaFabricPlus$applyTo(ScreenTexts.DISCONNECT, buttonWidget -> {
// Magical offset which would be calculated by the grid system, nothing we can do about it
@ -167,12 +167,12 @@ public abstract class MixinGameMenuScreen extends Screen {
// Mods could add other widgets as well
if (widget instanceof ButtonWidget button) {
// Remove buttons and track their width/press action for later, mods might be injecting into them
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) {
if (button.getMessage().equals(SHARE_TO_LAN_TEXT)) {
return false;
}
}
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.b1_4tob1_4_1)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(LegacyProtocolVersion.b1_4tob1_4_1)) {
if (button.getMessage().equals(STATS_TEXT)) {
return false;
} else if (button.getMessage().equals(ScreenTexts.DISCONNECT)) {

View File

@ -19,11 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.remove_newer_screen_features;
package com.viaversion.viafabricplus.visuals.injection.mixin.remove_newer_screen_features;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.block.entity.JigsawBlockEntity;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
@ -65,11 +65,11 @@ public abstract class MixinJigsawBlockScreen extends Screen {
if (!VisualSettings.INSTANCE.hideModernJigsawScreenFeatures.getValue()) {
return;
}
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_2)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_2)) {
selectionPriorityField.active = false;
placementPriorityField.active = false;
}
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
nameField.active = false;
jointRotationButton.active = false;
int index = children().indexOf(jointRotationButton);
@ -81,7 +81,7 @@ public abstract class MixinJigsawBlockScreen extends Screen {
@Inject(method = "render", at = @At("HEAD"))
private void copyText(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (VisualSettings.INSTANCE.hideModernJigsawScreenFeatures.getValue() && ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
if (VisualSettings.INSTANCE.hideModernJigsawScreenFeatures.getValue() && ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_15_2)) {
nameField.setText(targetField.getText());
}
}

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.remove_newer_screen_features;
package com.viaversion.viafabricplus.visuals.injection.mixin.remove_newer_screen_features;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.Element;

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.remove_newer_screen_features;
package com.viaversion.viafabricplus.visuals.injection.mixin.remove_newer_screen_features;
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.text.Text;
@ -40,7 +40,7 @@ public abstract class MixinStructureBlockScreen_1 extends TextFieldWidget {
@Inject(method = "charTyped(CI)Z", at = @At("HEAD"), cancellable = true)
private void removeValidation(char chr, int keyCode, CallbackInfoReturnable<Boolean> ci) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
if (ViaFabricPlus.getImpl().getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_12_2)) {
ci.setReturnValue(super.charTyped(chr, keyCode));
}
}

View File

@ -0,0 +1,41 @@
/*
* This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
* Copyright (C) 2021-2024 the original authors
* - FlorianMichael/EnZaXD <florian.michael07@gmail.com>
* - RK_01/RaphiMC
* Copyright (C) 2023-2024 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.visuals.injection.mixin.secure_chat_warning;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ClientPlayNetworkHandler.class)
public abstract class MixinClientPlayNetworkHandler {
@Shadow protected abstract boolean isSecureChatEnforced();
@Redirect(method = "onGameJoin", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;isSecureChatEnforced()Z"))
private boolean removeSecureChatWarning(ClientPlayNetworkHandler instance) {
return isSecureChatEnforced() || VisualSettings.INSTANCE.disableSecureChatWarning.isEnabled();
}
}

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.item.v1_7_tilt;
package com.viaversion.viafabricplus.visuals.injection.mixin.v1_7_item_tilt;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.item.HeldItemRenderer;

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.v1_7_tab_list_style;
package com.viaversion.viafabricplus.visuals.injection.mixin.v1_7_tab_list_style;
import com.viaversion.viafabricplus.features.ui.v1_7_tab_list_style.LegacyTabList;
import com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style.IPlayerListHud;
import com.viaversion.viafabricplus.visuals.features.v1_7_tab_list_style.LegacyTabList;
import com.viaversion.viafabricplus.visuals.injection.access.IPlayerListHud;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;

View File

@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.v1_7_tab_list_style;
package com.viaversion.viafabricplus.visuals.injection.mixin.v1_7_tab_list_style;
import com.viaversion.viafabricplus.features.ui.v1_7_tab_list_style.LegacyTabList;
import com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style.IPlayerListEntry;
import com.viaversion.viafabricplus.visuals.features.v1_7_tab_list_style.LegacyTabList;
import com.viaversion.viafabricplus.visuals.injection.access.IPlayerListEntry;
import net.minecraft.client.network.PlayerListEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

View File

@ -19,12 +19,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.features.ui.v1_7_tab_list_style;
package com.viaversion.viafabricplus.visuals.injection.mixin.v1_7_tab_list_style;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style.IPlayerListEntry;
import com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style.IPlayerListHud;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.injection.access.IPlayerListEntry;
import com.viaversion.viafabricplus.visuals.injection.access.IPlayerListHud;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.PlayerListHud;
import net.minecraft.client.network.PlayerListEntry;

View File

@ -19,9 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.entity;
package com.viaversion.viafabricplus.visuals.injection.mixin.villager_profession;
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
import net.minecraft.client.render.entity.feature.VillagerClothingFeatureRenderer;
import net.minecraft.village.VillagerData;
import net.minecraft.village.VillagerProfession;

View File

@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viafabricplus.settings.impl;
package com.viaversion.viafabricplus.visuals.settings;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.api.settings.type.BooleanSetting;

View File

@ -0,0 +1,57 @@
{
"schemaVersion": 1,
"id": "viafabricplus-visuals",
"version": "${version}",
"name": "ViaFabricPlus Visuals",
"description": "${description}",
"authors": [
{
"name": "FlorianMichael/EnZaXD",
"contact": {
"email": "florian.michael07@gmail.com",
"homepage": "https://github.com/FlorianMichael"
}
},
{
"name": "RK_01",
"contact": {
"homepage": "https://github.com/RaphiMC"
}
}
],
"contributors": [
"allinkdev",
"lowercasebtw",
{
"name": "GitHub contributors",
"contact": {
"homepage": "https://github.com/ViaVersion/ViaFabricPlus/graphs/contributors"
}
}
],
"contact": {
"homepage": "https://florianmichael.de/",
"sources": "https://github.com/ViaVersion/ViaFabricPlus",
"issues": "https://github.com/ViaVersion/ViaFabricPlus/issues",
"email": "florian.michael07@gmail.com"
},
"license": "GPL-v3",
"environment": "client",
"entrypoints": {
"viafabricplus": [
"com.viaversion.viafabricplus.visuals.ViaFabricPlusVisuals"
]
},
"mixins": [
"viafabricplus-visuals.mixins.json"
],
"accessWidener": "viafabricplus-visuals.accesswidener",
"depends": {
"viafabricplus": ">=4.0.0"
},
"custom": {
"modmenu": {
"parent": "viafabricplus"
}
}
}

View File

@ -0,0 +1,16 @@
accessWidener v1 named
accessible field net/minecraft/client/MinecraftClient fontManager Lnet/minecraft/client/font/FontManager;
accessible field net/minecraft/client/font/FontManager fontStorages Ljava/util/Map;
accessible field net/minecraft/client/font/FontStorage bakedGlyphCache Lnet/minecraft/client/font/GlyphContainer;
accessible field net/minecraft/client/font/FontStorage glyphCache Lnet/minecraft/client/font/GlyphContainer;
accessible field net/minecraft/client/resource/language/TranslationStorage translations Ljava/util/Map;
accessible field net/minecraft/client/gui/screen/multiplayer/SocialInteractionsScreen TITLE Lnet/minecraft/text/Text;
accessible field net/minecraft/client/gui/screen/world/WorldIcon UNKNOWN_SERVER_ID Lnet/minecraft/util/Identifier;
accessible field net/minecraft/client/font/FontStorage$GlyphPair MISSING Lnet/minecraft/client/font/FontStorage$GlyphPair;
accessible field net/minecraft/client/gui/widget/TexturedButtonWidget textures Lnet/minecraft/client/gui/screen/ButtonTextures;
accessible method net/minecraft/client/font/FontStorage$GlyphPair <init> (Lnet/minecraft/client/font/Glyph;Lnet/minecraft/client/font/Glyph;)V
accessible class net/minecraft/client/font/FontStorage$GlyphPair
accessible class net/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection

View File

@ -0,0 +1,41 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.viaversion.viafabricplus.visuals.injection.mixin",
"compatibilityLevel": "JAVA_21",
"client": [
"classic_creative_menu.MixinCreativeInventoryScreen",
"classic_walking_animation.MixinBipedEntityModel",
"disable_server_pinging.MixinMultiplayerServerListWidget_ServerEntry",
"downloading_terrain_transitions.MixinDownloadingTerrainScreen",
"filter_game_mode_selections.MixinGameModeSelectionScreen",
"filter_game_mode_selections.MixinGameModeSelectionScreen_GameModeSelection",
"filter_non_existing_characters.MixinFontStorage",
"filter_non_existing_characters.MixinLanguageManager",
"hud_element_changes.MixinChatHud",
"hud_element_changes.MixinChatScreen",
"hud_element_changes.MixinClientPlayerInteractionManager",
"hud_element_changes.MixinInGameHud",
"oof_sound.MixinPlayerEntity",
"petrified_oak_slab_model.MixinItemRenderer",
"player_rotations.MixinBipedEntityModel",
"player_rotations.MixinLivingEntity",
"remove_newer_screen_features.MixinCommandBlockScreen",
"remove_newer_screen_features.MixinGameMenuScreen",
"remove_newer_screen_features.MixinJigsawBlockScreen",
"remove_newer_screen_features.MixinScreen",
"remove_newer_screen_features.MixinStructureBlockScreen_1",
"secure_chat_warning.MixinClientPlayNetworkHandler",
"v1_7_item_tilt.MixinHeldItemRenderer",
"v1_7_tab_list_style.MixinClientPlayNetworkHandler",
"v1_7_tab_list_style.MixinPlayerListEntry",
"v1_7_tab_list_style.MixinPlayerListHud",
"villager_profession.MixinVillagerClothingFeatureRenderer"
],
"injectors": {
"defaultRequire": 1
},
"overwrites": {
"requireAnnotations": true
}
}