From 2f5612aa05f550c19a096cc101673ea65505994c Mon Sep 17 00:00:00 2001 From: mdo992 <89719878+mdo992@users.noreply.github.com> Date: Wed, 8 Jun 2022 09:22:05 -0700 Subject: [PATCH] Updated to 1.19 --- gradle.properties | 8 ++++---- .../com/github/hhhzzzsss/songplayer/FakePlayerEntity.java | 2 +- .../java/com/github/hhhzzzsss/songplayer/Freecam.java | 1 - .../java/com/github/hhhzzzsss/songplayer/SongPlayer.java | 5 +++-- .../songplayer/mixin/ClientPlayerEntityMixin.java | 7 +++++-- .../hhhzzzsss/songplayer/noteblocks/BuildingThread.java | 2 +- src/main/resources/fabric.mod.json | 5 +++-- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/gradle.properties b/gradle.properties index 19732b9..09ea36e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.18.2 - yarn_mappings=1.18.2+build.2 - loader_version=0.13.3 + minecraft_version=1.19 + yarn_mappings=1.19+build.1 + loader_version=0.14.6 # Mod Properties mod_version = 1.2.0 @@ -14,4 +14,4 @@ org.gradle.jvmargs=-Xmx1G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.47.10+1.18.2 + fabric_version=0.55.2+1.19 diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java b/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java index 72fcbca..ebb1d90 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java @@ -10,7 +10,7 @@ public class FakePlayerEntity extends OtherClientPlayerEntity { ClientWorld world = SongPlayer.MC.world; public FakePlayerEntity() { - super(SongPlayer.MC.world, SongPlayer.MC.player.getGameProfile()); + super(SongPlayer.MC.world, SongPlayer.MC.player.getGameProfile(), SongPlayer.MC.player.getPublicKey()); copyStagePosAndPlayerLook(); diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java b/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java index 50ed130..7332d48 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java @@ -2,7 +2,6 @@ package com.github.hhhzzzsss.songplayer; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.Entity; -import net.minecraft.text.LiteralText; import net.minecraft.util.math.Vec3d; public class Freecam { diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java b/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java index 010f911..34b80c1 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/SongPlayer.java @@ -7,7 +7,8 @@ import com.github.hhhzzzsss.songplayer.song.Song; import net.fabricmc.api.ModInitializer; import net.minecraft.client.MinecraftClient; -import net.minecraft.text.LiteralText; +import net.minecraft.text.LiteralTextContent; +import net.minecraft.text.Text; public class SongPlayer implements ModInitializer { @@ -41,6 +42,6 @@ public class SongPlayer implements ModInitializer { } public static void addChatMessage(String message) { - MC.player.sendMessage(new LiteralText(message), false); + MC.player.sendMessage(Text.of(message), false); } } diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java index 36fc5d2..7926f26 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java @@ -8,11 +8,14 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import com.github.hhhzzzsss.songplayer.CommandProcessor; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.text.Text; + +import javax.annotation.Nullable; @Mixin(ClientPlayerEntity.class) public class ClientPlayerEntityMixin { - @Inject(at = @At("HEAD"), method = "sendChatMessage(Ljava/lang/String;)V", cancellable=true) - private void onSendChatMessage(String message, CallbackInfo ci) { + @Inject(at = @At("HEAD"), method = "sendChatMessage(Ljava/lang/String;Lnet/minecraft/text/Text;)V", cancellable=true) + private void onSendChatMessage(String message, @Nullable Text preview, CallbackInfo ci) { boolean isCommand = CommandProcessor.processChatMessage(message); if (isCommand) { ci.cancel(); diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.java b/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.java index fbbc850..693cbc5 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.java @@ -189,6 +189,6 @@ public class BuildingThread extends Thread { fx += p.getX(); fy += p.getY(); fz += p.getZ(); - SongPlayer.MC.interactionManager.interactBlock(player, world, Hand.MAIN_HAND, new BlockHitResult(new Vec3d(fx, fy, fz), Direction.UP, p, false)); + SongPlayer.MC.interactionManager.interactBlock(player, Hand.MAIN_HAND, new BlockHitResult(new Vec3d(fx, fy, fz), Direction.UP, p, false)); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 69a0db9..aa466f4 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -26,9 +26,10 @@ ], "depends": { - "fabricloader": ">=0.13.3", + "fabricloader": ">=0.14.6", "fabric": "*", - "minecraft": "1.18.x" + "minecraft": "~1.19", + "java": ">=17" }, "suggests": { "flamingo": "*"