Fix footstep particles causes client disconnect

Also carry custom particle id through modern particle mappings
This commit is contained in:
FlorianMichael 2024-05-28 22:03:19 +02:00
parent d0426c82e3
commit 49311d479f
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,46 @@
/*
* This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2021-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and RK_01/RaphiMC
* Copyright (C) 2023-2024 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.data.FullMappingsBase;
import com.viaversion.viaversion.api.data.Mappings;
import com.viaversion.viaversion.api.data.ParticleMappings;
import de.florianmichael.viafabricplus.fixes.versioned.visual.FootStepParticle1_12_2;
import org.spongepowered.asm.mixin.Mixin;
import java.util.List;
@Mixin(ParticleMappings.class)
public abstract class MixinParticleMappings extends FullMappingsBase {
public MixinParticleMappings(List<String> unmappedIdentifiers, List<String> mappedIdentifiers, Mappings mappings) {
super(unmappedIdentifiers, mappedIdentifiers, mappings);
}
@Override
public int getNewId(int id) {
if (id == FootStepParticle1_12_2.ID) {
return id;
} else {
return super.getNewId(id);
}
}
}

View File

@ -137,6 +137,8 @@
"fixes.minecraft.network.MixinClientPlayerInteractionManager",
"fixes.minecraft.network.MixinClientPlayNetworkHandler",
"fixes.minecraft.network.MixinMultiplayerServerListPinger",
"fixes.minecraft.network.MixinNetworkStateTransitionHandler",
"fixes.minecraft.network.MixinNetworkStateTransitions",
"fixes.minecraft.network.MixinPlayerListEntry",
"fixes.minecraft.network.MixinUpdatePlayerAbilitiesC2SPacket",
"fixes.minecraft.screen.MixinAbstractCommandBlockScreen",
@ -197,8 +199,7 @@
"viabedrock.MixinJoinPackets",
"vialegacy.MixinExtensionProtocolMetadataStorage",
"vialegacy.MixinViaLegacyConfig",
"fixes.minecraft.network.MixinNetworkStateTransitionHandler",
"fixes.minecraft.network.MixinNetworkStateTransitions"
"fixes.viaversion.MixinParticleMappings"
],
"injectors": {
"defaultRequire": 1