5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.api.entrypoint;
23 |
24 | import com.viaversion.viafabricplus.api.ViaFabricPlusBase;
25 | import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
26 |
27 | /**
28 | * Optional Entrypoint called before the ViaFabricPlus loading cycle starts. This is needed to register a {@link LoadingCycleCallback} callback.
29 | *
30 | * See {@link LoadingCycleCallback} for more information.
31 | */
32 | @FunctionalInterface
33 | public interface ViaFabricPlusLoadEntrypoint {
34 |
35 | String KEY = "viafabricplus";
36 |
37 | void onPlatformLoad(final ViaFabricPlusBase platform);
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/viafabricplus-api/src/main/java/com/viaversion/viafabricplus/api/events/ChangeProtocolVersionCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.api.events;
23 |
24 | import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
25 |
26 | /**
27 | * This event is fired when the user changes the target version in the screen, or if the user joins a server with a different version.
28 | * If the user disconnects, the event will also be fired with the current version.
29 | */
30 | public interface ChangeProtocolVersionCallback {
31 |
32 | void onChangeProtocolVersion(final ProtocolVersion oldVersion, final ProtocolVersion newVersion);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/viafabricplus-api/src/main/java/com/viaversion/viafabricplus/api/settings/type/BooleanSetting.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.api.settings.type;
23 |
24 | import com.google.gson.JsonObject;
25 | import com.viaversion.viafabricplus.api.settings.AbstractSetting;
26 | import com.viaversion.viafabricplus.api.settings.SettingGroup;
27 | import net.minecraft.text.MutableText;
28 |
29 | public class BooleanSetting extends AbstractSetting {
30 |
31 | public BooleanSetting(SettingGroup parent, MutableText name, Boolean defaultValue) {
32 | super(parent, name, defaultValue);
33 | }
34 |
35 | @Override
36 | public void write(JsonObject object) {
37 | object.addProperty(getTranslationKey(), getValue());
38 | }
39 |
40 | @Override
41 | public void read(JsonObject object) {
42 | setValue(object.get(getTranslationKey()).getAsBoolean());
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/viafabricplus-api/src/main/java/com/viaversion/viafabricplus/api/settings/type/ButtonSetting.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.api.settings.type;
23 |
24 | import com.google.gson.JsonObject;
25 | import com.viaversion.viafabricplus.api.settings.AbstractSetting;
26 | import com.viaversion.viafabricplus.api.settings.SettingGroup;
27 | import net.minecraft.text.MutableText;
28 |
29 | public class ButtonSetting extends AbstractSetting {
30 |
31 | public ButtonSetting(SettingGroup parent, MutableText name, Runnable onClick) {
32 | super(parent, name, onClick);
33 | }
34 |
35 |
36 | public MutableText displayValue() {
37 | return getName();
38 | }
39 |
40 | @Override
41 | public void write(JsonObject object) {
42 | }
43 |
44 | @Override
45 | public void read(JsonObject object) {
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/viafabricplus-api/src/main/resources/fabric.mod.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "id": "viafabricplus-api",
4 | "version": "${version}",
5 | "name": "ViaFabricPlus API",
6 | "description": "${description}",
7 | "authors": [
8 | {
9 | "name": "FlorianMichael/EnZaXD",
10 | "contact": {
11 | "email": "florian.michael07@gmail.com",
12 | "homepage": "https://github.com/FlorianMichael"
13 | }
14 | },
15 | {
16 | "name": "RK_01",
17 | "contact": {
18 | "homepage": "https://github.com/RaphiMC"
19 | }
20 | }
21 | ],
22 | "contributors": [
23 | "allinkdev",
24 | "lowercasebtw",
25 | {
26 | "name": "GitHub contributors",
27 | "contact": {
28 | "homepage": "https://github.com/ViaVersion/ViaFabricPlus/graphs/contributors"
29 | }
30 | }
31 | ],
32 | "contact": {
33 | "homepage": "https://florianmichael.de/",
34 | "sources": "https://github.com/ViaVersion/ViaFabricPlus",
35 | "issues": "https://github.com/ViaVersion/ViaFabricPlus/issues",
36 | "email": "florian.michael07@gmail.com"
37 | },
38 | "license": "GPL-v3",
39 | "environment": "client",
40 | "depends": {
41 | "viafabricplus": ">=4.1.4"
42 | },
43 | "custom": {
44 | "modmenu": {
45 | "parent": "viafabricplus"
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import de.florianmichael.baseproject.*
2 |
3 | dependencies {
4 | loadFabricApiModules("fabric-lifecycle-events-v1")
5 | compileOnly(project(":viafabricplus-api"))
6 | }
7 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/gradle.properties:
--------------------------------------------------------------------------------
1 | project_description=Additional mod for ViaFabricPlus to add visual-only changes.
2 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/features/force_unicode_font/LanguageUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.features.force_unicode_font;
23 |
24 | import java.util.Map;
25 |
26 | public final class LanguageUtil {
27 |
28 | private static final int NON_ASCII_THRESHOLD = 256;
29 |
30 | public static boolean isUnicodeFont1_12_2(final Map translations) {
31 | int nonAsciiCharacters = 0;
32 | int totalCharacters = 0;
33 |
34 | for (String value : translations.values()) {
35 | totalCharacters += value.length();
36 | for (int i = 0; i < value.length(); ++i) {
37 | if (value.charAt(i) >= NON_ASCII_THRESHOLD) {
38 | nonAsciiCharacters++;
39 | }
40 | }
41 | }
42 |
43 | return (float) nonAsciiCharacters / totalCharacters > 0.1;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/features/r1_7_tab_list_style/LegacyTabList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.features.r1_7_tab_list_style;
23 |
24 | public final class LegacyTabList {
25 |
26 | /**
27 | * An incremental index used for tablist entries to implement FIFO behavior in Minecraft versions up to 1.7.
28 | */
29 | public static int globalTablistIndex = 0;
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/access/r1_7_tab_list_tyle/IPlayerListEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.access.r1_7_tab_list_tyle;
23 |
24 | public interface IPlayerListEntry {
25 |
26 | int viaFabricPlusVisuals$getIndex();
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/access/r1_7_tab_list_tyle/IPlayerListHud.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.access.r1_7_tab_list_tyle;
23 |
24 | public interface IPlayerListHud {
25 |
26 | void viaFabricPlusVisuals$setMaxPlayers(final int maxPlayers);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/mixin/force_unicode_font/MixinLanguageManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.mixin.force_unicode_font;
23 |
24 | import com.viaversion.viafabricplus.ViaFabricPlus;
25 | import com.viaversion.viafabricplus.visuals.features.force_unicode_font.UnicodeFontFix1_12_2;
26 | import net.minecraft.client.resource.language.LanguageManager;
27 | import net.minecraft.resource.ResourceManager;
28 | import org.spongepowered.asm.mixin.Mixin;
29 | import org.spongepowered.asm.mixin.injection.At;
30 | import org.spongepowered.asm.mixin.injection.Inject;
31 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
32 |
33 | @Mixin(LanguageManager.class)
34 | public abstract class MixinLanguageManager {
35 |
36 | @Inject(method = "reload", at = @At("RETURN"))
37 | private void updateUnicodeFontOverride(ResourceManager manager, CallbackInfo ci) {
38 | UnicodeFontFix1_12_2.updateUnicodeFontOverride(ViaFabricPlus.getImpl().getTargetVersion());
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/mixin/hud_element_changes/MixinChatHud.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.mixin.hud_element_changes;
23 |
24 | import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
25 | import net.minecraft.client.gui.hud.ChatHud;
26 | import net.minecraft.client.gui.hud.MessageIndicator;
27 | import org.spongepowered.asm.mixin.Mixin;
28 | import org.spongepowered.asm.mixin.injection.At;
29 | import org.spongepowered.asm.mixin.injection.ModifyVariable;
30 |
31 | @Mixin(ChatHud.class)
32 | public abstract class MixinChatHud {
33 |
34 | @ModifyVariable(method = "addMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/client/gui/hud/MessageIndicator;)V", at = @At("HEAD"), ordinal = 0, argsOnly = true)
35 | private MessageIndicator removeIndicator(MessageIndicator instance) {
36 | return VisualSettings.INSTANCE.hideSignatureIndicator.isEnabled() ? null : instance;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/mixin/hud_element_changes/MixinClientPlayerInteractionManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.mixin.hud_element_changes;
23 |
24 | import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
25 | import net.minecraft.client.network.ClientPlayerInteractionManager;
26 | import org.spongepowered.asm.mixin.Mixin;
27 | import org.spongepowered.asm.mixin.injection.At;
28 | import org.spongepowered.asm.mixin.injection.Inject;
29 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
30 |
31 | @Mixin(ClientPlayerInteractionManager.class)
32 | public abstract class MixinClientPlayerInteractionManager {
33 |
34 | @Inject(method = "hasExperienceBar", at = @At("HEAD"), cancellable = true)
35 | private void removeExperienceBar(CallbackInfoReturnable cir) {
36 | if (VisualSettings.INSTANCE.hideModernHUDElements.isEnabled()) {
37 | cir.setReturnValue(false);
38 | }
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/mixin/player_rotations/MixinBipedEntityModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.mixin.player_rotations;
23 |
24 | import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
25 | import net.minecraft.client.render.entity.model.BipedEntityModel;
26 | import net.minecraft.util.math.MathHelper;
27 | import org.spongepowered.asm.mixin.Mixin;
28 | import org.spongepowered.asm.mixin.injection.At;
29 | import org.spongepowered.asm.mixin.injection.Redirect;
30 |
31 | @Mixin(BipedEntityModel.class)
32 | public abstract class MixinBipedEntityModel {
33 |
34 | @Redirect(method = "positionBlockingArm", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F"))
35 | private float preventArmFollowingThirdPersonRotation(float value, float min, float max) {
36 | if (VisualSettings.INSTANCE.lockBlockingArmRotation.isEnabled()) {
37 | return 0.0F;
38 | } else {
39 | return MathHelper.clamp(value, min, max);
40 | }
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/mixin/potion_glint/MixinPotionItem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.mixin.potion_glint;
23 |
24 | import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
25 | import net.minecraft.component.DataComponentTypes;
26 | import net.minecraft.component.type.PotionContentsComponent;
27 | import net.minecraft.item.Item;
28 | import net.minecraft.item.ItemStack;
29 | import net.minecraft.item.PotionItem;
30 | import org.spongepowered.asm.mixin.Mixin;
31 |
32 | @Mixin(PotionItem.class)
33 | public abstract class MixinPotionItem extends Item {
34 |
35 | public MixinPotionItem(final Settings settings) {
36 | super(settings);
37 | }
38 |
39 | @Override
40 | public boolean hasGlint(final ItemStack stack) {
41 | if (VisualSettings.INSTANCE.potionEnchantmentGlint.isEnabled()) {
42 | return stack.getOrDefault(DataComponentTypes.POTION_CONTENTS, PotionContentsComponent.DEFAULT).hasEffects();
43 | } else {
44 | return super.hasGlint(stack);
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/mixin/r1_7_tab_list_style/MixinPlayerListEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.mixin.r1_7_tab_list_style;
23 |
24 | import com.viaversion.viafabricplus.visuals.features.r1_7_tab_list_style.LegacyTabList;
25 | import com.viaversion.viafabricplus.visuals.injection.access.r1_7_tab_list_tyle.IPlayerListEntry;
26 | import net.minecraft.client.network.PlayerListEntry;
27 | import org.spongepowered.asm.mixin.Mixin;
28 | import org.spongepowered.asm.mixin.Unique;
29 |
30 | @Mixin(PlayerListEntry.class)
31 | public abstract class MixinPlayerListEntry implements IPlayerListEntry {
32 |
33 | @Unique
34 | private final int viaFabricPlusVisuals$index = LegacyTabList.globalTablistIndex++;
35 |
36 | @Override
37 | public int viaFabricPlusVisuals$getIndex() {
38 | return viaFabricPlusVisuals$index;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/java/com/viaversion/viafabricplus/visuals/injection/mixin/secure_chat_warning/MixinClientPlayNetworkHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaFabricPlus - https://github.com/ViaVersion/ViaFabricPlus
3 | * Copyright (C) 2021-2025 the original authors
4 | * - FlorianMichael/EnZaXD
5 | * - RK_01/RaphiMC
6 | * Copyright (C) 2023-2025 ViaVersion and contributors
7 | *
8 | * This program is free software: you can redistribute it and/or modify
9 | * it under the terms of the GNU General Public License as published by
10 | * the Free Software Foundation, either version 3 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program. If not, see .
20 | */
21 |
22 | package com.viaversion.viafabricplus.visuals.injection.mixin.secure_chat_warning;
23 |
24 | import com.viaversion.viafabricplus.visuals.settings.VisualSettings;
25 | import net.minecraft.client.network.ClientPlayNetworkHandler;
26 | import org.spongepowered.asm.mixin.Mixin;
27 | import org.spongepowered.asm.mixin.Shadow;
28 | import org.spongepowered.asm.mixin.injection.At;
29 | import org.spongepowered.asm.mixin.injection.Redirect;
30 |
31 | @Mixin(ClientPlayNetworkHandler.class)
32 | public abstract class MixinClientPlayNetworkHandler {
33 |
34 | @Shadow
35 | protected abstract boolean isSecureChatEnforced();
36 |
37 | @Redirect(method = "onGameJoin", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;isSecureChatEnforced()Z"))
38 | private boolean removeSecureChatWarning(ClientPlayNetworkHandler instance) {
39 | return isSecureChatEnforced() || VisualSettings.INSTANCE.disableSecureChatWarning.isEnabled();
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/resources/assets/viafabricplus-visuals/sounds.json:
--------------------------------------------------------------------------------
1 | {
2 | "oof.hurt": {
3 | "sounds": [
4 | "viafabricplus-visuals:oof_hurt"
5 | ]
6 | }
7 | }
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/resources/assets/viafabricplus-visuals/sounds/oof_hurt.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ViaVersion/ViaFabricPlus/7352f1bc85873cf943278ced131251ae74387c2c/viafabricplus-visuals/src/main/resources/assets/viafabricplus-visuals/sounds/oof_hurt.ogg
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/resources/fabric.mod.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "id": "viafabricplus-visuals",
4 | "version": "${version}",
5 | "name": "ViaFabricPlus Visuals",
6 | "description": "${description}",
7 | "authors": [
8 | {
9 | "name": "FlorianMichael/EnZaXD",
10 | "contact": {
11 | "email": "florian.michael07@gmail.com",
12 | "homepage": "https://github.com/FlorianMichael"
13 | }
14 | },
15 | {
16 | "name": "RK_01",
17 | "contact": {
18 | "homepage": "https://github.com/RaphiMC"
19 | }
20 | }
21 | ],
22 | "contributors": [
23 | "allinkdev",
24 | "lowercasebtw",
25 | {
26 | "name": "GitHub contributors",
27 | "contact": {
28 | "homepage": "https://github.com/ViaVersion/ViaFabricPlus/graphs/contributors"
29 | }
30 | }
31 | ],
32 | "contact": {
33 | "homepage": "https://florianmichael.de/",
34 | "sources": "https://github.com/ViaVersion/ViaFabricPlus",
35 | "issues": "https://github.com/ViaVersion/ViaFabricPlus/issues",
36 | "email": "florian.michael07@gmail.com"
37 | },
38 | "license": "GPL-v3",
39 | "environment": "client",
40 | "entrypoints": {
41 | "viafabricplus": [
42 | "com.viaversion.viafabricplus.visuals.ViaFabricPlusVisuals"
43 | ]
44 | },
45 | "mixins": [
46 | "viafabricplus-visuals.mixins.json"
47 | ],
48 | "accessWidener": "viafabricplus-visuals.accesswidener",
49 | "depends": {
50 | "viafabricplus": ">=4.1.4"
51 | },
52 | "custom": {
53 | "modmenu": {
54 | "parent": "viafabricplus"
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/resources/viafabricplus-visuals.accesswidener:
--------------------------------------------------------------------------------
1 | accessWidener v1 named
2 |
3 | accessible field net/minecraft/client/resource/language/TranslationStorage translations Ljava/util/Map;
4 | accessible field net/minecraft/client/gui/screen/multiplayer/SocialInteractionsScreen TITLE Lnet/minecraft/text/Text;
5 | accessible field net/minecraft/client/gui/widget/TexturedButtonWidget textures Lnet/minecraft/client/gui/screen/ButtonTextures;
6 | accessible field net/minecraft/client/font/FontStorage$GlyphPair MISSING Lnet/minecraft/client/font/FontStorage$GlyphPair;
7 |
8 | accessible method net/minecraft/client/font/FontStorage$GlyphPair (Lnet/minecraft/client/font/Glyph;Lnet/minecraft/client/font/Glyph;)V
9 |
10 | accessible class net/minecraft/client/gui/screen/GameModeSwitcherScreen$GameModeSelection
11 | accessible class net/minecraft/client/font/TextRenderer$Drawer
12 | accessible class net/minecraft/client/font/FontStorage$GlyphPair
13 |
--------------------------------------------------------------------------------
/viafabricplus-visuals/src/main/resources/viafabricplus-visuals.mixins.json:
--------------------------------------------------------------------------------
1 | {
2 | "required": true,
3 | "minVersion": "0.8",
4 | "package": "com.viaversion.viafabricplus.visuals.injection.mixin",
5 | "compatibilityLevel": "JAVA_21",
6 | "client": [
7 | "classic.creative_menu.MixinCreativeInventoryScreen",
8 | "classic.walking_animation.MixinBipedEntityModel",
9 | "downloading_terrain_transitions.MixinDownloadingTerrainScreen",
10 | "filter_game_mode_selections.MixinGameModeSwitcherScreen",
11 | "filter_game_mode_selections.MixinGameModeSwitcherScreen_GameModeSelection",
12 | "force_unicode_font.MixinLanguageManager",
13 | "hud_element_changes.MixinChatHud",
14 | "hud_element_changes.MixinChatScreen",
15 | "hud_element_changes.MixinClientPlayerInteractionManager",
16 | "hud_element_changes.MixinInGameHud",
17 | "instant_sneaking.MixinCamera",
18 | "oof_sound.MixinPlayerEntity",
19 | "petrified_oak_slab_model.MixinItemRenderer",
20 | "player_rotations.MixinBipedEntityModel",
21 | "player_rotations.MixinLivingEntity",
22 | "potion_glint.MixinPotionItem",
23 | "r1_7_item_tilt.MixinHeldItemRenderer",
24 | "r1_7_tab_list_style.MixinClientPlayNetworkHandler",
25 | "r1_7_tab_list_style.MixinPlayerListEntry",
26 | "r1_7_tab_list_style.MixinPlayerListHud",
27 | "remove_newer_screen_features.MixinGameMenuScreen",
28 | "remove_newer_screen_features.MixinScreen",
29 | "secure_chat_warning.MixinClientPlayNetworkHandler",
30 | "strike_through_offset.MixinTextRenderer_Drawer",
31 | "villager_profession.MixinVillagerClothingFeatureRenderer"
32 | ],
33 | "injectors": {
34 | "defaultRequire": 1
35 | },
36 | "overwrites": {
37 | "requireAnnotations": true
38 | }
39 | }
40 |
--------------------------------------------------------------------------------