mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-22 21:42:44 +01:00
Bump version
This commit is contained in:
parent
ecddd21132
commit
8290f6bbf7
@ -9,7 +9,7 @@ loader_version=0.14.19
|
||||
fabric_api_version=0.76.0+1.19.4
|
||||
|
||||
# viafabricplus
|
||||
mod_version=2.6.8
|
||||
mod_version=2.6.9
|
||||
maven_group=de.florianmichael
|
||||
archives_base_name=viafabricplus
|
||||
|
||||
|
@ -17,25 +17,14 @@
|
||||
*/
|
||||
package de.florianmichael.viafabricplus.definition.c0_30.command;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.command.ViaSubCommand;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
|
||||
import de.florianmichael.viafabricplus.util.ScreenUtil;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicCustomCommandProvider;
|
||||
|
||||
public abstract class ClassicViaSubCommand extends ViaSubCommand {
|
||||
|
||||
public void sendFeedback(final String message) {
|
||||
try {
|
||||
Via.getManager().getProviders().get(ClassicCustomCommandProvider.class).sendFeedback(currentViaConnection(), ScreenUtil.prefixedMessage(message));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public UserConnection currentViaConnection() {
|
||||
public UserConnection getUser() {
|
||||
return MinecraftClient.getInstance().getNetworkHandler().getConnection().channel.attr(ProtocolHack.LOCAL_VIA_CONNECTION).get();
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
package de.florianmichael.viafabricplus.definition.c0_30.command.impl;
|
||||
|
||||
import com.viaversion.viaversion.api.command.ViaCommandSender;
|
||||
import com.viaversion.viaversion.api.command.ViaSubCommand;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import de.florianmichael.viafabricplus.definition.c0_30.command.ClassicViaSubCommand;
|
||||
import de.florianmichael.viafabricplus.injection.access.IExtensionProtocolMetadataStorage;
|
||||
@ -39,11 +38,14 @@ public class ListExtensionsCommand extends ClassicViaSubCommand {
|
||||
|
||||
@Override
|
||||
public boolean execute(ViaCommandSender sender, String[] args) {
|
||||
final UserConnection connection = currentViaConnection();
|
||||
final UserConnection connection = getUser();
|
||||
if (!connection.has(ExtensionProtocolMetadataStorage.class)) {
|
||||
return false;
|
||||
sendMessage(sender, Formatting.RED + "Only for " + LegacyProtocolVersion.c0_30cpe.getName());
|
||||
return true;
|
||||
}
|
||||
((IExtensionProtocolMetadataStorage) connection.get(ExtensionProtocolMetadataStorage.class)).getServerExtensions().forEach((extension, version) -> this.sendFeedback(Formatting.GREEN + extension.getName() + Formatting.GOLD + " v" + version));
|
||||
((IExtensionProtocolMetadataStorage) connection.get(ExtensionProtocolMetadataStorage.class)).getServerExtensions().forEach((extension, version) -> {
|
||||
sendMessage(sender, Formatting.GREEN + extension.getName() + Formatting.GOLD + " v" + version);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -42,15 +42,16 @@ public class SetTimeCommand extends ClassicViaSubCommand {
|
||||
|
||||
@Override
|
||||
public boolean execute(ViaCommandSender sender, String[] args) {
|
||||
final UserConnection connection = currentViaConnection();
|
||||
final UserConnection connection = getUser();
|
||||
if (!connection.has(TimeLockStorage.class)) {
|
||||
return false;
|
||||
sendMessage(sender, Formatting.RED + "Only for <= " + LegacyProtocolVersion.a1_0_16toa1_0_16_2.getName());
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
if (args.length == 1) {
|
||||
final long time = Long.parseLong(args[0]) % 24_000L;
|
||||
connection.get(TimeLockStorage.class).setTime(time);
|
||||
this.sendFeedback(Formatting.GREEN + "Time has been set to " + Formatting.GOLD + time);
|
||||
sendMessage(sender, Formatting.GREEN + "Time has been set to " + Formatting.GOLD + time);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -65,7 +65,6 @@ import net.raphimc.viabedrock.api.BedrockProtocolVersion;
|
||||
import net.raphimc.viabedrock.protocol.providers.BlobCacheProvider;
|
||||
import net.raphimc.viabedrock.protocol.providers.NettyPipelineProvider;
|
||||
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
|
||||
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicCustomCommandProvider;
|
||||
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicMPPassProvider;
|
||||
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicWorldHeightProvider;
|
||||
import net.raphimc.vialegacy.protocols.release.protocol1_3_1_2to1_2_4_5.providers.OldAuthProvider;
|
||||
|
Loading…
Reference in New Issue
Block a user