mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-09-28 04:27:25 +02:00
Update VV API usage
This commit is contained in:
parent
0ea07d0e63
commit
18fd102a68
@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.access;
|
|
||||||
|
|
||||||
public interface IViaCommandHandler {
|
|
||||||
|
|
||||||
void viaFabricPlus$removeSubCommand(final String name);
|
|
||||||
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.viaversion;
|
|
||||||
|
|
||||||
import com.viaversion.viaversion.api.command.ViaSubCommand;
|
|
||||||
import com.viaversion.viaversion.commands.ViaCommandHandler;
|
|
||||||
import de.florianmichael.viafabricplus.injection.access.IViaCommandHandler;
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Mixin(ViaCommandHandler.class)
|
|
||||||
public abstract class MixinViaCommandHandler implements IViaCommandHandler {
|
|
||||||
|
|
||||||
@Shadow
|
|
||||||
@Final
|
|
||||||
private Map<String, ViaSubCommand> commandMap;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void viaFabricPlus$removeSubCommand(String name) {
|
|
||||||
this.commandMap.remove(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -25,7 +25,6 @@ import com.mojang.brigadier.suggestion.Suggestions;
|
|||||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||||
import de.florianmichael.viafabricplus.fixes.versioned.classic.command.ListExtensionsCommand;
|
import de.florianmichael.viafabricplus.fixes.versioned.classic.command.ListExtensionsCommand;
|
||||||
import de.florianmichael.viafabricplus.fixes.versioned.classic.command.SetTimeCommand;
|
import de.florianmichael.viafabricplus.fixes.versioned.classic.command.SetTimeCommand;
|
||||||
import de.florianmichael.viafabricplus.injection.access.IViaCommandHandler;
|
|
||||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||||
import net.raphimc.vialoader.impl.viaversion.VLCommandHandler;
|
import net.raphimc.vialoader.impl.viaversion.VLCommandHandler;
|
||||||
|
|
||||||
@ -36,13 +35,12 @@ public class ViaFabricPlusVLCommandHandler extends VLCommandHandler {
|
|||||||
public ViaFabricPlusVLCommandHandler() {
|
public ViaFabricPlusVLCommandHandler() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this.removeSubCommand("list");
|
||||||
|
this.removeSubCommand("player");
|
||||||
|
this.removeSubCommand("pps");
|
||||||
|
|
||||||
this.registerSubCommand(new ListExtensionsCommand());
|
this.registerSubCommand(new ListExtensionsCommand());
|
||||||
this.registerSubCommand(new SetTimeCommand());
|
this.registerSubCommand(new SetTimeCommand());
|
||||||
|
|
||||||
final IViaCommandHandler mixin = (IViaCommandHandler) this;
|
|
||||||
mixin.viaFabricPlus$removeSubCommand("list");
|
|
||||||
mixin.viaFabricPlus$removeSubCommand("player");
|
|
||||||
mixin.viaFabricPlus$removeSubCommand("pps");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int execute(final CommandContext<FabricClientCommandSource> ctx) {
|
public int execute(final CommandContext<FabricClientCommandSource> ctx) {
|
||||||
|
@ -200,8 +200,7 @@
|
|||||||
"fixes.viaversion.MixinWorldPacketRewriter1_19",
|
"fixes.viaversion.MixinWorldPacketRewriter1_19",
|
||||||
"viabedrock.MixinJoinPackets",
|
"viabedrock.MixinJoinPackets",
|
||||||
"vialegacy.MixinExtensionProtocolMetadataStorage",
|
"vialegacy.MixinExtensionProtocolMetadataStorage",
|
||||||
"vialegacy.MixinViaLegacyConfig",
|
"vialegacy.MixinViaLegacyConfig"
|
||||||
"viaversion.MixinViaCommandHandler"
|
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
Loading…
Reference in New Issue
Block a user