Updated to 1.19.1

This commit is contained in:
mdo992 2022-07-27 18:22:09 -07:00
parent 9a5b59e9f3
commit 372f6fa4f7
3 changed files with 11 additions and 12 deletions

View file

@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.19 minecraft_version=1.19.1
yarn_mappings=1.19+build.1 yarn_mappings=1.19.1+build.1
loader_version=0.14.6 loader_version=0.14.8
# Mod Properties # Mod Properties
mod_version = 2.0.0 mod_version = 2.0.0
@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1G
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.55.2+1.19 fabric_version=0.58.4+1.19.1

View file

@ -3,8 +3,7 @@ package com.github.hhhzzzsss.songplayer.mixin;
import com.github.hhhzzzsss.songplayer.CommandProcessor; import com.github.hhhzzzsss.songplayer.CommandProcessor;
import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder; import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.client.gui.screen.CommandSuggestor; import net.minecraft.client.gui.screen.ChatInputSuggestor;
import net.minecraft.client.gui.screen.CommandSuggestor.SuggestionWindow;
import net.minecraft.client.gui.widget.TextFieldWidget; import net.minecraft.client.gui.widget.TextFieldWidget;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
@ -14,8 +13,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@Mixin(CommandSuggestor.class) @Mixin(ChatInputSuggestor.class)
public class CommandSuggestorMixin { public class ChatInputSuggestorMixin {
@Shadow @Shadow
CompletableFuture<Suggestions> pendingSuggestions; CompletableFuture<Suggestions> pendingSuggestions;
@ -25,12 +24,12 @@ public class CommandSuggestorMixin {
} }
@Shadow @Shadow
public void showSuggestions(boolean narrateFirstSuggestion) {} public void show(boolean narrateFirstSuggestion) {}
@Shadow @Shadow
final TextFieldWidget textField; final TextFieldWidget textField;
public CommandSuggestorMixin() { public ChatInputSuggestorMixin() {
textField = null; textField = null;
} }
@ -47,7 +46,7 @@ public class CommandSuggestorMixin {
CompletableFuture<Suggestions> suggestions = CommandProcessor.handleSuggestions(preStr, new SuggestionsBuilder(preStr, wordStart)); CompletableFuture<Suggestions> suggestions = CommandProcessor.handleSuggestions(preStr, new SuggestionsBuilder(preStr, wordStart));
if (suggestions != null) { if (suggestions != null) {
this.pendingSuggestions = suggestions; this.pendingSuggestions = suggestions;
this.showSuggestions(true); this.show(true);
} }
} }
} }

View file

@ -8,7 +8,7 @@
"client": [ "client": [
"ClientPlayerEntityMixin", "ClientPlayerEntityMixin",
"ClientPlayNetworkHandlerMixin", "ClientPlayNetworkHandlerMixin",
"CommandSuggestorMixin", "ChatInputSuggestorMixin",
"InGameHudMixin", "InGameHudMixin",
"MinecraftClientMixin" "MinecraftClientMixin"
], ],