Fixed protocol/version blocking not doing anything

This commit is contained in:
RaphiMC 2023-07-26 10:51:26 +02:00
parent b744a2c6d4
commit ce10d26107
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -0,0 +1,34 @@
/*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy
* Copyright (C) 2023 RK_01/RaphiMC 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 net.raphimc.viaproxy.injection.transformer;
import com.viaversion.viaversion.connection.UserConnectionImpl;
import net.lenni0451.classtransform.InjectionCallback;
import net.lenni0451.classtransform.annotations.CTarget;
import net.lenni0451.classtransform.annotations.CTransformer;
import net.lenni0451.classtransform.annotations.injection.CInject;
@CTransformer(UserConnectionImpl.class)
public abstract class UserConnectionImplTransformer {
@CInject(method = "shouldApplyBlockProtocol", target = @CTarget("HEAD"), cancellable = true)
private void applyBlockProtocol(InjectionCallback ic) {
ic.setReturnValue(true);
}
}