diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$Command.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$Command.class index 8073122..ba7630b 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$Command.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$Command.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$currentCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$currentCommand.class index 37a3f70..77f96db 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$currentCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$currentCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$gotoCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$gotoCommand.class index 744652e..3e833a4 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$gotoCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$gotoCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$helpCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$helpCommand.class index e5e6845..dc6f3d0 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$helpCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$helpCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$loopCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$loopCommand.class index 7d05177..0806161 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$loopCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$loopCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playCommand.class index 6ffd296..69f2e6a 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playurlCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playurlCommand.class index b3b51ef..fb4fd5a 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playurlCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$playurlCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setCreativeCommandCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setCreativeCommandCommand.class index e7678a4..4b79d81 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setCreativeCommandCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setCreativeCommandCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setSurvivalCommandCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setSurvivalCommandCommand.class index 3cf1e8f..d26c172 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setSurvivalCommandCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$setSurvivalCommandCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$songsCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$songsCommand.class index 95fe6df..fb63079 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$songsCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$songsCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$stopCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$stopCommand.class index 32a11ba..8e1c5f1 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$stopCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$stopCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$toggleFakePlayerCommand.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$toggleFakePlayerCommand.class index dfb4633..8d6f0c0 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$toggleFakePlayerCommand.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor$toggleFakePlayerCommand.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor.class index b9abd75..de7447f 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/CommandProcessor.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/FakePlayerEntity.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/FakePlayerEntity.class index 97084df..4209fff 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/FakePlayerEntity.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/FakePlayerEntity.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/Freecam.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/Freecam.class index b599d0b..fc21f49 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/Freecam.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/Freecam.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer$Mode.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer$Mode.class index 3c4f2c9..ac40cb6 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer$Mode.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer$Mode.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer.class index 58f79bd..2b8f31e 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/SongPlayer.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.class index 66e88af..128d200 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.class index a95d36e..2873b78 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/KeyboardMixin.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/KeyboardMixin.class index 505a274..834743a 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/KeyboardMixin.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/KeyboardMixin.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/MinecraftClientMixin.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/MinecraftClientMixin.class index d29de64..c888648 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/MinecraftClientMixin.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/mixin/MinecraftClientMixin.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.class index 6a32ba1..55ca151 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.class index 5fa447b..10108c6 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/Stage.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/Stage.class index 6dbc8dd..47dc9d1 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/Stage.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/noteblocks/Stage.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/DownloadingThread.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/DownloadingThread.class index f8cc647..5609d63 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/DownloadingThread.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/DownloadingThread.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter$1.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter$1.class index d7476fb..f7f0029 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter$1.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter$1.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter.class index 69b2557..aec6774 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/MidiConverter.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/NoteEvent.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/NoteEvent.class index 05e6423..31892d4 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/NoteEvent.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/NoteEvent.class differ diff --git a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/Song.class b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/Song.class index b07ccfe..50bbacb 100644 Binary files a/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/Song.class and b/build/classes/java/main/com/github/hhhzzzsss/songplayer/song/Song.class differ diff --git a/build/libs/song-player-1.1.0-dev.jar b/build/libs/song-player-1.1.0-dev.jar new file mode 100644 index 0000000..4f0e000 Binary files /dev/null and b/build/libs/song-player-1.1.0-dev.jar differ diff --git a/build/libs/song-player-1.1.0-sources-dev.jar b/build/libs/song-player-1.1.0-sources-dev.jar new file mode 100644 index 0000000..14def29 Binary files /dev/null and b/build/libs/song-player-1.1.0-sources-dev.jar differ diff --git a/build/libs/song-player-1.1.0-sources.jar b/build/libs/song-player-1.1.0-sources.jar new file mode 100644 index 0000000..cdb2ff3 Binary files /dev/null and b/build/libs/song-player-1.1.0-sources.jar differ diff --git a/build/libs/song-player-1.1.0.jar b/build/libs/song-player-1.1.0.jar new file mode 100644 index 0000000..a615fd7 Binary files /dev/null and b/build/libs/song-player-1.1.0.jar differ diff --git a/build/loom-cache/mixin-map-1.17-1.17+build.1-v2.0.tiny b/build/loom-cache/mixin-map-1.17-1.17+build.1-v2.0.tiny new file mode 100644 index 0000000..c76c431 --- /dev/null +++ b/build/loom-cache/mixin-map-1.17-1.17+build.1-v2.0.tiny @@ -0,0 +1,2 @@ +v1 named intermediary +FIELD com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin Lnet/minecraft/network/ClientConnection; connection field_3689 diff --git a/build/loom-cache/mixin-map-1.17-1.17+build.13-v2.0.tiny b/build/loom-cache/mixin-map-1.17-1.17+build.13-v2.0.tiny new file mode 100644 index 0000000..a45443c --- /dev/null +++ b/build/loom-cache/mixin-map-1.17-1.17+build.13-v2.0.tiny @@ -0,0 +1 @@ +v1 named intermediary diff --git a/build/resources/main/fabric.mod.json b/build/resources/main/fabric.mod.json index b87cd18..3f8b0e0 100644 --- a/build/resources/main/fabric.mod.json +++ b/build/resources/main/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "songplayer", - "version": "1.0.0", + "version": "1.1.0", "name": "Song Player", "description": "Builds and plays noteblocks", @@ -29,7 +29,7 @@ "depends": { "fabricloader": ">=0.7.4", "fabric": "*", - "minecraft": "1.16.x" + "minecraft": "1.17.x" }, "suggests": { "flamingo": "*" diff --git a/build/tmp/compileJava/source-classes-mapping.txt b/build/tmp/compileJava/source-classes-mapping.txt index dc450f0..087e4a8 100644 --- a/build/tmp/compileJava/source-classes-mapping.txt +++ b/build/tmp/compileJava/source-classes-mapping.txt @@ -1,8 +1,8 @@ +com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java + com.github.hhhzzzsss.songplayer.mixin.ClientPlayerEntityMixin com/github/hhhzzzsss/songplayer/SongPlayer.java com.github.hhhzzzsss.songplayer.SongPlayer com.github.hhhzzzsss.songplayer.SongPlayer$Mode -com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java - com.github.hhhzzzsss.songplayer.mixin.ClientPlayerEntityMixin com/github/hhhzzzsss/songplayer/mixin/KeyboardMixin.java com.github.hhhzzzsss.songplayer.mixin.KeyboardMixin com/github/hhhzzzsss/songplayer/mixin/MinecraftClientMixin.java @@ -24,7 +24,6 @@ com/github/hhhzzzsss/songplayer/song/Song.java com.github.hhhzzzsss.songplayer.song.Song com/github/hhhzzzsss/songplayer/CommandProcessor.java com.github.hhhzzzsss.songplayer.CommandProcessor - com.github.hhhzzzsss.songplayer.CommandProcessor$1 com.github.hhhzzzsss.songplayer.CommandProcessor$Command com.github.hhhzzzsss.songplayer.CommandProcessor$currentCommand com.github.hhhzzzsss.songplayer.CommandProcessor$gotoCommand @@ -37,9 +36,9 @@ com/github/hhhzzzsss/songplayer/CommandProcessor.java com.github.hhhzzzsss.songplayer.CommandProcessor$songsCommand com.github.hhhzzzsss.songplayer.CommandProcessor$stopCommand com.github.hhhzzzsss.songplayer.CommandProcessor$toggleFakePlayerCommand -com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java - com.github.hhhzzzsss.songplayer.mixin.ClientPlayNetworkHandlerMixin com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.java com.github.hhhzzzsss.songplayer.noteblocks.PlayingThread +com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java + com.github.hhhzzzsss.songplayer.mixin.ClientPlayNetworkHandlerMixin com/github/hhhzzzsss/songplayer/song/DownloadingThread.java com.github.hhhzzzsss.songplayer.song.DownloadingThread diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java index 5d276a4..d0c914e 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java @@ -12,6 +12,8 @@ import com.github.hhhzzzsss.songplayer.noteblocks.Stage; import com.github.hhhzzzsss.songplayer.song.DownloadingThread; import com.github.hhhzzzsss.songplayer.song.Song; +import net.minecraft.entity.Entity; + public class CommandProcessor { public static ArrayList commands = new ArrayList<>(); @@ -178,7 +180,7 @@ public class CommandProcessor { } if (args.length() == 0) { if (SongPlayer.fakePlayer != null) { - SongPlayer.fakePlayer.remove(); + SongPlayer.fakePlayer.remove(Entity.RemovalReason.DISCARDED); SongPlayer.fakePlayer = null; } SongPlayer.stage.movePlayerToStagePosition(); @@ -382,7 +384,7 @@ public class CommandProcessor { if (SongPlayer.showFakePlayer) { if (SongPlayer.mode == Mode.PLAYING || SongPlayer.mode == Mode.BUILDING) { if (SongPlayer.fakePlayer != null) { - SongPlayer.fakePlayer.remove(); + SongPlayer.fakePlayer.remove(Entity.RemovalReason.DISCARDED); } SongPlayer.fakePlayer = new FakePlayerEntity(); } @@ -390,7 +392,7 @@ public class CommandProcessor { } else { if (SongPlayer.fakePlayer != null) { - SongPlayer.fakePlayer.remove(); + SongPlayer.fakePlayer.remove(Entity.RemovalReason.DISCARDED); } SongPlayer.addChatMessage("ยง6Disabled fake player"); } diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java b/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java index 065a8ad..72fcbca 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/FakePlayerEntity.java @@ -14,7 +14,7 @@ public class FakePlayerEntity extends OtherClientPlayerEntity { copyStagePosAndPlayerLook(); - inventory.clone(player.inventory); + getInventory().clone(player.getInventory()); Byte playerModel = player.getDataTracker().get(PlayerEntity.PLAYER_MODEL_PARTS); getDataTracker().set(PlayerEntity.PLAYER_MODEL_PARTS, playerModel); @@ -26,16 +26,16 @@ public class FakePlayerEntity extends OtherClientPlayerEntity { capeY = getY(); capeZ = getZ(); - world.addEntity(getEntityId(), this); + world.addEntity(getId(), this); } public void resetPlayerPosition() { - player.refreshPositionAndAngles(getX(), getY(), getZ(), yaw, pitch); + player.refreshPositionAndAngles(getX(), getY(), getZ(), getYaw(), getPitch()); } public void copyStagePosAndPlayerLook() { if (SongPlayer.stage != null) { - refreshPositionAndAngles(SongPlayer.stage.position.getX()+0.5, SongPlayer.stage.position.getY(), SongPlayer.stage.position.getZ()+0.5, player.yaw, player.pitch); + refreshPositionAndAngles(SongPlayer.stage.position.getX()+0.5, SongPlayer.stage.position.getY(), SongPlayer.stage.position.getZ()+0.5, player.getYaw(), player.getPitch()); headYaw = player.headYaw; bodyYaw = player.bodyYaw; } diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java b/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java index f0aaf6c..50ed130 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/Freecam.java @@ -1,6 +1,7 @@ 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; @@ -31,7 +32,7 @@ public class Freecam { enabled = false; if (fakePlayer != null) { fakePlayer.resetPlayerPosition(); - fakePlayer.remove(); + fakePlayer.remove(Entity.RemovalReason.DISCARDED); fakePlayer = null; player.setVelocity(Vec3d.ZERO); } diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java index a2595db..b27a8d6 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayNetworkHandlerMixin.java @@ -30,7 +30,7 @@ public class ClientPlayNetworkHandlerMixin { ci.cancel(); }*/ if (SongPlayer.mode != SongPlayer.Mode.IDLE && packet instanceof PlayerMoveC2SPacket) { - connection.send(new PlayerMoveC2SPacket.Both(SongPlayer.stage.position.getX()+0.5, SongPlayer.stage.position.getY(), SongPlayer.stage.position.getZ()+0.5, SongPlayer.MC.player.yaw, SongPlayer.MC.player.pitch, true)); + connection.send(new PlayerMoveC2SPacket.Full(SongPlayer.stage.position.getX()+0.5, SongPlayer.stage.position.getY(), SongPlayer.stage.position.getZ()+0.5, SongPlayer.MC.player.getYaw(), SongPlayer.MC.player.getPitch(), true)); if (SongPlayer.fakePlayer != null) { SongPlayer.fakePlayer.copyStagePosAndPlayerLook(); } 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 c38265e..36fc5d2 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/mixin/ClientPlayerEntityMixin.java @@ -18,4 +18,4 @@ public class ClientPlayerEntityMixin { ci.cancel(); } } -} +} \ No newline at end of file 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 74cdf8b..fbbc850 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/BuildingThread.java @@ -8,11 +8,13 @@ import com.github.hhhzzzsss.songplayer.song.Song; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtCompound; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; @@ -22,12 +24,12 @@ import net.minecraft.world.GameMode; public class BuildingThread extends Thread { private final ClientPlayerEntity player = SongPlayer.MC.player; - private final PlayerInventory inventory = SongPlayer.MC.player.inventory; + private final PlayerInventory inventory = SongPlayer.MC.player.getInventory(); private final ClientWorld world = SongPlayer.MC.world; private final Stage stage = SongPlayer.stage; private final BlockPos stagePos = SongPlayer.stage.position; private final Song song = SongPlayer.song; - private final int NOTEBLOCK_BASE_ID = 249; + private final int NOTEBLOCK_BASE_ID = Block.getRawIdFromState(Blocks.NOTE_BLOCK.getDefaultState()); private final String[] instrumentNames = {"harp", "basedrum", "snare", "hat", "bass", "flute", "bell", "guitar", "chime", "xylophone", "iron_xylophone", "cow_bell", "didgeridoo", "bit", "banjo", "pling"}; private boolean[] missingNotes = new boolean[400]; @@ -44,7 +46,7 @@ public class BuildingThread extends Thread { BlockPos pos = new BlockPos(stagePos.getX()+dx, stagePos.getY()+dy, stagePos.getZ()+dz); BlockState bs = world.getBlockState(pos); int blockId = Block.getRawIdFromState(bs); - if (blockId >= 249 && blockId <= 1048) { + if (blockId >= NOTEBLOCK_BASE_ID && blockId < NOTEBLOCK_BASE_ID+800) { int noteId = (blockId-NOTEBLOCK_BASE_ID)/2; if (missingNotes[noteId]) { stage.tunedNoteblocks[noteId] = pos; @@ -89,12 +91,12 @@ public class BuildingThread extends Thread { return; } } - player.abilities.allowFlying = true; - player.abilities.flying = true; + player.getAbilities().allowFlying = true; + player.getAbilities().flying = true; SongPlayer.stage.movePlayerToStagePosition(); if (SongPlayer.showFakePlayer) { if (SongPlayer.fakePlayer != null) { - SongPlayer.fakePlayer.remove(); + SongPlayer.fakePlayer.remove(Entity.RemovalReason.DISCARDED); } SongPlayer.fakePlayer = new FakePlayerEntity(); } @@ -167,16 +169,16 @@ public class BuildingThread extends Thread { private void holdNoteblock(int id) { int instrument = id/25; int note = id%25; - CompoundTag nbt = new CompoundTag(); + NbtCompound nbt = new NbtCompound(); nbt.putString("id", "minecraft:note_block"); nbt.putByte("Count", (byte) 1); - CompoundTag tag = new CompoundTag(); - CompoundTag bsTag = new CompoundTag(); + NbtCompound tag = new NbtCompound(); + NbtCompound bsTag = new NbtCompound(); bsTag.putString("instrument", instrumentNames[instrument]); bsTag.putString("note", Integer.toString(note)); tag.put("BlockStateTag", bsTag); nbt.put("tag", tag); - inventory.main.set(inventory.selectedSlot, ItemStack.fromTag(nbt)); + inventory.main.set(inventory.selectedSlot, ItemStack.fromNbt(nbt)); SongPlayer.MC.interactionManager.clickCreativeStack(player.getStackInHand(Hand.MAIN_HAND), 36 + inventory.selectedSlot); } diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.java b/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.java index 5f212a2..e9fb5e4 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/PlayingThread.java @@ -4,6 +4,7 @@ import com.github.hhhzzzsss.songplayer.SongPlayer; import com.github.hhhzzzsss.songplayer.song.Song; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.entity.Entity; import net.minecraft.util.math.Direction; import net.minecraft.world.GameMode; @@ -25,8 +26,8 @@ public class PlayingThread extends Thread{ } stage.rebuild = false; - player.abilities.allowFlying = true; - player.abilities.flying = true; + player.getAbilities().allowFlying = true; + player.getAbilities().flying = true; SongPlayer.stage.movePlayerToStagePosition(); long songStartTime = System.currentTimeMillis() - song.get(song.position).time; @@ -82,11 +83,11 @@ public class PlayingThread extends Thread{ } } - player.abilities.allowFlying = true; - player.abilities.flying = true; + player.getAbilities().allowFlying = true; + player.getAbilities().flying = true; SongPlayer.stage.movePlayerToStagePosition(); if (SongPlayer.fakePlayer != null) { - SongPlayer.fakePlayer.remove(); + SongPlayer.fakePlayer.remove(Entity.RemovalReason.DISCARDED); SongPlayer.fakePlayer = null; } diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/Stage.java b/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/Stage.java index ee691e6..9136a08 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/Stage.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/noteblocks/Stage.java @@ -21,7 +21,7 @@ public class Stage { } public void movePlayerToStagePosition() { - player.refreshPositionAndAngles(position.getX() + 0.5, position.getY() + 0.0, position.getZ() + 0.5, player.yaw, player.pitch); + player.refreshPositionAndAngles(position.getX() + 0.5, position.getY() + 0.0, position.getZ() + 0.5, player.getYaw(), player.getPitch()); player.setVelocity(Vec3d.ZERO); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e042917..f838415 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,7 +29,7 @@ "depends": { "fabricloader": ">=0.7.4", "fabric": "*", - "minecraft": "1.16.x" + "minecraft": "1.17.x" }, "suggests": { "flamingo": "*"