diff --git a/README.md b/README.md index 7114c02a..6fe70128 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,3 @@ ViaFabricPlus splits into three major parts: |-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ViaFabricPlus | Core of the project, all fixes here are stable and have been tested many times | | ViaFabricPlus-Visual | Addon for the core, it adds only visual changes between the versions like old textures,
optional and not necessary for the gameplay, but recommended. | -| ViaFabricPlus-Emulation | Addon for the Core, this addon is for all for the 1.8 and 1.12 protocol, here it adds complete emulations of the Raytrace or also Movement,
to consider is that this breaks much mod incompatibility and is also very experimental | diff --git a/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/ViaFabricPlusVisual.java b/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/ViaFabricPlusVisual.java index 08e9040b..62361f7f 100644 --- a/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/ViaFabricPlusVisual.java +++ b/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/ViaFabricPlusVisual.java @@ -36,11 +36,15 @@ public class ViaFabricPlusVisual implements ClientModInitializer { // 1.19 -> 1.18.2 public final static ProtocolSyncBooleanValue hideSignatureIndicator = new ProtocolSyncBooleanValue("Hide signature indicator", ProtocolRange.andOlder(ProtocolVersion.v1_18_2)); + // 1.16 -> 1.15.2 + public final static ProtocolSyncBooleanValue removeNewerFeaturesFromJigsawScreen = new ProtocolSyncBooleanValue("Remove newer features from Jigsaw screen", ProtocolRange.andOlder(ProtocolVersion.v1_15_2)); + // 1.13 -> 1.12.2 public final static ProtocolSyncBooleanValue replacePetrifiedOakSlab = new ProtocolSyncBooleanValue("Replace petrified oak slab", new ProtocolRange(ProtocolVersion.v1_12_2, LegacyProtocolVersion.r1_3_1tor1_3_2)); // 1.9 -> 1.8.x public final static ProtocolSyncBooleanValue emulateArmorHud = new ProtocolSyncBooleanValue("Emulate Armor hud", ProtocolRange.andOlder(ProtocolVersion.v1_8)); + public final static ProtocolSyncBooleanValue removeNewerFeaturesFromCommandBlockScreen = new ProtocolSyncBooleanValue("Remove newer features from Command block screen", ProtocolRange.andOlder(ProtocolVersion.v1_8)); @Override public void onInitializeClient() { diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/screen/MixinCommandBlockScreen.java b/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/injection/mixin/MixinCommandBlockScreen.java similarity index 68% rename from src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/screen/MixinCommandBlockScreen.java rename to ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/injection/mixin/MixinCommandBlockScreen.java index b6034996..44b9fbb4 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/screen/MixinCommandBlockScreen.java +++ b/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/injection/mixin/MixinCommandBlockScreen.java @@ -1,16 +1,3 @@ -/* - * Copyright (c) FlorianMichael as EnZaXD 2022 - * Created on 6/24/22, 8:47 PM - * - * --FLORIAN MICHAEL PRIVATE LICENCE v1.0-- - * - * This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD), - * any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this - * file / project is prohibited. It requires in that use a written permission with official signature of the owner - * "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not - * cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected. - * The owner "Florian Michael" is free to change this license. - */ /** * --FLORIAN MICHAEL PRIVATE LICENCE v1.2-- * @@ -32,10 +19,9 @@ * Version-independent validity and automatic renewal */ -package de.florianmichael.viafabricplus.injection.mixin.fixes.screen; +package de.florianmichael.viafabricplus_visual.injection.mixin; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import de.florianmichael.vialoadingbase.ViaLoadingBase; +import de.florianmichael.viafabricplus_visual.ViaFabricPlusVisual; import net.minecraft.block.entity.CommandBlockBlockEntity; import net.minecraft.client.gui.screen.ingame.CommandBlockScreen; import net.minecraft.client.gui.widget.CyclingButtonWidget; @@ -61,7 +47,7 @@ public abstract class MixinCommandBlockScreen { @Inject(method = "init", at = @At("TAIL")) private void injectInit(CallbackInfo ci) { - if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ViaFabricPlusVisual.removeNewerFeaturesFromCommandBlockScreen.getValue()) { modeButton.visible = false; conditionalModeButton.visible = false; redstoneTriggerButton.visible = false; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/screen/MixinJigsawBlockScreen.java b/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/injection/mixin/MixinJigsawBlockScreen.java similarity index 71% rename from src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/screen/MixinJigsawBlockScreen.java rename to ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/injection/mixin/MixinJigsawBlockScreen.java index b9df8b1d..38446d7d 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/screen/MixinJigsawBlockScreen.java +++ b/ViaFabricPlus-Visual/src/main/java/de/florianmichael/viafabricplus_visual/injection/mixin/MixinJigsawBlockScreen.java @@ -1,16 +1,3 @@ -/* - * Copyright (c) FlorianMichael as EnZaXD 2022 - * Created on 6/24/22, 8:49 PM - * - * --FLORIAN MICHAEL PRIVATE LICENCE v1.0-- - * - * This file / project is protected and is the intellectual property of Florian Michael (aka. EnZaXD), - * any use (be it private or public, be it copying or using for own use, be it publishing or modifying) of this - * file / project is prohibited. It requires in that use a written permission with official signature of the owner - * "Florian Michael". "Florian Michael" receives the right to control and manage this file / project. This right is not - * cancelled by copying or removing the license and in case of violation a criminal consequence is to be expected. - * The owner "Florian Michael" is free to change this license. - */ /** * --FLORIAN MICHAEL PRIVATE LICENCE v1.2-- * @@ -32,10 +19,9 @@ * Version-independent validity and automatic renewal */ -package de.florianmichael.viafabricplus.injection.mixin.fixes.screen; +package de.florianmichael.viafabricplus_visual.injection.mixin; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import de.florianmichael.vialoadingbase.ViaLoadingBase; +import de.florianmichael.viafabricplus_visual.ViaFabricPlusVisual; import net.minecraft.block.entity.JigsawBlockEntity; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.ingame.JigsawBlockScreen; @@ -68,7 +54,7 @@ public class MixinJigsawBlockScreen extends Screen { @Inject(method = "init", at = @At("RETURN")) public void injectInit(CallbackInfo ci) { - if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ViaFabricPlusVisual.removeNewerFeaturesFromJigsawScreen.getValue()) { nameField.active = false; jointRotationButton.active = false; int index = children().indexOf(jointRotationButton); @@ -80,7 +66,7 @@ public class MixinJigsawBlockScreen extends Screen { @Inject(method = "render", at = @At("HEAD")) public void injectRender(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { - if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ViaFabricPlusVisual.removeNewerFeaturesFromJigsawScreen.getValue()) { nameField.setText(targetField.getText()); } } diff --git a/ViaFabricPlus-Visual/src/main/resources/viafabricplus-visual.mixins.json b/ViaFabricPlus-Visual/src/main/resources/viafabricplus-visual.mixins.json index 9a07e38b..41b800d0 100644 --- a/ViaFabricPlus-Visual/src/main/resources/viafabricplus-visual.mixins.json +++ b/ViaFabricPlus-Visual/src/main/resources/viafabricplus-visual.mixins.json @@ -4,15 +4,15 @@ "package": "de.florianmichael.viafabricplus_visual.injection.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ - ], - "injectors": { - "defaultRequire": 1 - }, - "client": [ "MixinChatHud", "MixinChatScreen", "MixinClientPlayerEntity", "MixinClientPlayNetworkHandler", - "MixinItemRenderer" - ] + "MixinCommandBlockScreen", + "MixinItemRenderer", + "MixinJigsawBlockScreen" + ], + "injectors": { + "defaultRequire": 1 + } } diff --git a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java index 8735938d..1596000a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java +++ b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java @@ -52,11 +52,6 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -/** - * TODO - * - Add ViaFabricPlus-Visual - * - Add ViaFabricPlus-Emulation - */ public class ViaFabricPlus { public final static File RUN_DIRECTORY = new File("ViaFabricPlus"); public final static AttributeKey LOCAL_USER_CONNECTION = AttributeKey.newInstance("viafabricplus-via-connection"); diff --git a/src/main/resources/viafabricplus.mixins.json b/src/main/resources/viafabricplus.mixins.json index 5fb1157e..40970ef9 100644 --- a/src/main/resources/viafabricplus.mixins.json +++ b/src/main/resources/viafabricplus.mixins.json @@ -6,7 +6,19 @@ "mixins": [ "base.MixinClientConnection", "base.MixinClientConnection_1", + "base.MixinMain", + "base.MixinMinecraftClient", + "base.MixinMultiplayerScreen", + "fixes.MixinCamera", + "fixes.MixinClientPlayerInteractionManager", + "fixes.MixinClientPlayNetworkHandler", + "fixes.MixinMinecraftClient", + "fixes.MixinPendingUpdateManager", + "fixes.MixinPlayerEntityRenderer", "fixes.MixinPlayerPublicKey_PublicKeyData", + "fixes.MixinProfileKeysImpl", + "fixes.MixinServerAddress", + "fixes.MixinServerResourcePackProvider", "fixes.block.MixinAbstractBlock_AbstractBlockState", "fixes.block.MixinAnvilBlock", "fixes.block.MixinBambooBlock", @@ -34,6 +46,7 @@ "fixes.entity.MixinAbstractDonkeyEntity", "fixes.entity.MixinAllayEntity", "fixes.entity.MixinAnimalEntity", + "fixes.entity.MixinClientPlayerEntity", "fixes.entity.MixinCowEntity", "fixes.entity.MixinCreeperEntity", "fixes.entity.MixinEntity", @@ -41,14 +54,19 @@ "fixes.entity.MixinEntityPredicates", "fixes.entity.MixinItemEntity", "fixes.entity.MixinLivingEntity", + "fixes.entity.MixinOtherClientPlayerEntity", "fixes.entity.MixinPiglinEntity", "fixes.entity.MixinPlayerEntity", "fixes.entity.MixinSquidEntity", "fixes.entity.MixinVexEntity", + "fixes.input.MixinKeyboard", + "fixes.input.MixinKeyboardInput", + "fixes.input.MixinMouse", "fixes.item.MixinAxeItem", "fixes.item.MixinBlockItem", "fixes.item.MixinEnderPearlItem", "fixes.item.MixinFireworkRocketItem", + "fixes.item.MixinHeldItemRenderer", "fixes.item.MixinHoeItem", "fixes.item.MixinItemCooldownManager", "fixes.item.MixinItemGroup_EntriesImpl", @@ -62,7 +80,12 @@ "fixes.packet.MixinPacketByteBuf", "fixes.packet.MixinUpdatePlayerAbilitiesC2SPacket", "fixes.screen.MixinConnectScreen_1", + "fixes.screen.MixinDownloadingTerrainScreen", + "fixes.screen.MixinGameModeSelectionScreen", + "fixes.screen.MixinGameModeSelectionScreen_GameModeSelection", + "fixes.screen.MixinStructureBlockScreen_1", "fixes.screen.hud.MixinBossBarHud_1", + "fixes.screen.merchant.MixinMerchantScreen", "fixes.screen.merchant.MixinMerchantScreenHandler", "fixes.screen.screenhandler.MixinBrewingStandScreenHandler_FuelSlot", "fixes.screen.screenhandler.MixinPlayerScreenHandler", @@ -97,32 +120,5 @@ ], "injectors": { "defaultRequire": 1 - }, - "client": [ - "base.MixinMain", - "base.MixinMinecraftClient", - "base.MixinMultiplayerScreen", - "fixes.MixinCamera", - "fixes.MixinClientPlayerInteractionManager", - "fixes.MixinClientPlayNetworkHandler", - "fixes.MixinMinecraftClient", - "fixes.MixinPendingUpdateManager", - "fixes.MixinPlayerEntityRenderer", - "fixes.MixinProfileKeysImpl", - "fixes.MixinServerAddress", - "fixes.MixinServerResourcePackProvider", - "fixes.entity.MixinClientPlayerEntity", - "fixes.entity.MixinOtherClientPlayerEntity", - "fixes.input.MixinKeyboard", - "fixes.input.MixinKeyboardInput", - "fixes.input.MixinMouse", - "fixes.item.MixinHeldItemRenderer", - "fixes.screen.MixinCommandBlockScreen", - "fixes.screen.MixinDownloadingTerrainScreen", - "fixes.screen.MixinGameModeSelectionScreen", - "fixes.screen.MixinGameModeSelectionScreen_GameModeSelection", - "fixes.screen.MixinJigsawBlockScreen", - "fixes.screen.MixinStructureBlockScreen_1", - "fixes.screen.merchant.MixinMerchantScreen" - ] + } }