1.21.9
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Util
|
||||
public static SoundEvent getDiscSound(PlayerEntity player, ItemStack disc)
|
||||
{
|
||||
JukeboxPlayableComponent component = disc.get(DataComponentTypes.JUKEBOX_PLAYABLE);
|
||||
Optional<Registry<JukeboxSong>> key = player.getWorld().getRegistryManager().getOptional(RegistryKeys.JUKEBOX_SONG);
|
||||
Optional<Registry<JukeboxSong>> 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;
|
||||
|
||||
Reference in New Issue
Block a user