mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-06 19:18:25 +01:00
More work
This commit is contained in:
parent
4a1d71f056
commit
2f8187ced9
@ -19,9 +19,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.util;
|
||||
package com.viaversion.viafabricplus.base;
|
||||
|
||||
import com.viaversion.viafabricplus.features.ClientsideFeatures;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
@ -30,7 +29,7 @@ import net.minecraft.util.Identifier;
|
||||
|
||||
public record DataCustomPayload(PacketByteBuf buf) implements CustomPayload {
|
||||
|
||||
public static final CustomPayload.Id<DataCustomPayload> ID = new CustomPayload.Id<>(Identifier.of(ClientsideFeatures.PACKET_SYNC_IDENTIFIER));
|
||||
public static final CustomPayload.Id<DataCustomPayload> ID = new CustomPayload.Id<>(Identifier.of(SyncTasks.PACKET_SYNC_IDENTIFIER));
|
||||
|
||||
static {
|
||||
PayloadTypeRegistry.playS2C().register(DataCustomPayload.ID, CustomPayload.codecOf((value, buf) -> {
|
@ -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.base;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.RegistryByteBuf;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class SyncTasks {
|
||||
|
||||
/**
|
||||
* Contains all tasks that are waiting for a packet to be received, this system can be used to sync ViaVersion tasks with the correct thread
|
||||
*/
|
||||
private static final Map<String, Consumer<RegistryByteBuf>> PENDING_EXECUTION_TASKS = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* This identifier is an internal identifier used to identify packets that are sent by ViaFabricPlus
|
||||
*/
|
||||
public static final String PACKET_SYNC_IDENTIFIER = UUID.randomUUID() + ":" + UUID.randomUUID();
|
||||
|
||||
/**
|
||||
* Executes a task synchronized with the main thread from networking threads
|
||||
*
|
||||
* @param task The task to execute
|
||||
* @return The uuid of the task
|
||||
*/
|
||||
public static String executeSyncTask(final Consumer<RegistryByteBuf> task) {
|
||||
final String uuid = UUID.randomUUID().toString();
|
||||
PENDING_EXECUTION_TASKS.put(uuid, task);
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public static void handleSyncTask(final PacketByteBuf buf) {
|
||||
final String uuid = buf.readString();
|
||||
|
||||
if (PENDING_EXECUTION_TASKS.containsKey(uuid)) {
|
||||
MinecraftClient.getInstance().execute(() -> { // Execute the task on the main thread
|
||||
final Consumer<RegistryByteBuf> task = PENDING_EXECUTION_TASKS.remove(uuid);
|
||||
task.accept(new RegistryByteBuf(buf, MinecraftClient.getInstance().getNetworkHandler().getRegistryManager()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -25,61 +25,27 @@ import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.event.ChangeProtocolVersionCallback;
|
||||
import com.viaversion.viafabricplus.event.PostGameLoadCallback;
|
||||
import com.viaversion.viafabricplus.features.data.EntityDimensionDiff;
|
||||
import com.viaversion.viafabricplus.features.data.ResourcePackHeaderDiff;
|
||||
import com.viaversion.viafabricplus.features.data.recipe.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.features2.networking.resource_pack_header.ResourcePackHeaderDiff;
|
||||
import com.viaversion.viafabricplus.features2.recipe_emulation.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.features.versioned.EnchantmentAttributesEmulation1_20_6;
|
||||
import com.viaversion.viafabricplus.features2.cpe_extensions.CPEAdditions;
|
||||
import com.viaversion.viafabricplus.features.versioned.classic.GridItemSelectionScreen;
|
||||
import com.viaversion.viafabricplus.features2.ui.classic_creative_menu.GridItemSelectionScreen;
|
||||
import com.viaversion.viafabricplus.features.versioned.visual.ArmorHudEmulation1_8;
|
||||
import com.viaversion.viafabricplus.features2.footstep_particle.FootStepParticle1_12_2;
|
||||
import com.viaversion.viafabricplus.features.versioned.visual.UnicodeFontFix1_12_2;
|
||||
import com.viaversion.viafabricplus.injection.access.IClientConnection;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viafabricplus.settings.impl.BedrockSettings;
|
||||
import com.viaversion.viafabricplus.features2.text_rendering.non_existing_characters.UnicodeFontFix1_12_2;
|
||||
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
|
||||
import com.viaversion.viafabricplus.util.DataCustomPayload;
|
||||
import com.viaversion.viafabricplus.base.DataCustomPayload;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.RegistryByteBuf;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.raphimc.viaaprilfools.api.AprilFoolsProtocolVersion;
|
||||
import net.raphimc.viabedrock.api.BedrockProtocolVersion;
|
||||
import net.raphimc.viabedrock.protocol.data.ProtocolConstants;
|
||||
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
|
||||
import net.raphimc.vialegacy.protocol.classic.c0_30cpetoc0_28_30.data.ClassicProtocolExtension;
|
||||
import net.raphimc.vialegacy.protocol.classic.c0_30cpetoc0_28_30.storage.ExtensionProtocolMetadataStorage;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* This class contains random fields and methods that are used to fix bugs on the client side
|
||||
*/
|
||||
public class ClientsideFeatures {
|
||||
|
||||
/**
|
||||
* Contains all tasks that are waiting for a packet to be received, this system can be used to sync ViaVersion tasks with the correct thread
|
||||
*/
|
||||
private static final Map<String, Consumer<RegistryByteBuf>> PENDING_EXECUTION_TASKS = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* This identifier is an internal identifier used to identify packets that are sent by ViaFabricPlus
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public static final String PACKET_SYNC_IDENTIFIER = UUID.randomUUID() + ":" + UUID.randomUUID();
|
||||
|
||||
/**
|
||||
* This is an incremental index used for tablist entries to implement FIFO behavior <= 1.7
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public static int globalTablistIndex = 0;
|
||||
|
||||
static {
|
||||
// Register additional CPE features
|
||||
CPEAdditions.modifyMappings();
|
||||
@ -148,45 +114,4 @@ public class ClientsideFeatures {
|
||||
// Calls the static block
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the default port when parsing a server address if the default port should be replaced
|
||||
*
|
||||
* @param address The original address of the server
|
||||
* @param version The protocol version
|
||||
* @return The server address with the replaced default port
|
||||
*/
|
||||
public static String replaceDefaultPort(final String address, final ProtocolVersion version) {
|
||||
// If the default port for this entry should be replaced, check if the address already contains a port
|
||||
// We can't just replace vanilla's default port because a bedrock server might be running on the same port
|
||||
if (BedrockSettings.global().replaceDefaultPort.getValue() && Objects.equals(version, BedrockProtocolVersion.bedrockLatest) && !address.contains(":")) {
|
||||
return address + ":" + ProtocolConstants.BEDROCK_DEFAULT_PORT;
|
||||
} else {
|
||||
return address;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a task synchronized with the main thread from networking threads
|
||||
*
|
||||
* @param task The task to execute
|
||||
* @return The uuid of the task
|
||||
*/
|
||||
public static String executeSyncTask(final Consumer<RegistryByteBuf> task) {
|
||||
final String uuid = UUID.randomUUID().toString();
|
||||
PENDING_EXECUTION_TASKS.put(uuid, task);
|
||||
return uuid;
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
public static void handleSyncTask(final PacketByteBuf buf) {
|
||||
final String uuid = buf.readString();
|
||||
|
||||
if (PENDING_EXECUTION_TASKS.containsKey(uuid)) {
|
||||
MinecraftClient.getInstance().execute(() -> { // Execute the task on the main thread
|
||||
final Consumer<RegistryByteBuf> task = PENDING_EXECUTION_TASKS.remove(uuid);
|
||||
task.accept(new RegistryByteBuf(buf, MinecraftClient.getInstance().getNetworkHandler().getRegistryManager()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.versioned.classic;
|
||||
package com.viaversion.viafabricplus.features2.classic_world_height;
|
||||
|
||||
import com.viaversion.nbt.tag.CompoundTag;
|
||||
import com.viaversion.viaversion.api.Via;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.versioned;
|
||||
package com.viaversion.viafabricplus.features2.interaction;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.ViaFabricPlus;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.versioned;
|
||||
package com.viaversion.viafabricplus.features2.item.tooltip_changes;
|
||||
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import net.minecraft.enchantment.Enchantment;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data;
|
||||
package com.viaversion.viafabricplus.features2.networking.resource_pack_header;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data.recipe;
|
||||
package com.viaversion.viafabricplus.features2.recipe_emulation;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data.recipe;
|
||||
package com.viaversion.viafabricplus.features2.recipe_emulation;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.entity.BannerPattern;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data.recipe;
|
||||
package com.viaversion.viafabricplus.features2.recipe_emulation;
|
||||
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.item.ItemStack;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data.recipe;
|
||||
package com.viaversion.viafabricplus.features2.recipe_emulation;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableMultimap;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data.recipe;
|
||||
package com.viaversion.viafabricplus.features2.recipe_emulation;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data.recipe;
|
||||
package com.viaversion.viafabricplus.features2.recipe_emulation;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ShulkerBoxBlock;
|
@ -19,9 +19,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.versioned.visual;
|
||||
package com.viaversion.viafabricplus.features2.text_rendering.non_existing_characters;
|
||||
|
||||
import com.viaversion.viafabricplus.injection.mixin.features.text_rendering.MixinFontStorage;
|
||||
import com.viaversion.viafabricplus.injection.mixin.features.text_rendering.non_existing_characters.MixinFontStorage;
|
||||
import net.minecraft.client.font.BakedGlyph;
|
||||
import net.minecraft.client.font.Glyph;
|
||||
import net.minecraft.client.font.RenderableGlyph;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.data;
|
||||
package com.viaversion.viafabricplus.features2.text_rendering.non_existing_characters;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.versioned.visual;
|
||||
package com.viaversion.viafabricplus.features2.text_rendering.non_existing_characters;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.event.ChangeProtocolVersionCallback;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.versioned.classic;
|
||||
package com.viaversion.viafabricplus.features2.ui.classic_creative_menu;
|
||||
|
||||
import com.viaversion.viafabricplus.features2.item.filter_creative_tabs.ItemRegistryDiff;
|
||||
import com.viaversion.viafabricplus.screen.VFPScreen;
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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.features2.ui.v1_7_tab_list_style;
|
||||
|
||||
public class LegacyTabList {
|
||||
|
||||
/**
|
||||
* This is an incremental index used for tablist entries to implement FIFO behavior <= 1.7
|
||||
*/
|
||||
public static int globalTablistIndex = 0;
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.features.versioned;
|
||||
package com.viaversion.viafabricplus.features2.world.disable_sequencing;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
@ -21,7 +21,7 @@
|
||||
|
||||
package com.viaversion.viafabricplus.injection.access;
|
||||
|
||||
import com.viaversion.viafabricplus.features.versioned.ClientPlayerInteractionManager1_18_2;
|
||||
import com.viaversion.viafabricplus.features2.interaction.ClientPlayerInteractionManager1_18_2;
|
||||
|
||||
public interface IClientPlayerInteractionManager {
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.access;
|
||||
package com.viaversion.viafabricplus.injection.access.networking.downloading_terrain_handling;
|
||||
|
||||
public interface IDownloadingTerrainScreen {
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.access;
|
||||
package com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style;
|
||||
|
||||
public interface IPlayerListEntry {
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.access;
|
||||
package com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style;
|
||||
|
||||
public interface IPlayerListHud {
|
||||
|
@ -24,8 +24,8 @@ package com.viaversion.viafabricplus.injection.mixin.base.integration;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.viaversion.viafabricplus.features.ClientsideFeatures;
|
||||
import com.viaversion.viafabricplus.injection.access.IServerInfo;
|
||||
import com.viaversion.viafabricplus.settings.impl.BedrockSettings;
|
||||
import net.minecraft.client.network.MultiplayerServerListPinger;
|
||||
import net.minecraft.client.network.ServerAddress;
|
||||
import net.minecraft.client.network.ServerInfo;
|
||||
@ -38,7 +38,7 @@ public abstract class MixinMultiplayerServerListPinger {
|
||||
@WrapOperation(method = "add", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ServerAddress;parse(Ljava/lang/String;)Lnet/minecraft/client/network/ServerAddress;"))
|
||||
private ServerAddress replaceDefaultPort(String address, Operation<ServerAddress> original, @Local(argsOnly = true) ServerInfo entry) {
|
||||
// Replace port when pinging the server and the forced version is set
|
||||
return original.call(ClientsideFeatures.replaceDefaultPort(address, ((IServerInfo) entry).viaFabricPlus$forcedVersion()));
|
||||
return original.call(BedrockSettings.replaceDefaultPort(address, ((IServerInfo) entry).viaFabricPlus$forcedVersion()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,38 +19,28 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.base.integration;
|
||||
package com.viaversion.viafabricplus.injection.mixin.base.integration.bedrock;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.ViaFabricPlus;
|
||||
import com.viaversion.viafabricplus.injection.access.IClientConnection;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import net.minecraft.client.network.ServerAddress;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.raphimc.minecraftauth.step.bedrock.StepMCChain;
|
||||
import net.raphimc.minecraftauth.step.bedrock.session.StepFullBedrockSession;
|
||||
import net.raphimc.viabedrock.api.BedrockProtocolVersion;
|
||||
import net.raphimc.viabedrock.protocol.storage.AuthChainData;
|
||||
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 org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.UUID;
|
||||
|
||||
@Mixin(targets = "net.minecraft.client.gui.screen.multiplayer.ConnectScreen$1")
|
||||
public abstract class MixinConnectScreen_1 {
|
||||
|
||||
@Final
|
||||
@Shadow
|
||||
ServerAddress field_33737;
|
||||
|
||||
@Inject(method = "run", at = @At(value = "INVOKE", target = "Lio/netty/channel/ChannelFuture;syncUninterruptibly()Lio/netty/channel/ChannelFuture;", remap = false, shift = At.Shift.AFTER))
|
||||
private void setupBedrockAccount(CallbackInfo ci, @Local ClientConnection clientConnection) {
|
||||
final UserConnection userConnection = ((IClientConnection) clientConnection).viaFabricPlus$getUserConnection();
|
@ -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 com.viaversion.viafabricplus.injection.mixin.base.integration.sync_tasks;
|
||||
|
||||
import com.viaversion.viafabricplus.base.SyncTasks;
|
||||
import com.viaversion.viafabricplus.base.DataCustomPayload;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(value = ClientCommonNetworkHandler.class, priority = 1 /* Has to be applied before Fabric's Networking API, so it doesn't cancel our custom-payload packets */)
|
||||
public abstract class MixinClientCommonNetworkHandler {
|
||||
|
||||
@Inject(method = "onCustomPayload(Lnet/minecraft/network/packet/s2c/common/CustomPayloadS2CPacket;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void handleSyncTask(CustomPayloadS2CPacket packet, CallbackInfo ci) {
|
||||
if (packet.payload() instanceof DataCustomPayload dataCustomPayload) {
|
||||
SyncTasks.handleSyncTask(dataCustomPayload.buf());
|
||||
ci.cancel(); // Cancel the packet, so it doesn't get processed by the client
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -24,6 +24,7 @@ package com.viaversion.viafabricplus.injection.mixin.base.ui;
|
||||
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.BedrockSettings;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.features.ClientsideFeatures;
|
||||
import com.viaversion.viafabricplus.injection.access.IServerInfo;
|
||||
@ -70,7 +71,7 @@ public abstract class MixinMultiplayerScreen extends Screen {
|
||||
} else {
|
||||
version = mixinServerInfo.viaFabricPlus$forcedVersion();
|
||||
}
|
||||
return original.call(ClientsideFeatures.replaceDefaultPort(address, version));
|
||||
return original.call(BedrockSettings.replaceDefaultPort(address, version));
|
||||
}
|
||||
|
||||
@WrapOperation(method = "directConnect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/multiplayer/MultiplayerScreen;connect(Lnet/minecraft/client/network/ServerInfo;)V"))
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.classic_world_height;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.viaversion;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.classic_world_height;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
|
||||
@ -27,7 +27,7 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
|
||||
import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ClientboundPackets1_16_2;
|
||||
import com.viaversion.viaversion.protocols.v1_16_4to1_17.Protocol1_16_4To1_17;
|
||||
import com.viaversion.viaversion.protocols.v1_16_4to1_17.rewriter.EntityPacketRewriter1_17;
|
||||
import com.viaversion.viafabricplus.features.versioned.classic.WorldHeightSupport;
|
||||
import com.viaversion.viafabricplus.features2.classic_world_height.WorldHeightSupport;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.viaversion;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.classic_world_height;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
|
||||
@ -27,7 +27,7 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
|
||||
import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ClientboundPackets1_16_2;
|
||||
import com.viaversion.viaversion.protocols.v1_16_4to1_17.Protocol1_16_4To1_17;
|
||||
import com.viaversion.viaversion.protocols.v1_16_4to1_17.rewriter.WorldPacketRewriter1_17;
|
||||
import com.viaversion.viafabricplus.features.versioned.classic.WorldHeightSupport;
|
||||
import com.viaversion.viafabricplus.features2.classic_world_height.WorldHeightSupport;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.network;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.interaction;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
@ -30,7 +30,7 @@ import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ServerboundPac
|
||||
import com.viaversion.viaversion.protocols.v1_16_4to1_17.Protocol1_16_4To1_17;
|
||||
import com.viaversion.viafabricplus.ViaFabricPlus;
|
||||
import com.viaversion.viafabricplus.features.versioned.ActionResultException1_12_2;
|
||||
import com.viaversion.viafabricplus.features.versioned.ClientPlayerInteractionManager1_18_2;
|
||||
import com.viaversion.viafabricplus.features2.interaction.ClientPlayerInteractionManager1_18_2;
|
||||
import com.viaversion.viafabricplus.injection.access.IClientConnection;
|
||||
import com.viaversion.viafabricplus.injection.access.IClientPlayerInteractionManager;
|
||||
import com.viaversion.viafabricplus.injection.access.IScreenHandler;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.interaction;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.interactions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.swinging;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.swinging;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.swinging;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,10 +19,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.item.tooltip_changes;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.features.versioned.Enchantments1_14_4;
|
||||
import com.viaversion.viafabricplus.features2.item.tooltip_changes.Enchantments1_14_4;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viafabricplus.util.ItemUtil;
|
||||
import net.minecraft.component.ComponentType;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.legacy_tab_completions;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.movement.elytra;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.item;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.movement.item;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.network;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.auto_read;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
@ -60,11 +60,4 @@ public abstract class MixinClientConfigurationNetworkHandler extends ClientCommo
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onFeatures", at = @At(value = "HEAD"))
|
||||
private void notifyAboutFeatures(FeaturesS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThan(ProtocolVersion.v1_20) && packet.features().contains(Identifier.of("update_1_20"))) {
|
||||
ChatUtil.sendPrefixedMessage(Text.translatable("translation.viafabricplus.updates_1_20").formatted(Formatting.RED));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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.injection.mixin.features.networking.auto_read;
|
||||
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
import net.minecraft.client.network.ClientConnectionState;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.packet.s2c.play.EnterReconfigurationS2CPacket;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(ClientPlayNetworkHandler.class)
|
||||
public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkHandler {
|
||||
|
||||
protected MixinClientPlayNetworkHandler(MinecraftClient client, ClientConnection connection, ClientConnectionState connectionState) {
|
||||
super(client, connection, connectionState);
|
||||
}
|
||||
|
||||
@Inject(method = "onEnterReconfiguration", at = @At("HEAD"))
|
||||
private void disableAutoRead(EnterReconfigurationS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.connection.channel.config().setAutoRead(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onEnterReconfiguration", at = @At("RETURN"))
|
||||
private void enableAutoRead(EnterReconfigurationS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.connection.channel.config().setAutoRead(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.pre_config_state;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.auto_read;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.pre_config_state;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.auto_read;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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.features.networking.downloading_terrain_handling;
|
||||
|
||||
import com.viaversion.viafabricplus.injection.access.networking.downloading_terrain_handling.IDownloadingTerrainScreen;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
import net.minecraft.client.network.ClientConnectionState;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerSpawnPositionS2CPacket;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(ClientPlayNetworkHandler.class)
|
||||
public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkHandler {
|
||||
|
||||
protected MixinClientPlayNetworkHandler(MinecraftClient client, ClientConnection connection, ClientConnectionState connectionState) {
|
||||
super(client, connection, connectionState);
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerSpawnPosition", at = @At("RETURN"))
|
||||
private void moveDownloadingTerrainClosing(PlayerSpawnPositionS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().betweenInclusive(ProtocolVersion.v1_18_2, ProtocolVersion.v1_20_2) && this.client.currentScreen instanceof IDownloadingTerrainScreen mixinDownloadingTerrainScreen) {
|
||||
mixinDownloadingTerrainScreen.viaFabricPlus$setReady();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerPositionLook", at = @At("RETURN"))
|
||||
private void closeDownloadingTerrain(PlayerPositionLookS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_18) && this.client.currentScreen instanceof IDownloadingTerrainScreen mixinDownloadingTerrainScreen) {
|
||||
mixinDownloadingTerrainScreen.viaFabricPlus$setReady();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -19,12 +19,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.downloading_terrain_handling;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.injection.access.IDownloadingTerrainScreen;
|
||||
import com.viaversion.viafabricplus.injection.access.networking.downloading_terrain_handling.IDownloadingTerrainScreen;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.network.packet.c2s.common.KeepAliveC2SPacket;
|
||||
@ -36,7 +35,6 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
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.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(DownloadingTerrainScreen.class)
|
||||
@ -46,10 +44,6 @@ public abstract class MixinDownloadingTerrainScreen extends Screen implements ID
|
||||
@Final
|
||||
private long loadStartTime;
|
||||
|
||||
@Shadow
|
||||
@Final
|
||||
private DownloadingTerrainScreen.WorldEntryReason worldEntryReason;
|
||||
|
||||
@Unique
|
||||
private int viaFabricPlus$tickCounter;
|
||||
|
||||
@ -63,15 +57,6 @@ public abstract class MixinDownloadingTerrainScreen extends Screen implements ID
|
||||
super(title);
|
||||
}
|
||||
|
||||
@Redirect(method = "renderBackground", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen;worldEntryReason:Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen$WorldEntryReason;"))
|
||||
private DownloadingTerrainScreen.WorldEntryReason hideDownloadTerrainScreenTransitionEffects(DownloadingTerrainScreen downloadingTerrainScreen) {
|
||||
if (VisualSettings.global().hideDownloadTerrainScreenTransitionEffects.isEnabled()) {
|
||||
return DownloadingTerrainScreen.WorldEntryReason.OTHER;
|
||||
} else {
|
||||
return this.worldEntryReason;
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
|
||||
private void modifyCloseCondition(CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_2)) {
|
@ -23,10 +23,8 @@ package com.viaversion.viafabricplus.injection.mixin.features.networking.packet_
|
||||
|
||||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.features.ClientsideFeatures;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viafabricplus.settings.impl.DebugSettings;
|
||||
import com.viaversion.viafabricplus.util.DataCustomPayload;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
@ -35,7 +33,6 @@ import net.minecraft.network.listener.ServerPacketListener;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.common.ResourcePackStatusC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.common.CommonPingS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
@ -53,7 +50,7 @@ import java.time.Duration;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BooleanSupplier;
|
||||
|
||||
@Mixin(value = ClientCommonNetworkHandler.class, priority = 1 /* Has to be applied before Fabric's Networking API, so it doesn't cancel our custom-payload packets */)
|
||||
@Mixin(ClientCommonNetworkHandler.class)
|
||||
public abstract class MixinClientCommonNetworkHandler {
|
||||
|
||||
@Shadow
|
||||
@ -117,12 +114,4 @@ public abstract class MixinClientCommonNetworkHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onCustomPayload(Lnet/minecraft/network/packet/s2c/common/CustomPayloadS2CPacket;)V", at = @At("HEAD"), cancellable = true)
|
||||
private void handleSyncTask(CustomPayloadS2CPacket packet, CallbackInfo ci) {
|
||||
if (packet.payload() instanceof DataCustomPayload dataCustomPayload) {
|
||||
ClientsideFeatures.handleSyncTask(dataCustomPayload.buf());
|
||||
ci.cancel(); // Cancel the packet, so it doesn't get processed by the client
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.network;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.packet_handling_changes;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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.features.networking.remove_signed_commands;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientCommonNetworkHandler;
|
||||
import net.minecraft.client.network.ClientConnectionState;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.message.ArgumentSignatureDataMap;
|
||||
import net.minecraft.network.message.LastSeenMessagesCollector;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.play.ChatCommandSignedC2SPacket;
|
||||
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;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(ClientPlayNetworkHandler.class)
|
||||
public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkHandler {
|
||||
|
||||
@Shadow
|
||||
private LastSeenMessagesCollector lastSeenMessagesCollector;
|
||||
|
||||
protected MixinClientPlayNetworkHandler(MinecraftClient client, ClientConnection connection, ClientConnectionState connectionState) {
|
||||
super(client, connection, connectionState);
|
||||
}
|
||||
|
||||
@Redirect(method = "sendChatCommand", at = @At(value = "INVOKE", target = "Ljava/util/List;isEmpty()Z"))
|
||||
private boolean alwaysSignCommands(List<?> instance) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
return false;
|
||||
} else {
|
||||
return instance.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "sendCommand", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V"))
|
||||
private void alwaysSignCommands(ClientPlayNetworkHandler instance, Packet<?> packet, @Local(argsOnly = true) String command) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.sendPacket(new ChatCommandSignedC2SPacket(command, Instant.now(), 0L, ArgumentSignatureDataMap.EMPTY, this.lastSeenMessagesCollector.collect().update()));
|
||||
} else {
|
||||
instance.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.viaversion;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.remove_signed_commands;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.protocol.AbstractProtocol;
|
@ -22,7 +22,7 @@
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.networking.resource_pack_header;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.features.data.ResourcePackHeaderDiff;
|
||||
import com.viaversion.viafabricplus.features2.networking.resource_pack_header.ResourcePackHeaderDiff;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import net.minecraft.GameVersion;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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.features.networking.warn_feature_updates;
|
||||
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viafabricplus.util.ChatUtil;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.client.network.ClientConfigurationNetworkHandler;
|
||||
import net.minecraft.network.packet.s2c.config.FeaturesS2CPacket;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(ClientConfigurationNetworkHandler.class)
|
||||
public abstract class MixinClientConfigurationNetworkHandler {
|
||||
|
||||
@Inject(method = "onFeatures", at = @At(value = "HEAD"))
|
||||
private void notifyAboutFeatures(FeaturesS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThan(ProtocolVersion.v1_20) && packet.features().contains(Identifier.of("update_1_20"))) {
|
||||
ChatUtil.sendPrefixedMessage(Text.translatable("translation.viafabricplus.updates_1_20").formatted(Formatting.RED));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.network;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.player_abilities;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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.features.recipe_emulation;
|
||||
|
||||
import com.viaversion.viafabricplus.features2.recipe_emulation.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.screen.AbstractCraftingScreenHandler;
|
||||
import net.minecraft.screen.CraftingScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(CraftingScreenHandler.class)
|
||||
public abstract class MixinCraftingScreenHandler extends AbstractCraftingScreenHandler {
|
||||
|
||||
public MixinCraftingScreenHandler(ScreenHandlerType<?> type, int syncId, int width, int height) {
|
||||
super(type, syncId, width, height);
|
||||
}
|
||||
|
||||
@Inject(method = "onContentChanged", at = @At("HEAD"))
|
||||
private void clientSideCrafting(Inventory inventory, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_11_1)) {
|
||||
Recipes1_11_2.setCraftingResultSlot(syncId, this, this.craftingInventory);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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.features.recipe_emulation;
|
||||
|
||||
import com.viaversion.viafabricplus.features2.recipe_emulation.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.screen.AbstractCraftingScreenHandler;
|
||||
import net.minecraft.screen.PlayerScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(PlayerScreenHandler.class)
|
||||
public abstract class MixinPlayerScreenHandler extends AbstractCraftingScreenHandler {
|
||||
|
||||
public MixinPlayerScreenHandler(ScreenHandlerType<?> type, int syncId, int width, int height) {
|
||||
super(type, syncId, width, height);
|
||||
}
|
||||
|
||||
@Inject(method = "onContentChanged", at = @At("HEAD"))
|
||||
private void clientSideCrafting(Inventory inventory, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_11_1)) {
|
||||
Recipes1_11_2.setCraftingResultSlot(syncId, this, this.craftingInventory);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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.features.run_command_action_handling;
|
||||
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.text.Style;
|
||||
import net.minecraft.util.StringHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
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.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public abstract class MixinScreen {
|
||||
|
||||
@Shadow
|
||||
@Nullable
|
||||
protected MinecraftClient client;
|
||||
|
||||
@Inject(method = "handleTextClick", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;)V", shift = At.Shift.BEFORE, ordinal = 1, remap = false), cancellable = true)
|
||||
private void allowRunCommandAction(Style style, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_19)) {
|
||||
this.client.player.networkHandler.sendChatMessage(StringHelper.stripInvalidChars(style.getClickEvent().getValue()));
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -19,10 +19,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.text_rendering;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.text_rendering.non_existing_characters;
|
||||
|
||||
import com.viaversion.viafabricplus.features.data.RenderableGlyphDiff;
|
||||
import com.viaversion.viafabricplus.features.versioned.visual.BuiltinEmptyGlyph1_12_2;
|
||||
import com.viaversion.viafabricplus.features2.text_rendering.non_existing_characters.RenderableGlyphDiff;
|
||||
import com.viaversion.viafabricplus.features2.text_rendering.non_existing_characters.BuiltinEmptyGlyph1_12_2;
|
||||
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.*;
|
@ -19,9 +19,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.text_rendering;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.text_rendering.non_existing_characters;
|
||||
|
||||
import com.viaversion.viafabricplus.features.versioned.visual.UnicodeFontFix1_12_2;
|
||||
import com.viaversion.viafabricplus.features2.text_rendering.non_existing_characters.UnicodeFontFix1_12_2;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import net.minecraft.client.resource.language.LanguageManager;
|
||||
import net.minecraft.resource.ResourceManager;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.book_edit_page_limitations;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -21,7 +21,7 @@
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.classic_creative_menu;
|
||||
|
||||
import com.viaversion.viafabricplus.features.versioned.classic.GridItemSelectionScreen;
|
||||
import com.viaversion.viafabricplus.features2.ui.classic_creative_menu.GridItemSelectionScreen;
|
||||
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.features.ui.downloading_terrain_transitions;
|
||||
|
||||
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
|
||||
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
|
||||
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 org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(DownloadingTerrainScreen.class)
|
||||
public abstract class MixinDownloadingTerrainScreen {
|
||||
|
||||
@Shadow @Final private DownloadingTerrainScreen.WorldEntryReason worldEntryReason;
|
||||
|
||||
@Redirect(method = "renderBackground", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen;worldEntryReason:Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen$WorldEntryReason;"))
|
||||
private DownloadingTerrainScreen.WorldEntryReason hideDownloadTerrainScreenTransitionEffects(DownloadingTerrainScreen downloadingTerrainScreen) {
|
||||
if (VisualSettings.global().hideDownloadTerrainScreenTransitionEffects.isEnabled()) {
|
||||
return DownloadingTerrainScreen.WorldEntryReason.OTHER;
|
||||
} else {
|
||||
return this.worldEntryReason;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.filter_game_mode_selections;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.filter_game_mode_selections;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.beta_hud_elements;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.hud_element_changes;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
|
@ -48,14 +48,6 @@ public abstract class MixinScreen {
|
||||
@Nullable
|
||||
protected MinecraftClient client;
|
||||
|
||||
@Inject(method = "handleTextClick", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;)V", shift = At.Shift.BEFORE, ordinal = 1, remap = false), cancellable = true)
|
||||
private void allowRunCommandAction(Style style, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_19)) {
|
||||
this.client.player.networkHandler.sendChatMessage(StringHelper.stripInvalidChars(style.getClickEvent().getValue()));
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "addDrawableChild", at = @At("HEAD"), cancellable = true)
|
||||
private <T extends Element & Drawable & Selectable> void removeRecipeBook(T drawableElement, CallbackInfoReturnable<T> cir) {
|
||||
if (drawableElement instanceof TexturedButtonWidget button && button.textures == RecipeBookWidget.BUTTON_TEXTURES) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.sign_editor_reach;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -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.injection.mixin.features.ui.v1_7_tab_list_style;
|
||||
|
||||
import com.viaversion.viafabricplus.features2.ui.v1_7_tab_list_style.LegacyTabList;
|
||||
import com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style.IPlayerListHud;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(ClientPlayNetworkHandler.class)
|
||||
public abstract class MixinClientPlayNetworkHandler {
|
||||
|
||||
@Inject(method = "onGameJoin", at = @At("RETURN"))
|
||||
private void initPlayerListFix(GameJoinS2CPacket packet, CallbackInfo ci) {
|
||||
LegacyTabList.globalTablistIndex = 0;
|
||||
((IPlayerListHud) MinecraftClient.getInstance().inGameHud.getPlayerListHud()).viaFabricPlus$setMaxPlayers(packet.maxPlayers());
|
||||
}
|
||||
|
||||
}
|
@ -21,8 +21,8 @@
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.v1_7_tab_list_style;
|
||||
|
||||
import com.viaversion.viafabricplus.features.ClientsideFeatures;
|
||||
import com.viaversion.viafabricplus.injection.access.IPlayerListEntry;
|
||||
import com.viaversion.viafabricplus.features2.ui.v1_7_tab_list_style.LegacyTabList;
|
||||
import com.viaversion.viafabricplus.injection.access.v1_7_tab_list_style.IPlayerListEntry;
|
||||
import net.minecraft.client.network.PlayerListEntry;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
@ -31,7 +31,7 @@ import org.spongepowered.asm.mixin.Unique;
|
||||
public abstract class MixinPlayerListEntry implements IPlayerListEntry {
|
||||
|
||||
@Unique
|
||||
private final int viaFabricPlus$index = ClientsideFeatures.globalTablistIndex++;
|
||||
private final int viaFabricPlus$index = LegacyTabList.globalTablistIndex++;
|
||||
|
||||
@Override
|
||||
public int viaFabricPlus$getIndex() {
|
||||
|
@ -22,8 +22,8 @@
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.ui.v1_7_tab_list_style;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import com.viaversion.viafabricplus.injection.access.IPlayerListEntry;
|
||||
import com.viaversion.viafabricplus.injection.access.IPlayerListHud;
|
||||
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 net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.hud.PlayerListHud;
|
||||
|
@ -21,10 +21,7 @@
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.world.always_tick_entities;
|
||||
|
||||
import com.viaversion.viafabricplus.features.versioned.PendingUpdateManager1_18_2;
|
||||
import com.viaversion.viafabricplus.injection.access.IEntity;
|
||||
import com.viaversion.viafabricplus.settings.impl.DebugSettings;
|
||||
import net.minecraft.client.network.PendingUpdateManager;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@ -39,9 +36,6 @@ import net.minecraft.world.MutableWorldProperties;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import org.spongepowered.asm.mixin.*;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(value = ClientWorld.class, priority = 900)
|
||||
public abstract class MixinClientWorld extends World {
|
||||
@ -50,22 +44,10 @@ public abstract class MixinClientWorld extends World {
|
||||
@Final
|
||||
EntityList entityList;
|
||||
|
||||
@Mutable
|
||||
@Shadow
|
||||
@Final
|
||||
private PendingUpdateManager pendingUpdateManager;
|
||||
|
||||
protected MixinClientWorld(MutableWorldProperties properties, RegistryKey<World> registryRef, DynamicRegistryManager registryManager, RegistryEntry<DimensionType> dimensionEntry, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) {
|
||||
super(properties, registryRef, registryManager, dimensionEntry, isClient, debugWorld, seed, maxChainedNeighborUpdates);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void removePendingUpdateManager(CallbackInfo ci) {
|
||||
if (DebugSettings.global().disableSequencing.isEnabled()) {
|
||||
this.pendingUpdateManager = new PendingUpdateManager1_18_2();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author RK_01
|
||||
* @reason Versions <= 1.8.x and >= 1.17 always tick entities, even if they are not in a loaded chunk.
|
||||
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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.features.world.disable_sequencing;
|
||||
|
||||
import com.viaversion.viafabricplus.features2.world.disable_sequencing.PendingUpdateManager1_18_2;
|
||||
import com.viaversion.viafabricplus.settings.impl.DebugSettings;
|
||||
import net.minecraft.client.network.PendingUpdateManager;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
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.callback.CallbackInfo;
|
||||
|
||||
@Mixin(value = ClientWorld.class, priority = 900)
|
||||
public abstract class MixinClientWorld {
|
||||
|
||||
@Mutable
|
||||
@Shadow
|
||||
@Final
|
||||
private PendingUpdateManager pendingUpdateManager;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void removePendingUpdateManager(CallbackInfo ci) {
|
||||
if (DebugSettings.global().disableSequencing.isEnabled()) {
|
||||
this.pendingUpdateManager = new PendingUpdateManager1_18_2();
|
||||
}
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft;
|
||||
package com.viaversion.viafabricplus.injection.mixin.features.world.remove_server_view_distance;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
@ -39,7 +39,8 @@ public abstract class MixinCamera {
|
||||
@Shadow
|
||||
private float lastCameraY;
|
||||
|
||||
@Shadow private Entity focusedEntity;
|
||||
@Shadow
|
||||
private Entity focusedEntity;
|
||||
|
||||
@Inject(method = "updateEyeHeight", at = @At(value = "HEAD"), cancellable = true)
|
||||
private void sneakInstantly(CallbackInfo ci) {
|
||||
|
@ -24,9 +24,7 @@ package com.viaversion.viafabricplus.injection.mixin.old.minecraft.network;
|
||||
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.features.ClientsideFeatures;
|
||||
import com.viaversion.viafabricplus.injection.access.IDownloadingTerrainScreen;
|
||||
import com.viaversion.viafabricplus.injection.access.IPlayerListHud;
|
||||
import com.viaversion.viafabricplus.injection.access.networking.downloading_terrain_handling.IDownloadingTerrainScreen;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import com.viaversion.viafabricplus.settings.impl.VisualSettings;
|
||||
import net.minecraft.block.entity.SignBlockEntity;
|
||||
@ -84,9 +82,6 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
|
||||
@Shadow
|
||||
protected abstract boolean isSecureChatEnforced();
|
||||
|
||||
@Shadow
|
||||
private LastSeenMessagesCollector lastSeenMessagesCollector;
|
||||
|
||||
@Shadow
|
||||
private ClientWorld world;
|
||||
|
||||
@ -182,38 +177,6 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onEnterReconfiguration", at = @At("HEAD"))
|
||||
private void disableAutoRead(EnterReconfigurationS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.connection.channel.config().setAutoRead(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onEnterReconfiguration", at = @At("RETURN"))
|
||||
private void enableAutoRead(EnterReconfigurationS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.connection.channel.config().setAutoRead(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "sendChatCommand", at = @At(value = "INVOKE", target = "Ljava/util/List;isEmpty()Z"))
|
||||
private boolean alwaysSignCommands(List<?> instance) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
return false;
|
||||
} else {
|
||||
return instance.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "sendCommand", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V"))
|
||||
private void alwaysSignCommands(ClientPlayNetworkHandler instance, Packet<?> packet, @Local(argsOnly = true) String command) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.sendPacket(new ChatCommandSignedC2SPacket(command, Instant.now(), 0L, ArgumentSignatureDataMap.EMPTY, this.lastSeenMessagesCollector.collect().update()));
|
||||
} else {
|
||||
instance.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
@WrapWithCondition(method = "onPlayerRespawn", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;startWorldLoading(Lnet/minecraft/client/network/ClientPlayerEntity;Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen$WorldEntryReason;)V"))
|
||||
private boolean checkDimensionChange(ClientPlayNetworkHandler instance, ClientPlayerEntity player, ClientWorld world, DownloadingTerrainScreen.WorldEntryReason worldEntryReason, @Local(ordinal = 0) RegistryKey<World> registryKey) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_20_3) || registryKey != this.client.player.getWorld().getRegistryKey();
|
||||
@ -262,20 +225,6 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
|
||||
return isSecureChatEnforced() || VisualSettings.global().disableSecureChatWarning.isEnabled();
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerSpawnPosition", at = @At("RETURN"))
|
||||
private void moveDownloadingTerrainClosing(PlayerSpawnPositionS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().betweenInclusive(ProtocolVersion.v1_18_2, ProtocolVersion.v1_20_2) && this.client.currentScreen instanceof IDownloadingTerrainScreen mixinDownloadingTerrainScreen) {
|
||||
mixinDownloadingTerrainScreen.viaFabricPlus$setReady();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onPlayerPositionLook", at = @At("RETURN"))
|
||||
private void closeDownloadingTerrain(PlayerPositionLookS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_18) && this.client.currentScreen instanceof IDownloadingTerrainScreen mixinDownloadingTerrainScreen) {
|
||||
mixinDownloadingTerrainScreen.viaFabricPlus$setReady();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"InvalidInjectorMethodSignature"})
|
||||
@ModifyConstant(method = "onEntityPassengersSet", constant = @Constant(classValue = AbstractBoatEntity.class))
|
||||
private Class<?> dontChangeYawWhenMountingBoats(Object entity, Class<?> boatClass) {
|
||||
@ -302,10 +251,4 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onGameJoin", at = @At("RETURN"))
|
||||
private void initPlayerListFix(GameJoinS2CPacket packet, CallbackInfo ci) {
|
||||
ClientsideFeatures.globalTablistIndex = 0;
|
||||
((IPlayerListHud) MinecraftClient.getInstance().inGameHud.getPlayerListHud()).viaFabricPlus$setMaxPlayers(packet.maxPlayers());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen.screenhandler;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.features.data.recipe.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.features2.recipe_emulation.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -42,17 +42,9 @@ public abstract class MixinCraftingScreenHandler extends AbstractCraftingScreenH
|
||||
super(type, syncId, width, height);
|
||||
}
|
||||
|
||||
|
||||
@Redirect(method = "quickMove", at = @At(value = "INVOKE", target = "Lnet/minecraft/screen/CraftingScreenHandler;insertItem(Lnet/minecraft/item/ItemStack;IIZ)Z", ordinal = 1))
|
||||
private boolean noShiftClickMoveIntoCraftingTable(CraftingScreenHandler instance, ItemStack itemStack, int startIndex, int endIndex, boolean fromLast) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThan(ProtocolVersion.v1_14_4) && this.insertItem(itemStack, startIndex, endIndex, fromLast);
|
||||
}
|
||||
|
||||
@Inject(method = "onContentChanged", at = @At("HEAD"))
|
||||
private void clientSideCrafting(Inventory inventory, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_11_1)) {
|
||||
Recipes1_11_2.setCraftingResultSlot(syncId, this, this.craftingInventory);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.minecraft.screen.screenhandler;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viafabricplus.features.data.recipe.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.features2.recipe_emulation.Recipes1_11_2;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.screen.AbstractCraftingScreenHandler;
|
||||
@ -43,13 +43,6 @@ public abstract class MixinPlayerScreenHandler extends AbstractCraftingScreenHan
|
||||
super(type, syncId, width, height);
|
||||
}
|
||||
|
||||
@Inject(method = "onContentChanged", at = @At("HEAD"))
|
||||
private void clientSideCrafting(Inventory inventory, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_11_1)) {
|
||||
Recipes1_11_2.setCraftingResultSlot(syncId, this, this.craftingInventory);
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "<init>",
|
||||
slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/screen/PlayerScreenHandler$1;<init>(Lnet/minecraft/screen/PlayerScreenHandler;Lnet/minecraft/inventory/Inventory;IIILnet/minecraft/entity/player/PlayerEntity;)V")),
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/screen/PlayerScreenHandler;addSlot(Lnet/minecraft/screen/slot/Slot;)Lnet/minecraft/screen/slot/Slot;", ordinal = 0))
|
||||
|
@ -22,6 +22,7 @@
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.viaversion;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.viaversion.viafabricplus.base.SyncTasks;
|
||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
@ -34,7 +35,6 @@ import com.viaversion.viaversion.protocols.v1_13_2to1_14.packet.ClientboundPacke
|
||||
import com.viaversion.viaversion.protocols.v1_13_2to1_14.packet.ServerboundPackets1_14;
|
||||
import com.viaversion.viaversion.protocols.v1_13_2to1_14.rewriter.ItemPacketRewriter1_14;
|
||||
import com.viaversion.viaversion.rewriter.ItemRewriter;
|
||||
import com.viaversion.viafabricplus.features.ClientsideFeatures;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.translator.TextComponentTranslator;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
|
||||
@ -65,7 +65,7 @@ public abstract class MixinItemPacketRewriter1_14 extends ItemRewriter<Clientbou
|
||||
if ((type.equals("minecraft:container") || type.equals("minecraft:chest")) && (slots > 54 || slots <= 0)) {
|
||||
ci.cancel();
|
||||
|
||||
final String uuid = ClientsideFeatures.executeSyncTask(data -> {
|
||||
final String uuid = SyncTasks.executeSyncTask(data -> {
|
||||
final MinecraftClient mc = MinecraftClient.getInstance();
|
||||
|
||||
try {
|
||||
@ -83,7 +83,7 @@ public abstract class MixinItemPacketRewriter1_14 extends ItemRewriter<Clientbou
|
||||
|
||||
wrapper.clearPacket();
|
||||
wrapper.setPacketType(ClientboundPackets1_14.CUSTOM_PAYLOAD);
|
||||
wrapper.write(Types.STRING, ClientsideFeatures.PACKET_SYNC_IDENTIFIER); // sync task header
|
||||
wrapper.write(Types.STRING, SyncTasks.PACKET_SYNC_IDENTIFIER); // sync task header
|
||||
wrapper.write(Types.STRING, uuid); // sync task id
|
||||
wrapper.write(Types.UNSIGNED_BYTE, windowId);
|
||||
wrapper.write(Types.UNSIGNED_BYTE, slots);
|
||||
|
@ -21,13 +21,13 @@
|
||||
|
||||
package com.viaversion.viafabricplus.injection.mixin.old.viaversion;
|
||||
|
||||
import com.viaversion.viafabricplus.base.SyncTasks;
|
||||
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.protocols.v1_17_1to1_18.packet.ClientboundPackets1_18;
|
||||
import com.viaversion.viaversion.protocols.v1_18_2to1_19.Protocol1_18_2To1_19;
|
||||
import com.viaversion.viaversion.protocols.v1_18_2to1_19.packet.ClientboundPackets1_19;
|
||||
import com.viaversion.viaversion.protocols.v1_18_2to1_19.rewriter.WorldPacketRewriter1_19;
|
||||
import com.viaversion.viafabricplus.features.ClientsideFeatures;
|
||||
import com.viaversion.viafabricplus.injection.access.IClientPlayerInteractionManager;
|
||||
import com.viaversion.viafabricplus.protocoltranslator.translator.BlockStateTranslator;
|
||||
import net.minecraft.block.BlockState;
|
||||
@ -46,7 +46,7 @@ public abstract class MixinWorldPacketRewriter1_19 {
|
||||
instance.registerClientbound(ClientboundPackets1_18.BLOCK_BREAK_ACK, ClientboundPackets1_19.CUSTOM_PAYLOAD, wrapper -> {
|
||||
wrapper.resetReader();
|
||||
|
||||
final String uuid = ClientsideFeatures.executeSyncTask(data -> {
|
||||
final String uuid = SyncTasks.executeSyncTask(data -> {
|
||||
try {
|
||||
final BlockPos pos = data.readBlockPos();
|
||||
final BlockState blockState = BlockStateTranslator.via1_18_2toMc(data.readVarInt());
|
||||
@ -59,7 +59,7 @@ public abstract class MixinWorldPacketRewriter1_19 {
|
||||
throw new RuntimeException("Failed to handle BlockBreakAck packet data", t);
|
||||
}
|
||||
});
|
||||
wrapper.write(Types.STRING, ClientsideFeatures.PACKET_SYNC_IDENTIFIER);
|
||||
wrapper.write(Types.STRING, SyncTasks.PACKET_SYNC_IDENTIFIER);
|
||||
wrapper.write(Types.STRING, uuid);
|
||||
});
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import com.viaversion.viafabricplus.screen.VFPScreen;
|
||||
import com.viaversion.viafabricplus.settings.base.BooleanSetting;
|
||||
import com.viaversion.viafabricplus.settings.base.ButtonSetting;
|
||||
import com.viaversion.viafabricplus.settings.base.SettingGroup;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ConfirmScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
@ -42,8 +43,11 @@ import net.raphimc.minecraftauth.step.msa.StepMsaDeviceCodeMsaCode;
|
||||
import net.raphimc.minecraftauth.util.MicrosoftConstants;
|
||||
import net.raphimc.minecraftauth.util.logging.ConsoleLogger;
|
||||
import net.raphimc.minecraftauth.util.logging.ILogger;
|
||||
import net.raphimc.viabedrock.api.BedrockProtocolVersion;
|
||||
import net.raphimc.viabedrock.protocol.data.ProtocolConstants;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BedrockSettings extends SettingGroup {
|
||||
|
||||
@ -123,6 +127,23 @@ public class BedrockSettings extends SettingGroup {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the default port when parsing a server address if the default port should be replaced
|
||||
*
|
||||
* @param address The original address of the server
|
||||
* @param version The protocol version
|
||||
* @return The server address with the replaced default port
|
||||
*/
|
||||
public static String replaceDefaultPort(final String address, final ProtocolVersion version) {
|
||||
// If the default port for this entry should be replaced, check if the address already contains a port
|
||||
// We can't just replace vanilla's default port because a bedrock server might be running on the same port
|
||||
if (BedrockSettings.global().replaceDefaultPort.getValue() && Objects.equals(version, BedrockProtocolVersion.bedrockLatest) && !address.contains(":")) {
|
||||
return address + ":" + ProtocolConstants.BEDROCK_DEFAULT_PORT;
|
||||
} else {
|
||||
return address;
|
||||
}
|
||||
}
|
||||
|
||||
public static BedrockSettings global() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
@ -17,12 +17,13 @@
|
||||
"base.connection.MixinMinecraftClient",
|
||||
"base.connection.MixinMultiplayerServerListPinger",
|
||||
"base.integration.MixinClientConnection",
|
||||
"base.integration.MixinConnectScreen_1",
|
||||
"base.integration.MixinDebugHud",
|
||||
"base.integration.MixinMinecraftClient",
|
||||
"base.integration.MixinMultiplayerServerListPinger",
|
||||
"base.integration.MixinMultiplayerServerListPinger_1",
|
||||
"base.integration.MixinServerInfo",
|
||||
"base.integration.bedrock.MixinConnectScreen_1",
|
||||
"base.integration.sync_tasks.MixinClientCommonNetworkHandler",
|
||||
"base.ui.MixinAddServerScreen",
|
||||
"base.ui.MixinConfirmScreen",
|
||||
"base.ui.MixinConnectScreen_1",
|
||||
@ -72,6 +73,9 @@
|
||||
"features.block.interactions.MixinNoteBlock",
|
||||
"features.block.mining_calculations.MixinAbstractBlock",
|
||||
"features.block.mining_calculations.MixinAbstractBlock_AbstractBlockState",
|
||||
"features.classic_world_height.MixinBuiltChunk",
|
||||
"features.classic_world_height.MixinEntityPacketRewriter1_17",
|
||||
"features.classic_world_height.MixinWorldPacketRewriter1_17",
|
||||
"features.cpe_extensions.MixinClassicProtocolExtension",
|
||||
"features.cpe_extensions.MixinClientboundPacketsc0_30cpe",
|
||||
"features.cpe_extensions.MixinProtocolc0_30cpeToc0_28_30",
|
||||
@ -85,12 +89,23 @@
|
||||
"features.footstep_particle.MixinRegistrySyncManager",
|
||||
"features.item.filter_creative_tabs.MixinItemGroup_EntriesImpl",
|
||||
"features.item.filter_creative_tabs.MixinItemGroups",
|
||||
"features.item.interactions.MixinAxeItem",
|
||||
"features.item.interactions.MixinBlockItem",
|
||||
"features.item.interactions.MixinBowItem",
|
||||
"features.item.interactions.MixinBrushItem",
|
||||
"features.item.interactions.MixinBucketItem",
|
||||
"features.item.interactions.MixinEnderPearlItem",
|
||||
"features.item.interactions.MixinEquippableComponent",
|
||||
"features.item.interactions.MixinFireChargeItem",
|
||||
"features.item.negative_items.MixinDrawContext",
|
||||
"features.item.swinging.MixinBundleItem",
|
||||
"features.item.swinging.MixinFishingRodItem",
|
||||
"features.legacy_chat_signatures.MixinConnectScreen_1",
|
||||
"features.legacy_chat_signatures.MixinKeyPairResponse",
|
||||
"features.legacy_chat_signatures.MixinPlayerPublicKey_PublicKeyData",
|
||||
"features.legacy_chat_signatures.MixinProfileKeysImpl",
|
||||
"features.legacy_chat_signatures.MixinYggdrasilUserApiService",
|
||||
"features.legacy_tab_completions.MixinAbstractCommandBlockScreen",
|
||||
"features.legacy_tab_completions.MixinChatInputSuggestor",
|
||||
"features.legacy_tab_completions.MixinChatScreen",
|
||||
"features.max_chat_length.MixinChatMessageC2SPacket",
|
||||
@ -103,39 +118,57 @@
|
||||
"features.movement.block.MixinFlowableFluid",
|
||||
"features.movement.block.MixinHoneyBlock",
|
||||
"features.movement.block.MixinSoulSandBlock",
|
||||
"features.movement.elytra.MixinFireworkRocketItem",
|
||||
"features.movement.item.MixinEnderEyeItem",
|
||||
"features.movement.levitation_value.MixinStatusEffectInstance",
|
||||
"features.networking.auto_read.MixinClientConfigurationNetworkHandler",
|
||||
"features.networking.auto_read.MixinClientPlayNetworkHandler",
|
||||
"features.networking.auto_read.MixinNetworkStateTransitionHandler",
|
||||
"features.networking.auto_read.MixinNetworkStateTransitions",
|
||||
"features.networking.downloading_terrain_handling.MixinClientPlayNetworkHandler",
|
||||
"features.networking.downloading_terrain_handling.MixinDownloadingTerrainScreen",
|
||||
"features.networking.packet_handling_changes.MixinClientCommonNetworkHandler",
|
||||
"features.networking.pre_config_state.MixinNetworkStateTransitionHandler",
|
||||
"features.networking.pre_config_state.MixinNetworkStateTransitions",
|
||||
"features.networking.packet_handling_changes.MixinClientLoginNetworkHandler",
|
||||
"features.networking.registry_validations.MixinRegistryEntryList_Named",
|
||||
"features.networking.registry_validations.MixinRegistryEntryListCodec",
|
||||
"features.networking.remove_legacy_pinger.MixinMultiplayerServerListPinger",
|
||||
"features.networking.remove_signed_commands.MixinClientPlayNetworkHandler",
|
||||
"features.networking.remove_signed_commands.MixinProtocol1_20_3To1_20_5",
|
||||
"features.networking.resource_pack_header.MixinServerResourcePackLoader_4",
|
||||
"features.networking.srv_resolving.MixinAllowedAddressResolver",
|
||||
"features.networking.srv_resolving.MixinConnectScreen_1",
|
||||
"features.networking.srv_resolving.MixinRedirectResolver",
|
||||
"features.networking.srv_resolving.MixinServerAddress",
|
||||
"features.text_rendering.MixinFontStorage",
|
||||
"features.text_rendering.MixinLanguageManager",
|
||||
"features.networking.warn_feature_updates.MixinClientConfigurationNetworkHandler",
|
||||
"features.player_abilities.MixinUpdatePlayerAbilitiesC2SPacket",
|
||||
"features.run_command_action_handling.MixinScreen",
|
||||
"features.text_rendering.MixinTextRenderer_Drawer",
|
||||
"features.ui.beta_hud_elements.MixinInGameHud",
|
||||
"features.text_rendering.non_existing_characters.MixinFontStorage",
|
||||
"features.text_rendering.non_existing_characters.MixinLanguageManager",
|
||||
"features.ui.book_edit_page_limitations.MixinBookEditScreen",
|
||||
"features.ui.chat_indicator.MixinChatHud",
|
||||
"features.ui.chat_indicator.MixinChatScreen",
|
||||
"features.ui.classic_creative_menu.MixinCreativeInventoryScreen",
|
||||
"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.v1_7_tab_list_style.MixinClientPlayNetworkHandler",
|
||||
"features.ui.v1_7_tab_list_style.MixinPlayerListEntry",
|
||||
"features.ui.v1_7_tab_list_style.MixinPlayerListHud",
|
||||
"features.world.always_tick_entities.MixinClientWorld",
|
||||
"features.world.disable_sequencing.MixinClientWorld",
|
||||
"features.world.remove_server_view_distance.MixinGameOptions",
|
||||
"integration.viabedrock.MixinJoinPackets",
|
||||
"integration.vialegacy.MixinExtensionProtocolMetadataStorage",
|
||||
"integration.vialegacy.MixinViaLegacyConfig",
|
||||
"old.minecraft.MixinBuiltChunk",
|
||||
"old.minecraft.MixinCamera",
|
||||
"old.minecraft.MixinGameOptions",
|
||||
"old.minecraft.MixinMinecraftClient",
|
||||
"old.minecraft.MixinPlayerListEntry",
|
||||
"old.minecraft.MixinStaticSound",
|
||||
@ -168,39 +201,18 @@
|
||||
"old.minecraft.entity.MixinVillagerClothingFeatureRenderer",
|
||||
"old.minecraft.entity.MixinWolfEntity",
|
||||
"old.minecraft.entity.MixinZombieVillagerEntity",
|
||||
"old.minecraft.item.MixinAxeItem",
|
||||
"old.minecraft.item.MixinBlockItem",
|
||||
"old.minecraft.item.MixinBowItem",
|
||||
"old.minecraft.item.MixinBrushItem",
|
||||
"old.minecraft.item.MixinBucketItem",
|
||||
"old.minecraft.item.MixinBundleItem",
|
||||
"old.minecraft.item.MixinEnderEyeItem",
|
||||
"old.minecraft.item.MixinEnderPearlItem",
|
||||
"old.minecraft.item.MixinEquippableComponent",
|
||||
"old.minecraft.item.MixinFireChargeItem",
|
||||
"old.minecraft.item.MixinFireworkRocketItem",
|
||||
"old.minecraft.item.MixinFishingRodItem",
|
||||
"old.minecraft.item.MixinHeldItemRenderer",
|
||||
"old.minecraft.item.MixinItemCooldownManager",
|
||||
"old.minecraft.item.MixinItemPlacementContext",
|
||||
"features.interaction.MixinItemPlacementContext",
|
||||
"old.minecraft.item.MixinItemRenderer",
|
||||
"old.minecraft.item.MixinItemStack",
|
||||
"old.minecraft.item.MixinKnowledgeBookItem",
|
||||
"old.minecraft.item.MixinLeadItem",
|
||||
"old.minecraft.item.MixinShovelItem",
|
||||
"old.minecraft.item.MixinSwordItem",
|
||||
"old.minecraft.network.MixinClientConfigurationNetworkHandler",
|
||||
"old.minecraft.network.MixinClientLoginNetworkHandler",
|
||||
"old.minecraft.network.MixinClientPlayerInteractionManager",
|
||||
"features.item.tooltip_changes.MixinItemStack",
|
||||
"features.item.interactions.MixinKnowledgeBookItem",
|
||||
"features.item.swinging.MixinLeadItem",
|
||||
"features.item.interactions.MixinShovelItem",
|
||||
"features.item.interactions.MixinSwordItem",
|
||||
"features.interaction.MixinClientPlayerInteractionManager",
|
||||
"old.minecraft.network.MixinClientPlayNetworkHandler",
|
||||
"old.minecraft.network.MixinMultiplayerServerListWidget_ServerEntry",
|
||||
"old.minecraft.network.MixinUpdatePlayerAbilitiesC2SPacket",
|
||||
"old.minecraft.screen.MixinAbstractCommandBlockScreen",
|
||||
"old.minecraft.screen.MixinAbstractSignEditScreen",
|
||||
"old.minecraft.screen.MixinBookEditScreen",
|
||||
"old.minecraft.screen.MixinDownloadingTerrainScreen",
|
||||
"old.minecraft.screen.MixinGameModeSelectionScreen",
|
||||
"old.minecraft.screen.MixinGameModeSelectionScreen_GameModeSelection",
|
||||
"old.minecraft.screen.screenhandler.MixinAbstractFurnaceScreenHandler",
|
||||
"old.minecraft.screen.screenhandler.MixinBrewingStandScreenHandler_FuelSlot",
|
||||
"old.minecraft.screen.screenhandler.MixinCraftingScreenHandler",
|
||||
@ -214,7 +226,6 @@
|
||||
"old.viaversion.MixinCommonBoss",
|
||||
"old.viaversion.MixinEntityPacketRewriter1_12",
|
||||
"old.viaversion.MixinEntityPacketRewriter1_15",
|
||||
"old.viaversion.MixinEntityPacketRewriter1_17",
|
||||
"old.viaversion.MixinEntityPacketRewriter1_19_4",
|
||||
"old.viaversion.MixinEntityPacketRewriter1_20_3",
|
||||
"old.viaversion.MixinEntityPacketRewriter1_20_5",
|
||||
@ -225,12 +236,10 @@
|
||||
"old.viaversion.MixinItemPacketRewriter1_17",
|
||||
"old.viaversion.MixinItemPacketRewriter1_9",
|
||||
"old.viaversion.MixinNamedCompoundTagType",
|
||||
"old.viaversion.MixinProtocol1_20_3To1_20_5",
|
||||
"old.viaversion.MixinProtocol1_20To1_20_2",
|
||||
"old.viaversion.MixinTagType",
|
||||
"old.viaversion.MixinUserConnectionImpl",
|
||||
"old.viaversion.MixinWorldPacketRewriter1_16_2",
|
||||
"old.viaversion.MixinWorldPacketRewriter1_17",
|
||||
"old.viaversion.MixinWorldPacketRewriter1_19"
|
||||
],
|
||||
"injectors": {
|
||||
@ -238,5 +247,9 @@
|
||||
},
|
||||
"overwrites": {
|
||||
"requireAnnotations": true
|
||||
}
|
||||
},
|
||||
"mixins": [
|
||||
"features.recipe_emulation.MixinCraftingScreenHandler",
|
||||
"features.recipe_emulation.MixinPlayerScreenHandler"
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user