From d45b338b52f0a776643c16ed6ac656b63ae98997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A4seToatz?= Date: Wed, 1 Oct 2025 20:58:38 +0200 Subject: [PATCH] 1.21.9 --- gradle.properties | 8 ++++---- .../jukeboxboat/mixin/AbstractBoatEntityMixin.java | 6 ++---- .../java/com/kasetoatz/jukeboxboat/util/Util.java | 14 +++++++------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5c6ed4a..e559602 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,13 +2,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.21.8 -yarn_mappings=1.21.8+build.1 +minecraft_version=1.21.9 +yarn_mappings=1.21.9+build.1 loader_version=0.17.2 # Mod Properties -mod_version=1.1 +mod_version=1.2 maven_group=com.kasetoatz archives_base_name=JukeboxBoat # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.132.0+1.21.8 +fabric_version=0.133.14+1.21.9 diff --git a/src/main/java/com/kasetoatz/jukeboxboat/mixin/AbstractBoatEntityMixin.java b/src/main/java/com/kasetoatz/jukeboxboat/mixin/AbstractBoatEntityMixin.java index 0af342e..0ff9e1f 100644 --- a/src/main/java/com/kasetoatz/jukeboxboat/mixin/AbstractBoatEntityMixin.java +++ b/src/main/java/com/kasetoatz/jukeboxboat/mixin/AbstractBoatEntityMixin.java @@ -18,8 +18,6 @@ import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; -import net.minecraft.util.math.random.Random; -import net.minecraft.world.WorldEvents; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @@ -159,7 +157,7 @@ public abstract class AbstractBoatEntityMixin implements IAbstractBoatEntity { jukebox = createJukebox(boat); } - boat.getServer().getPlayerManager().sendToAll(new PlaySoundFromEntityS2CPacket( + boat.getEntityWorld().getServer().getPlayerManager().sendToAll(new PlaySoundFromEntityS2CPacket( Registries.SOUND_EVENT.getEntry(sound), SoundCategory.RECORDS, jukebox, @@ -187,7 +185,7 @@ public abstract class AbstractBoatEntityMixin implements IAbstractBoatEntity { return; } - if (boat.getWorld() instanceof ServerWorld world) + if (boat.getEntityWorld() instanceof ServerWorld world) { jukebox.teleport(world, boat.getX(), boat.getY(), boat.getZ(), EnumSet.noneOf(PositionFlag.class), boat.getYaw() + 90, boat.getPitch(), false); } diff --git a/src/main/java/com/kasetoatz/jukeboxboat/util/Util.java b/src/main/java/com/kasetoatz/jukeboxboat/util/Util.java index 344c08f..e6e0164 100644 --- a/src/main/java/com/kasetoatz/jukeboxboat/util/Util.java +++ b/src/main/java/com/kasetoatz/jukeboxboat/util/Util.java @@ -32,7 +32,7 @@ public class Util public static SoundEvent getDiscSound(PlayerEntity player, ItemStack disc) { JukeboxPlayableComponent component = disc.get(DataComponentTypes.JUKEBOX_PLAYABLE); - Optional> key = player.getWorld().getRegistryManager().getOptional(RegistryKeys.JUKEBOX_SONG); + Optional> key = player.getEntityWorld().getRegistryManager().getOptional(RegistryKeys.JUKEBOX_SONG); if (component == null || key.isEmpty()) { return null; @@ -58,7 +58,7 @@ public class Util public static DisplayEntity.BlockDisplayEntity createJukebox(BoatEntity boat) { - DisplayEntity.BlockDisplayEntity jukebox = new DisplayEntity.BlockDisplayEntity(EntityType.BLOCK_DISPLAY, boat.getWorld()); + DisplayEntity.BlockDisplayEntity jukebox = new DisplayEntity.BlockDisplayEntity(EntityType.BLOCK_DISPLAY, boat.getEntityWorld()); jukebox.setBlockState(Blocks.JUKEBOX.getDefaultState()); jukebox.setTransformation(new AffineTransformation( new Vector3f(-0.8f, 0.2f, -0.4f), @@ -66,7 +66,7 @@ public class Util new Vector3f(0.8f, 0.8f, 0.8f), new Quaternionf() )); - boat.getWorld().spawnEntity(jukebox); + boat.getEntityWorld().spawnEntity(jukebox); ((IBlockDisplayEntity)jukebox).jukeboxBoat$setUUID(jukebox.getUuidAsString()); ((IAbstractBoatEntity)boat).jukeboxBoat$setJukebox(jukebox.getUuidAsString()); return jukebox; @@ -74,14 +74,14 @@ public class Util public static void spawnPlaceholder(BoatEntity boat) { - ArmorStandEntity placeholder = new ArmorStandEntity(boat.getWorld(), boat.getX(), boat.getY(), boat.getZ()); + ArmorStandEntity placeholder = new ArmorStandEntity(boat.getEntityWorld(), boat.getX(), boat.getY(), boat.getZ()); IArmorStandEntity accessor = (IArmorStandEntity)placeholder; accessor.jukeboxBoat$setPlaceholder(true); accessor.jukeboxBoat$setMarker(true); placeholder.setHideBasePlate(true); placeholder.setInvisible(true); placeholder.setInvulnerable(true); - boat.getWorld().spawnEntity(placeholder); + boat.getEntityWorld().spawnEntity(placeholder); placeholder.startRiding(boat); } @@ -108,7 +108,7 @@ public class Util private static DisplayEntity.BlockDisplayEntity iterateJukeboxes(BoatEntity boat, String uuid) { - if (boat.getWorld() instanceof ServerWorld world) + if (boat.getEntityWorld() instanceof ServerWorld world) { for (Entity entity : world.iterateEntities()) { @@ -133,7 +133,7 @@ public class Util { return null; } - Entity possible = boat.getWorld().getEntity(UUID.fromString(uuid)); + Entity possible = boat.getEntityWorld().getEntity(UUID.fromString(uuid)); if (possible instanceof DisplayEntity.BlockDisplayEntity jukebox) { return jukebox;