less package structure in mixins, moved some classes ™️

This commit is contained in:
FlorianMichael 2023-11-05 19:26:28 +01:00
parent d19e330232
commit aa903430d8
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
24 changed files with 112 additions and 132 deletions

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_12to1_11_1; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.protocols.protocol1_12to1_11_1.ChatItemRewriter; import com.viaversion.viaversion.protocols.protocol1_12to1_11_1.ChatItemRewriter;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_9to1_8; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.chunks.*; import com.viaversion.viaversion.api.minecraft.chunks.*;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_9to1_8; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.CommandBlockProvider; import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.CommandBlockProvider;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_11to1_10; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_11to1_10.EntityIdRewriter; import com.viaversion.viaversion.protocols.protocol1_11to1_10.EntityIdRewriter;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_17to1_16_4; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.protocol.Protocol; import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_9to1_8; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_9to1_8; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.EntityTracker1_9; import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.EntityTracker1_9;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_17to1_16_4; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.libs.fastutil.ints.IntList; import com.viaversion.viaversion.libs.fastutil.ints.IntList;
import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.storage.InventoryAcknowledgements; import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.storage.InventoryAcknowledgements;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_14to1_13_2; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.ProtocolPathEntry; import com.viaversion.viaversion.api.protocol.ProtocolPathEntry;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_15to1_14_4; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.entities.EntityType;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_9to1_8; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.entities.EntityType;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_11to1_10; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import de.florianmichael.viafabricplus.definition.ClientsideFixes; import de.florianmichael.viafabricplus.definition.ClientsideFixes;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;

View File

@ -0,0 +1,45 @@
/*
* This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.packet.PacketType;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
import de.florianmichael.viafabricplus.injection.access.IProtocol1_13To1_12_2;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(targets = "com.viaversion.viaversion.protocols.protocol1_12to1_11_1.Protocol1_12To1_11_1$3", remap = false)
public class MixinProtocol1_12To1_11_1_3 {
@Redirect(method = "lambda$register$1", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;create(Lcom/viaversion/viaversion/api/protocol/packet/PacketType;Lcom/viaversion/viaversion/api/protocol/remapper/PacketHandler;)Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;"))
private static PacketWrapper writeRecipes(PacketWrapper instance, PacketType packetType, PacketHandler handler) throws Exception {
return instance.create(packetType, wrapper -> {
final IProtocol1_13To1_12_2 protocol = (IProtocol1_13To1_12_2) wrapper.user().getProtocolInfo().getPipeline().getProtocol(Protocol1_13To1_12_2.class);
if (protocol == null) {
Via.getPlatform().getLogger().warning("Cannot write recipes! 1.13 -> 1.12.2 protocol not found!");
return;
}
protocol.viafabricplus_writeDeclareRecipes(wrapper);
});
}
}

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_13to1_12_2; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.NumberTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.NumberTag;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.blockentities.SkullHandler; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.blockentities.SkullHandler;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_13to1_12_2; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.packets.WorldPackets; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.packets.WorldPackets;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_16_2to1_16_1; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.packets.WorldPackets; import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.packets.WorldPackets;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@ -23,7 +23,7 @@ import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant; import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = WorldPackets.class, remap = false) @Mixin(value = WorldPackets.class, remap = false)
public abstract class MixinWorldPackets_2 { public abstract class MixinWorldPackets1_16_2 {
@ModifyConstant(method = "lambda$register$1", constant = @Constant(intValue = 16)) @ModifyConstant(method = "lambda$register$1", constant = @Constant(intValue = 16))
private static int modifySectionCountToSupportClassicWorldHeight(int constant) { private static int modifySectionCountToSupportClassicWorldHeight(int constant) {

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_17to1_16_4; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.protocol.Protocol; import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_19to1_18_2; package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
@ -31,7 +31,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = WorldPackets.class, remap = false) @Mixin(value = WorldPackets.class, remap = false)
public class MixinWorldPackets { public class MixinWorldPackets1_19 {
@Redirect(method = "register", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2;cancelClientbound(Lcom/viaversion/viaversion/api/protocol/packet/ClientboundPacketType;)V")) @Redirect(method = "register", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2;cancelClientbound(Lcom/viaversion/viaversion/api/protocol/packet/ClientboundPacketType;)V"))
private static void passAcknowledgePlayerDigging(Protocol1_19To1_18_2 instance, ClientboundPacketType clientboundPacketType) { private static void passAcknowledgePlayerDigging(Protocol1_19To1_18_2 instance, ClientboundPacketType clientboundPacketType) {

View File

@ -1,63 +0,0 @@
/*
* This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_12to1_11_1;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.ClientWorld;
import com.viaversion.viaversion.api.protocol.AbstractProtocol;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.protocols.protocol1_12to1_11_1.ClientboundPackets1_12;
import com.viaversion.viaversion.protocols.protocol1_12to1_11_1.Protocol1_12To1_11_1;
import com.viaversion.viaversion.protocols.protocol1_12to1_11_1.ServerboundPackets1_12;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ClientboundPackets1_13;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ClientboundPackets1_9_3;
import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ServerboundPackets1_9_3;
import de.florianmichael.viafabricplus.injection.access.IProtocol1_13To1_12_2;
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 = Protocol1_12To1_11_1.class, remap = false)
public class MixinProtocol1_12To1_11_1 extends AbstractProtocol<ClientboundPackets1_9_3, ClientboundPackets1_12, ServerboundPackets1_9_3, ServerboundPackets1_12> {
@Inject(method = "registerPackets", at = @At("RETURN"))
public void enforceRecipeWriting(CallbackInfo ci) {
registerClientbound(ClientboundPackets1_9_3.JOIN_GAME, new PacketHandlers() {
@Override
public void register() {
map(Type.INT);
map(Type.UNSIGNED_BYTE);
map(Type.INT);
handler(wrapper -> {
wrapper.user().get(ClientWorld.class).setEnvironment(wrapper.get(Type.INT, 1));
final IProtocol1_13To1_12_2 protocol = (IProtocol1_13To1_12_2) wrapper.user().getProtocolInfo().getPipeline().getProtocol(Protocol1_13To1_12_2.class);
if (protocol == null) {
Via.getPlatform().getLogger().warning("Protocol1_13To1_12_2 not found!");
return;
}
wrapper.create(ClientboundPackets1_13.DECLARE_RECIPES, protocol::viafabricplus_writeDeclareRecipes).scheduleSend(Protocol1_13To1_12_2.class);
});
}
});
}
}

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_13to1_12_2; package de.florianmichael.viafabricplus.injection.mixin.viaversion;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.BlockFace; import com.viaversion.viaversion.api.minecraft.BlockFace;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_13to1_12_2; package de.florianmichael.viafabricplus.injection.mixin.viaversion;
import com.viaversion.viaversion.api.connection.ProtocolInfo; import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protocol1_13to1_12_2; package de.florianmichael.viafabricplus.injection.mixin.viaversion;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2023 RK_01/RaphiMC and contributors * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion; package de.florianmichael.viafabricplus.injection.mixin.viaversion;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.protocol.version.VersionRange; import com.viaversion.viaversion.api.protocol.version.VersionRange;

View File

@ -149,34 +149,32 @@
"fixes.vialegacy.MixinViaLegacyConfig", "fixes.vialegacy.MixinViaLegacyConfig",
"fixes.viaversion.MixinCommonBoss", "fixes.viaversion.MixinCommonBoss",
"fixes.viaversion.MixinNamedCompoundTagType", "fixes.viaversion.MixinNamedCompoundTagType",
"fixes.viaversion.MixinProtocolVersion", "viaversion.MixinProtocolVersion",
"fixes.viaversion.protocol1_11to1_10.MixinEntityIdRewriter", "fixes.viaversion.MixinEntityIdRewriter",
"fixes.viaversion.protocol1_11to1_10.MixinProtocol1_11To1_10", "fixes.viaversion.MixinProtocol1_11To1_10",
"fixes.viaversion.protocol1_12to1_11_1.MixinChatItemRewriter", "fixes.viaversion.MixinChatItemRewriter",
"fixes.viaversion.protocol1_13to1_12_2.MixinAbstractFenceConnectionHandler", "viaversion.MixinAbstractFenceConnectionHandler",
"fixes.viaversion.protocol1_13to1_12_2.MixinGlassConnectionHandler", "viaversion.MixinGlassConnectionHandler",
"fixes.viaversion.protocol1_13to1_12_2.MixinSkullHandler", "fixes.viaversion.MixinSkullHandler",
"fixes.viaversion.protocol1_13to1_12_2.MixinWorldPackets1_13", "fixes.viaversion.MixinWorldPackets1_13",
"fixes.viaversion.protocol1_14to1_13_2.MixinInventoryPackets", "fixes.viaversion.MixinInventoryPackets",
"fixes.viaversion.protocol1_15to1_14_4.MixinMetadataRewriter1_15To1_14_4", "fixes.viaversion.MixinMetadataRewriter1_15To1_14_4",
"fixes.viaversion.protocol1_16_2to1_16_1.MixinWorldPackets_2", "fixes.viaversion.MixinWorldPackets1_16_2",
"fixes.viaversion.protocol1_17to1_16_4.MixinEntityPackets1_17", "fixes.viaversion.MixinEntityPackets1_17",
"fixes.viaversion.protocol1_17to1_16_4.MixinInventoryAcknowledgements", "fixes.viaversion.MixinInventoryAcknowledgements",
"fixes.viaversion.protocol1_17to1_16_4.MixinWorldPackets1_17", "fixes.viaversion.MixinWorldPackets1_17",
"fixes.viaversion.protocol1_19to1_18_2.MixinWorldPackets", "fixes.viaversion.MixinWorldPackets1_19",
"fixes.viaversion.protocol1_9to1_8.MixinChunkType1_8", "fixes.viaversion.MixinChunkType1_8",
"fixes.viaversion.protocol1_9to1_8.MixinCommandBlockProvider", "fixes.viaversion.MixinCommandBlockProvider",
"fixes.viaversion.protocol1_9to1_8.MixinEntityPackets_6_1", "fixes.viaversion.MixinEntityPackets_6_1",
"fixes.viaversion.protocol1_9to1_8.MixinEntityTracker1_9", "fixes.viaversion.MixinEntityTracker1_9",
"fixes.viaversion.protocol1_9to1_8.MixinMetadataRewriter1_9To1_8", "fixes.viaversion.MixinMetadataRewriter1_9To1_8",
"jsonwebtoken.MixinClasses", "jsonwebtoken.MixinClasses",
"jsonwebtoken.MixinDefaultJwtParserBuilder" "jsonwebtoken.MixinDefaultJwtParserBuilder",
"fixes.viaversion.MixinProtocol1_12To1_11_1_3",
"viaversion.MixinProtocol1_13To1_12_2"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1
}, }
"mixins": [
"fixes.viaversion.protocol1_12to1_11_1.MixinProtocol1_12To1_11_1",
"fixes.viaversion.protocol1_13to1_12_2.MixinProtocol1_13To1_12_2"
]
} }