diff --git a/src/main/java/com/floralquafloral/bumping/BlockBumpCallback.java b/src/main/java/com/floralquafloral/bumping/BlockBumpCallback.java index 5a806dc..3b50d84 100644 --- a/src/main/java/com/floralquafloral/bumping/BlockBumpCallback.java +++ b/src/main/java/com/floralquafloral/bumping/BlockBumpCallback.java @@ -1,12 +1,11 @@ package com.floralquafloral.bumping; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.moveable.MarioTravelData; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.EventFactory; import net.minecraft.block.BlockState; -import net.minecraft.util.ActionResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; @@ -43,7 +42,7 @@ public interface BlockBumpCallback { ); BlockBumpResult bump( - MarioData marioData, @Nullable MarioClientSideData marioClientData, @Nullable MarioTravelData marioTravelData, + MarioData marioData, @Nullable MarioClientSideDataImplementation marioClientData, @Nullable MarioTravelData marioTravelData, World world, BlockPos blockPos, BlockState blockState, int strength, int modifier, Direction direction ); diff --git a/src/main/java/com/floralquafloral/bumping/BlockBumpHandler.java b/src/main/java/com/floralquafloral/bumping/BlockBumpHandler.java index a71303d..4142e18 100644 --- a/src/main/java/com/floralquafloral/bumping/BlockBumpHandler.java +++ b/src/main/java/com/floralquafloral/bumping/BlockBumpHandler.java @@ -1,6 +1,6 @@ package com.floralquafloral.bumping; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.moveable.MarioTravelData; import net.minecraft.block.Block; @@ -10,11 +10,9 @@ import net.minecraft.util.Identifier; import net.minecraft.util.crash.CrashException; import net.minecraft.util.crash.CrashReport; -import net.minecraft.util.crash.CrashReportSection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; -import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.Nullable; import java.util.HashSet; @@ -39,7 +37,7 @@ public class BlockBumpHandler { public static final Set FORCED_SIGNALS_DATA = new HashSet<>(); public static BlockBumpResult processBumpResult( - MarioData marioData, @Nullable MarioClientSideData marioClientData, @Nullable MarioTravelData marioTravelData, + MarioData marioData, @Nullable MarioClientSideDataImplementation marioClientData, @Nullable MarioTravelData marioTravelData, World world, BlockPos blockPos, BlockState blockState, int strength, int modifier, Direction direction ) { @@ -70,7 +68,7 @@ else if(result == BlockBumpResult.DISPLACE) { private static class InvalidBumpResultException extends RuntimeException {} private static BlockBumpResult getBumpResult( - MarioData marioData, @Nullable MarioClientSideData marioClientData, @Nullable MarioTravelData marioTravelData, + MarioData marioData, @Nullable MarioClientSideDataImplementation marioClientData, @Nullable MarioTravelData marioTravelData, World world, BlockPos blockPos, BlockState blockState, int strength, int modifier, Direction direction ) { diff --git a/src/main/java/com/floralquafloral/bumping/BumpManager.java b/src/main/java/com/floralquafloral/bumping/BumpManager.java index 2c3294d..6224281 100644 --- a/src/main/java/com/floralquafloral/bumping/BumpManager.java +++ b/src/main/java/com/floralquafloral/bumping/BumpManager.java @@ -2,11 +2,10 @@ import com.floralquafloral.MarioPackets; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioDataManager; import com.floralquafloral.mariodata.moveable.MarioMainClientData; import com.floralquafloral.mariodata.moveable.MarioServerData; -import com.floralquafloral.registries.RegistryManager; import com.floralquafloral.util.MarioSFX; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents; @@ -157,7 +156,7 @@ public static void attemptBumpBlocks( } public static Set bumpBlocksClient( - MarioClientSideData marioClientData, @Nullable MarioMainClientData marioMainClientData, + MarioClientSideDataImplementation marioClientData, @Nullable MarioMainClientData marioMainClientData, ClientWorld world, Iterable positions, int strength, Direction direction ) { @@ -276,7 +275,7 @@ private record BumpS2CPayload(int player, Set positions, Direction dir ); public static void registerReceiver() { ClientPlayNetworking.registerGlobalReceiver(ID, (payload, context) -> { - MarioClientSideData data = (MarioClientSideData) MarioDataManager.getMarioData(context.player()); + MarioClientSideDataImplementation data = (MarioClientSideDataImplementation) MarioDataManager.getMarioData(context.player()); bumpBlocksClient( data, null, context.player().clientWorld, payload.positions, diff --git a/src/main/java/com/floralquafloral/mariodata/MarioAuthoritativeData.java b/src/main/java/com/floralquafloral/mariodata/MarioAuthoritativeData.java new file mode 100644 index 0000000..3448cb4 --- /dev/null +++ b/src/main/java/com/floralquafloral/mariodata/MarioAuthoritativeData.java @@ -0,0 +1,53 @@ +package com.floralquafloral.mariodata; + +import com.floralquafloral.mariodata.moveable.MarioTravelData; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.Identifier; + +/** + * Represents server-sided MarioData. The functions defined in this interface are networked to the player who this data + * belongs to, and anyone who's tracking them. + */ +public interface MarioAuthoritativeData extends MarioTravelData { + @Override + ServerPlayerEntity getMario(); + + /** + * @param isEnabled Whether the player should have access to Mario abilities. + */ + void setEnabled(boolean isEnabled); + + /** + * @param id The namespaced ID of the Character to switch to. + */ + void setCharacter(Identifier id); + void setCharacter(String id); + + /** + * Changes Mario's currently-equipped power-up. This won't trigger transition-related sound effects or animations. + * @param id The namespaced ID of the Power-up to switch to. + */ + void setPowerUp(Identifier id); + void setPowerUp(String id); + + /** + * Changes Mario's action. This will trigger whatever Action Transition the current action has which leads + * into the target action. + *

+ * If no transition is found, the behavior of this method call depends on the rejectInvalidActionTransitions + * gamerule. If the gamerule is true, then the change is rejected and Mario remains in his current action. If + * it's false, then the change is allowed and Mario will be switched to the new action without any transitions + * occurring. See also: {@linkplain #setActionTransitionless} + * @param id The namespaced ID of the Action to transition to. + * @return True if Mario's action was changed, false otherwise. + */ + boolean setAction(Identifier id); + boolean setAction(String id); + + /** + * Changes Mario's action. Action Transitions will not be checked for or executed. + * @param id The namespaced ID of the Action to switch to. + */ + void setActionTransitionless(Identifier id); + void setActionTransitionless(String id); +} diff --git a/src/main/java/com/floralquafloral/mariodata/MarioClientSideData.java b/src/main/java/com/floralquafloral/mariodata/MarioClientSideData.java index 487dc4b..125cd1a 100644 --- a/src/main/java/com/floralquafloral/mariodata/MarioClientSideData.java +++ b/src/main/java/com/floralquafloral/mariodata/MarioClientSideData.java @@ -3,92 +3,36 @@ import com.floralquafloral.MarioQuaMario; import com.floralquafloral.registries.RegistryManager; import com.floralquafloral.registries.states.character.ParsedCharacter; -import com.floralquafloral.util.JumpSoundPlayer; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.sound.PositionedSoundInstance; -import net.minecraft.client.sound.SoundManager; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; -import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; -import net.minecraft.util.math.random.Random; import java.util.HashMap; import java.util.Locale; import java.util.Map; /** - * This is supposedly an interface but every method is implemented because that's the closest i can get to multiple - * inheritance. endless pains and agonies for ever & ever! + * An instance of MarioData on the client-side. Mostly used for playing sound effects, especially voice sounds. + * This isn't necessarily for the main client! */ -@SuppressWarnings("UnusedReturnValue") public interface MarioClientSideData extends MarioData { - SoundManager SOUND_MANAGER = MinecraftClient.getInstance().getSoundManager(); - - default PositionedSoundInstance playSoundEvent( + PositionedSoundInstance playSoundEvent( SoundEvent event, SoundCategory category, double x, double y, double z, float pitch, float volume, long seed - ) { - PositionedSoundInstance sound = new PositionedSoundInstance( - event, category, - volume, pitch, - Random.create(seed), - x, y, z - ); - SOUND_MANAGER.play(sound); - return sound; - } - - default PositionedSoundInstance playSoundEvent(SoundEvent event, long seed) { - PlayerEntity mario = this.getMario(); - return playSoundEvent( - event, SoundCategory.PLAYERS, - mario.getX(), mario.getY(), mario.getZ(), - 1.0F, 1.0F, seed - ); - } - - default PositionedSoundInstance playSoundEvent(SoundEvent event, float pitch, float volume, long seed) { - PlayerEntity mario = this.getMario(); - return playSoundEvent( - event, SoundCategory.PLAYERS, - mario.getX(), mario.getY(), mario.getZ(), - pitch, volume, seed - ); - } - - default PositionedSoundInstance playSoundEvent(SoundEvent event, Entity entity, SoundCategory category, long seed) { - return playSoundEvent( - event, category, - entity.getX(), entity.getY(), entity.getZ(), - 1.0F, 1.0F, seed - ); - } - - default PositionedSoundInstance voice(VoiceLine line, long seed) { - PlayerEntity mario = this.getMario(); + ); - SOUND_MANAGER.stop(VoiceLine.MARIO_VOICE_LINES.get(this)); + PositionedSoundInstance playSoundEvent(SoundEvent event, long seed); + PositionedSoundInstance playSoundEvent(SoundEvent event, float pitch, float volume, long seed); + PositionedSoundInstance playSoundEvent(SoundEvent event, Entity entity, SoundCategory category, long seed); - PositionedSoundInstance newSoundInstance = this.playSoundEvent( - line.SOUND_EVENTS.get(this.getCharacter()), SoundCategory.VOICE, - mario.getX(), mario.getY(), mario.getZ(), - this.getPowerUp().VOICE_PITCH, 1.0F, - seed - ); - VoiceLine.MARIO_VOICE_LINES.put(this, newSoundInstance); + void playJumpSound(long seed); - return newSoundInstance; - } - - default void playJumpSound(long seed) { - JumpSoundPlayer.playJumpSfx(this, seed); - } + PositionedSoundInstance voice(VoiceLine line, long seed); enum VoiceLine { SELECT, @@ -110,11 +54,9 @@ enum VoiceLine { FIREBALL, GET_STAR; - private static final Map MARIO_VOICE_LINES = new HashMap<>(); public static void staticInitialize() { } - private final Map SOUND_EVENTS; VoiceLine() { SOUND_EVENTS = new HashMap<>(); @@ -127,5 +69,8 @@ public static void staticInitialize() { SOUND_EVENTS.put(character, event); } } + public SoundEvent getSoundEvent(ParsedCharacter character) { + return SOUND_EVENTS.get(character); + } } } diff --git a/src/main/java/com/floralquafloral/mariodata/MarioClientSideDataImplementation.java b/src/main/java/com/floralquafloral/mariodata/MarioClientSideDataImplementation.java new file mode 100644 index 0000000..bbee34c --- /dev/null +++ b/src/main/java/com/floralquafloral/mariodata/MarioClientSideDataImplementation.java @@ -0,0 +1,93 @@ +package com.floralquafloral.mariodata; + +import com.floralquafloral.util.JumpSoundPlayer; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.sound.PositionedSoundInstance; +import net.minecraft.client.sound.SoundManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.math.random.Random; + +import java.util.HashMap; +import java.util.Map; + +/** + * This is supposedly an interface but every method is implemented because that's the closest i can get to multiple + * inheritance. endless pains and agonies for ever & ever! + */ +@SuppressWarnings("UnusedReturnValue") +public interface MarioClientSideDataImplementation extends MarioClientSideData { + SoundManager SOUND_MANAGER = MinecraftClient.getInstance().getSoundManager(); + + @Override + default PositionedSoundInstance playSoundEvent( + SoundEvent event, SoundCategory category, + double x, double y, double z, + float pitch, float volume, long seed + ) { + PositionedSoundInstance sound = new PositionedSoundInstance( + event, category, + volume, pitch, + Random.create(seed), + x, y, z + ); + SOUND_MANAGER.play(sound); + return sound; + } + + @Override + default PositionedSoundInstance playSoundEvent(SoundEvent event, long seed) { + PlayerEntity mario = this.getMario(); + return playSoundEvent( + event, SoundCategory.PLAYERS, + mario.getX(), mario.getY(), mario.getZ(), + 1.0F, 1.0F, seed + ); + } + + @Override + default PositionedSoundInstance playSoundEvent(SoundEvent event, float pitch, float volume, long seed) { + PlayerEntity mario = this.getMario(); + return playSoundEvent( + event, SoundCategory.PLAYERS, + mario.getX(), mario.getY(), mario.getZ(), + pitch, volume, seed + ); + } + + @Override + default PositionedSoundInstance playSoundEvent(SoundEvent event, Entity entity, SoundCategory category, long seed) { + return playSoundEvent( + event, category, + entity.getX(), entity.getY(), entity.getZ(), + 1.0F, 1.0F, seed + ); + } + + Map MARIO_VOICE_LINES = new HashMap<>(); + + @Override + default PositionedSoundInstance voice(MarioClientSideData.VoiceLine line, long seed) { + PlayerEntity mario = this.getMario(); + + SOUND_MANAGER.stop(MARIO_VOICE_LINES.get(this)); + + PositionedSoundInstance newSoundInstance = this.playSoundEvent( + line.getSoundEvent(this.getCharacter()), SoundCategory.VOICE, + mario.getX(), mario.getY(), mario.getZ(), + this.getPowerUp().VOICE_PITCH, 1.0F, + seed + ); + MARIO_VOICE_LINES.put(this, newSoundInstance); + + return newSoundInstance; + } + + @Override + default void playJumpSound(long seed) { + JumpSoundPlayer.playJumpSfx(this, seed); + } + +} diff --git a/src/main/java/com/floralquafloral/mariodata/MarioDataPackets.java b/src/main/java/com/floralquafloral/mariodata/MarioDataPackets.java index 6f9bf8c..265042c 100644 --- a/src/main/java/com/floralquafloral/mariodata/MarioDataPackets.java +++ b/src/main/java/com/floralquafloral/mariodata/MarioDataPackets.java @@ -67,21 +67,25 @@ public static void sendAllData(ServerPlayerEntity toWho, PlayerEntity aboutWho) } public static String setMarioEnabled(ServerPlayerEntity player, boolean enabled) { - getMarioData(player).setEnabled(enabled); + getMarioData(player).setEnabledInternal(enabled); MarioPackets.sendPacketToTrackers(player, new MarioDataPackets.SetEnabledS2CPayload(player, enabled)); return((enabled ? "Enabled" : "Disabled") + " Mario mode for " + player.getName().getString()); } - public static void setMarioAction(ServerPlayerEntity mario, ParsedAction action, long seed) { + public static boolean setMarioAction(ServerPlayerEntity mario, ParsedAction action, long seed, boolean networkToMario) { MarioPlayerData data = getMarioData(mario); boolean foundTransition = data.getAction().transitionTo(data, action, seed); if(foundTransition || !mario.getWorld().getGameRules().getBoolean(MarioQuaMario.REJECT_INVALID_ACTION_TRANSITIONS)) { data.setActionTransitionless(action); - MarioPackets.sendPacketToTrackersExclusive(mario, new SetActionS2CPayload(mario, action, false, seed)); + SetActionS2CPayload payload = new SetActionS2CPayload(mario, action, false, seed); + MarioPackets.sendPacketToTrackersExclusive(mario, payload); + if(networkToMario) ServerPlayNetworking.send(mario, payload); } else // Reject transition and forcefully set Mario back to the action we last had him on forceSetMarioAction(mario, data.getAction()); + + return foundTransition; } public static void broadcastSetMarioAction(@NotNull ParsedAction action, long seed) { ClientPlayNetworking.send(new SetActionC2SPayload(action, seed)); @@ -119,7 +123,7 @@ public SetEnabledS2CPayload(PlayerEntity player, boolean isMario) { } public static void registerReceiver() { ClientPlayNetworking.registerGlobalReceiver(ID, (payload, context) -> - getMarioData(context, payload.player).setEnabled(payload.isMario)); + getMarioData(context, payload.player).setEnabledInternal(payload.isMario)); } @Override public Id getId() { @@ -220,7 +224,7 @@ public SetActionC2SPayload(@NotNull ParsedAction newAction, long seed) { } public static void registerReceiver() { ServerPlayNetworking.registerGlobalReceiver(ID, (payload, context) -> - setMarioAction(context.player(), RegistryManager.ACTIONS.get(payload.newAction), payload.seed)); + setMarioAction(context.player(), RegistryManager.ACTIONS.get(payload.newAction), payload.seed, false)); } @Override public Id getId() { diff --git a/src/main/java/com/floralquafloral/mariodata/MarioOtherClientData.java b/src/main/java/com/floralquafloral/mariodata/MarioOtherClientData.java index 56d61e5..909625b 100644 --- a/src/main/java/com/floralquafloral/mariodata/MarioOtherClientData.java +++ b/src/main/java/com/floralquafloral/mariodata/MarioOtherClientData.java @@ -2,7 +2,7 @@ import net.minecraft.entity.player.PlayerEntity; -public class MarioOtherClientData extends MarioPlayerData implements MarioClientSideData { +public class MarioOtherClientData extends MarioPlayerData implements MarioClientSideDataImplementation { public MarioOtherClientData(PlayerEntity mario) { super(mario); } diff --git a/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java b/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java index 318d75c..8d39ebb 100644 --- a/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java +++ b/src/main/java/com/floralquafloral/mariodata/MarioPlayerData.java @@ -6,7 +6,6 @@ import com.floralquafloral.registries.states.character.ParsedCharacter; import com.floralquafloral.registries.states.powerup.ParsedPowerUp; import com.floralquafloral.stats.CharaStat; -import com.floralquafloral.util.CPMIntegration; import com.floralquafloral.util.MarioSFX; import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; @@ -18,7 +17,6 @@ import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; -import net.minecraft.util.math.Vec3d; public abstract class MarioPlayerData implements MarioData { private static final Identifier FALL_RESISTANCE_ID = Identifier.of(MarioQuaMario.MOD_ID, "mario_fall_resistance"); @@ -48,7 +46,7 @@ public abstract class MarioPlayerData implements MarioData { public MarioPlayerData(PlayerEntity mario) { this.mario = mario; this.IS_CLIENT = mario.getWorld().isClient; - this.enabled = true; + this.enabled = false; this.action = RegistryManager.ACTIONS.get(Identifier.of("qua_mario:basic")); this.powerUp = RegistryManager.POWER_UPS.get(Identifier.of("qua_mario:super")); this.character = RegistryManager.CHARACTERS.get(Identifier.of("qua_mario:mario")); @@ -82,7 +80,7 @@ public MarioPlayerData(PlayerEntity mario) { @Override public boolean isEnabled() { return enabled; } - public void setEnabled(boolean enabled) { + public void setEnabledInternal(boolean enabled) { this.enabled = enabled; EntityAttributeInstance safeFallAttributeInstance = this.mario.getAttributeInstance(EntityAttributes.GENERIC_SAFE_FALL_DISTANCE); EntityAttributeInstance attackSpeedAttributeInstance = this.mario.getAttributeInstance(EntityAttributes.GENERIC_ATTACK_SPEED); diff --git a/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java b/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java index 1df3fe0..bd6c366 100644 --- a/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java +++ b/src/main/java/com/floralquafloral/mariodata/moveable/MarioMainClientData.java @@ -2,7 +2,7 @@ import com.floralquafloral.MarioQuaMario; import com.floralquafloral.bumping.BumpManager; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.registries.states.action.ActionDefinition; import com.floralquafloral.registries.states.action.ParsedAction; import com.floralquafloral.registries.states.action.TransitionPhase; @@ -15,7 +15,7 @@ import net.minecraft.world.BlockCollisionSpliterator; import org.jetbrains.annotations.NotNull; -public class MarioMainClientData extends MarioMoveableData implements MarioClientSideData { +public class MarioMainClientData extends MarioMoveableData implements MarioClientSideDataImplementation { private static MarioMainClientData instance; public static MarioMainClientData getInstance() { return instance; @@ -39,8 +39,10 @@ public MarioMainClientData(ClientPlayerEntity mario) { MarioMainClientData.instance = this; } - @Override public void setAction(ParsedAction action, long seed) { - this.setActionTransitionless(action); + @Override + public void setAction(ParsedAction action, long seed) { + MarioQuaMario.LOGGER.warn("Triggered setAction with transitions for the main client. This is abnormal!"); + super.setAction(action, seed); } public ActionDefinition.CameraAnimation cameraAnimation; diff --git a/src/main/java/com/floralquafloral/mariodata/moveable/MarioServerData.java b/src/main/java/com/floralquafloral/mariodata/moveable/MarioServerData.java index 52ff955..ecaffae 100644 --- a/src/main/java/com/floralquafloral/mariodata/moveable/MarioServerData.java +++ b/src/main/java/com/floralquafloral/mariodata/moveable/MarioServerData.java @@ -1,24 +1,26 @@ package com.floralquafloral.mariodata.moveable; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioData; -import com.floralquafloral.mariodata.MarioPlayerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioDataPackets; +import com.floralquafloral.registries.RegistryManager; import com.floralquafloral.registries.states.action.ParsedAction; +import com.floralquafloral.registries.states.character.ParsedCharacter; import com.floralquafloral.util.CPMIntegration; import net.minecraft.entity.MovementType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.random.Random; import org.jetbrains.annotations.NotNull; -public class MarioServerData extends MarioMoveableData { +import java.util.Objects; + +public class MarioServerData extends MarioMoveableData implements MarioAuthoritativeData { private ServerPlayerEntity marioServer; public MarioServerData(ServerPlayerEntity mario) { super(mario); this.marioServer = mario; -// this.setActionTransitionless(this.getAction()); -// this.setEnabled(this.isEnabled()); -// this.setPowerUp(this.getPowerUp()); -// this.setCharacter(this.getCharacter()); } @Override public ServerPlayerEntity getMario() { @@ -32,14 +34,12 @@ public MarioServerData(ServerPlayerEntity mario) { @Override public boolean travelHook(double forwardInput, double strafeInput) { getAction().travelHook(this); applyModifiedVelocity(); -// marioServer.move(MovementType.SELF, marioServer.getVelocity()); // ??????? + marioServer.move(MovementType.SELF, marioServer.getVelocity()); // ??????? return !marioServer.hasVehicle(); } @Override public void setActionTransitionless(ParsedAction action) { -// MarioQuaMario.LOGGER.info("MarioServerData setAction to {}", action.ID); - if(this.getAction().ANIMATION != null) CPMIntegration.commonAPI.playAnimation(PlayerEntity.class, this.marioServer, this.getAction().ANIMATION, 0); if(action.ANIMATION != null) @@ -59,6 +59,51 @@ public void setActionTransitionless(ParsedAction action) { return PHONY_INPUTS; } + @Override + public void setEnabled(boolean isEnabled) { + MarioDataPackets.setMarioEnabled(marioServer, isEnabled); + } + + @Override + public void setCharacter(Identifier id) { + MarioDataPackets.setMarioCharacter(marioServer, Objects.requireNonNull(RegistryManager.CHARACTERS.get(id))); + } + + @Override + public void setCharacter(String id) { + this.setCharacter(Identifier.of(id)); + } + + @Override + public void setPowerUp(Identifier id) { + MarioDataPackets.setMarioPowerUp(marioServer, Objects.requireNonNull(RegistryManager.POWER_UPS.get(id))); + } + + @Override + public void setPowerUp(String id) { + this.setPowerUp(Identifier.of(id)); + } + + @Override + public boolean setAction(Identifier id) { + return MarioDataPackets.setMarioAction(marioServer, Objects.requireNonNull(RegistryManager.ACTIONS.get(id)), Random.create().nextLong(), true); + } + + @Override + public boolean setAction(String id) { + return this.setAction(Identifier.of(id)); + } + + @Override + public void setActionTransitionless(Identifier id) { + MarioDataPackets.forceSetMarioAction(marioServer, Objects.requireNonNull(RegistryManager.ACTIONS.get(id))); + } + + @Override + public void setActionTransitionless(String id) { + this.setActionTransitionless(Identifier.of(id)); + } + private static class PhonyInputs extends MarioInputs { private static class PhonyButton implements ButtonInput { @Override public boolean isHeld() { diff --git a/src/main/java/com/floralquafloral/mixin/EntityMixin.java b/src/main/java/com/floralquafloral/mixin/EntityMixin.java index c9862ee..840b6f3 100644 --- a/src/main/java/com/floralquafloral/mixin/EntityMixin.java +++ b/src/main/java/com/floralquafloral/mixin/EntityMixin.java @@ -1,25 +1,25 @@ package com.floralquafloral.mixin; -import com.floralquafloral.bumping.BumpManager; +import com.floralquafloral.MarioQuaMario; import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.MarioDataManager; import com.floralquafloral.mariodata.MarioPlayerData; -import com.floralquafloral.mariodata.moveable.MarioMainClientData; import com.floralquafloral.mariodata.moveable.MarioServerData; import com.floralquafloral.registries.RegistryManager; import com.floralquafloral.registries.states.action.ParsedAction; +import com.floralquafloral.registries.states.character.ParsedCharacter; +import com.floralquafloral.registries.states.powerup.ParsedPowerUp; import net.minecraft.block.BlockState; -import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityPose; import net.minecraft.entity.MovementType; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import net.minecraft.world.BlockCollisionSpliterator; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; @@ -112,4 +112,53 @@ private void setMountedAction(Entity entity, boolean force, CallbackInfoReturnab data.setActionTransitionless(RegistryManager.ACTIONS.get(Identifier.of("qua_mario:mounted"))); } } + + @Unique private final String MOD_DATA_NAME = MarioQuaMario.MOD_ID + ".data"; + + @Inject(method = "writeNbt", at = @At("HEAD")) + protected void writeMarioData(NbtCompound nbt, CallbackInfoReturnable cir) { + if((Entity) (Object) this instanceof PlayerEntity player) { + NbtCompound persistentMarioData = new NbtCompound(); + MarioPlayerData data = MarioDataManager.getMarioData(player); + + persistentMarioData.putBoolean("Enabled", data.isEnabled()); + persistentMarioData.putString("Character", data.getCharacter().ID.toString()); + persistentMarioData.putString("PowerUp", data.getPowerUp().ID.toString()); + + + + nbt.put(MOD_DATA_NAME, persistentMarioData); + } + } + + @Inject(method = "readNbt", at = @At("HEAD")) + protected void readMarioData(NbtCompound nbt, CallbackInfo ci) { + if((Entity) (Object) this instanceof ServerPlayerEntity player) { + MarioQuaMario.LOGGER.info("Reading player NBT!!!" + + "\nContains?: " + nbt.contains(MOD_DATA_NAME, NbtElement.COMPOUND_TYPE) + ); + if(nbt.contains(MOD_DATA_NAME, NbtElement.COMPOUND_TYPE)) { + NbtCompound persistentMarioData = nbt.getCompound(MOD_DATA_NAME); + MarioQuaMario.LOGGER.info("Reading player NBT 2" + + "\nEnabled: " + persistentMarioData.getBoolean("Enabled") + + "\nCharacter: " + persistentMarioData.getString("Character") + + "\nCharacterID: " + Identifier.of(persistentMarioData.getString("Character")) + + "\nParsedCharacter: " + RegistryManager.CHARACTERS.get(Identifier.of(persistentMarioData.getString("Character"))) + ); + + MarioPlayerData data = MarioDataManager.getMarioData(player); + data.setEnabledInternal(persistentMarioData.getBoolean("enabled")); + ParsedCharacter character = RegistryManager.CHARACTERS.get(Identifier.of(persistentMarioData.getString("Character"))); + if(character != null) data.setCharacter(character); + else data.setCharacter(data.getCharacter()); + + ParsedPowerUp powerUp = RegistryManager.POWER_UPS.get(Identifier.of(persistentMarioData.getString("PowerUp"))); + if(powerUp != null) data.setPowerUp(powerUp); + else data.setPowerUp(data.getPowerUp()); + } + else { + + } + } + } } diff --git a/src/main/java/com/floralquafloral/registries/states/MarioStateDefinition.java b/src/main/java/com/floralquafloral/registries/states/MarioStateDefinition.java index d1fe25a..6b28abd 100644 --- a/src/main/java/com/floralquafloral/registries/states/MarioStateDefinition.java +++ b/src/main/java/com/floralquafloral/registries/states/MarioStateDefinition.java @@ -1,13 +1,13 @@ package com.floralquafloral.registries.states; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import net.minecraft.util.Identifier; import org.jetbrains.annotations.NotNull; public interface MarioStateDefinition { @NotNull Identifier getID(); - void clientTick(MarioClientSideData data, boolean isSelf); - void serverTick(MarioServerData data); + void clientTick(MarioClientSideDataImplementation data, boolean isSelf); + void serverTick(MarioAuthoritativeData data); } diff --git a/src/main/java/com/floralquafloral/registries/states/ParsedMarioState.java b/src/main/java/com/floralquafloral/registries/states/ParsedMarioState.java index 090ceef..d64a2d7 100644 --- a/src/main/java/com/floralquafloral/registries/states/ParsedMarioState.java +++ b/src/main/java/com/floralquafloral/registries/states/ParsedMarioState.java @@ -1,7 +1,6 @@ package com.floralquafloral.registries.states; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.MarioPlayerData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioServerData; import net.minecraft.util.Identifier; @@ -14,7 +13,7 @@ protected ParsedMarioState(MarioStateDefinition definition) { this.DEFINITION = definition; } - public void clientTick(MarioClientSideData data, boolean isSelf) { + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { this.DEFINITION.clientTick(data, isSelf); } public void serverTick(MarioServerData data) { diff --git a/src/main/java/com/floralquafloral/registries/states/action/ActionDefinition.java b/src/main/java/com/floralquafloral/registries/states/action/ActionDefinition.java index 52c12e4..05beb4c 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/ActionDefinition.java +++ b/src/main/java/com/floralquafloral/registries/states/action/ActionDefinition.java @@ -1,6 +1,6 @@ package com.floralquafloral.registries.states.action; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.MarioStateDefinition; import net.minecraft.util.Identifier; @@ -175,7 +175,7 @@ class ActionTransitionDefinition { void execute(MarioTravelData data); } @FunctionalInterface public interface TransitionExecutorClients { - void execute(MarioClientSideData data, boolean isSelf, long seed); + void execute(MarioClientSideDataImplementation data, boolean isSelf, long seed); } public final Identifier TARGET_IDENTIFIER; diff --git a/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java b/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java index 410f1ac..8f540b6 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java +++ b/src/main/java/com/floralquafloral/registries/states/action/ParsedAction.java @@ -1,7 +1,7 @@ package com.floralquafloral.registries.states.action; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.MarioDataPackets; import com.floralquafloral.mariodata.MarioPlayerData; @@ -64,7 +64,7 @@ public boolean attemptTransitions(MarioMainClientData data, TransitionPhase phas if(transition.EXECUTOR_TRAVELLERS != null) transition.EXECUTOR_TRAVELLERS.execute(data); if(transition.EXECUTOR_CLIENTS != null) transition.EXECUTOR_CLIENTS.execute(data, true, seed); MarioDataPackets.broadcastSetMarioAction(transition.TARGET_ACTION, seed); - data.setAction(transition.TARGET_ACTION, seed); + data.setActionTransitionless(transition.TARGET_ACTION); return true; } } @@ -169,7 +169,7 @@ private void execute(MarioData data, long seed) { if(this.EXECUTOR_TRAVELLERS != null && data instanceof MarioTravelData travelData) this.EXECUTOR_TRAVELLERS.execute(travelData); - if(this.EXECUTOR_CLIENTS != null && data instanceof MarioClientSideData clientData) + if(this.EXECUTOR_CLIENTS != null && data instanceof MarioClientSideDataImplementation clientData) this.EXECUTOR_CLIENTS.execute(clientData, data.getMario().isMainPlayer(), seed); } } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java index 8840704..95d29e4 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebug.java @@ -1,8 +1,9 @@ package com.floralquafloral.registries.states.action.baseactions; import com.floralquafloral.MarioQuaMario; +import com.floralquafloral.mariodata.MarioAuthoritativeData; import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.ActionDefinition; import net.minecraft.util.Identifier; @@ -33,10 +34,10 @@ public void travelHook(MarioTravelData data) { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) {} + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java index 858ce60..2a6467e 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/ActionDebugAlt.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.action.baseactions; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.ActionDefinition; import net.minecraft.sound.SoundEvents; @@ -36,10 +36,10 @@ public void travelHook(MarioTravelData data) { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) {} + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java index 93869f2..4abd4be 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPound.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.action.baseactions; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.ActionDefinition; import com.floralquafloral.registries.states.action.AirborneActionDefinition; @@ -52,11 +52,11 @@ public class GroundPound implements ActionDefinition { ); } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) { + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } - @Override public void serverTick(MarioServerData data) { + @Override public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java index 88903c4..43dbc38 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/GroundPoundWindup.java @@ -1,13 +1,10 @@ package com.floralquafloral.registries.states.action.baseactions; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.MarioPlayerData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.ActionDefinition; -import com.floralquafloral.registries.states.action.GroundedActionDefinition; -import com.floralquafloral.registries.states.action.baseactions.grounded.DuckWaddle; import net.minecraft.util.Identifier; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -45,10 +42,10 @@ public void travelHook(MarioTravelData data) { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) {} + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java index d6513ca..b419152 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.java @@ -1,9 +1,9 @@ package com.floralquafloral.registries.states.action.baseactions; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioPlayerData; -import com.floralquafloral.mariodata.moveable.MarioServerData; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.ActionDefinition; import com.floralquafloral.registries.states.action.GroundedActionDefinition; @@ -34,10 +34,12 @@ public void travelHook(MarioTravelData data) { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) {} + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { + + } @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java index 0b03fde..40be908 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/DoubleJump.java @@ -2,7 +2,6 @@ import com.floralquafloral.MarioQuaMario; import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.GroundedActionDefinition; import com.floralquafloral.stats.CharaStat; import com.floralquafloral.stats.StatCategory; @@ -12,8 +11,6 @@ import java.util.List; -import static com.floralquafloral.util.MixedEasing.*; - public class DoubleJump extends Jump { @Override public @NotNull Identifier getID() { return Identifier.of(MarioQuaMario.MOD_ID, "double_jump"); diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java index 89a83a1..2d4cf03 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Fall.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.action.baseactions.airborne; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.AirborneActionDefinition; import com.floralquafloral.stats.CharaStat; @@ -50,11 +50,11 @@ public class Fall extends AirborneActionDefinition { airborneAccel(data); } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) { + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } - @Override public void serverTick(MarioServerData data) { + @Override public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java index b3de90e..9c192a9 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/Jump.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.action.baseactions.airborne; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.AirborneActionDefinition; import com.floralquafloral.stats.CharaStat; @@ -54,11 +54,11 @@ public class Jump extends AirborneActionDefinition { airborneAccel(data); } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) { + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } - @Override public void serverTick(MarioServerData data) { + @Override public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java index 9218372..adc8d0a 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/LongJump.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.action.baseactions.airborne; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.AirborneActionDefinition; import com.floralquafloral.stats.CharaStat; @@ -57,11 +57,11 @@ public class LongJump extends AirborneActionDefinition { airborneAccel(data); } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) { + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } - @Override public void serverTick(MarioServerData data) { + @Override public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java index 023c785..578deb0 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/airborne/TripleJump.java @@ -12,8 +12,6 @@ import java.util.List; -import static com.floralquafloral.util.MixedEasing.*; - public class TripleJump extends Jump { @Override public @NotNull Identifier getID() { return Identifier.of(MarioQuaMario.MOD_ID, "triple_jump"); diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java index 4b00627..79a0643 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/ActionBasic.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.action.baseactions.grounded; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.GroundedActionDefinition; import com.floralquafloral.stats.CharaStat; @@ -150,9 +150,9 @@ else if(data.getForwardVel() < BACKPEDAL_SPEED.getAsLimit(data)) { } } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) {} + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} - @Override public void serverTick(MarioServerData data) {} + @Override public void serverTick(MarioAuthoritativeData data) {} @Override public SneakLegalityRule getSneakLegalityRule() { return SneakLegalityRule.ALLOW; diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java index c037842..a2a819c 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckSlide.java @@ -1,8 +1,9 @@ package com.floralquafloral.registries.states.action.baseactions.grounded; import com.floralquafloral.MarioQuaMario; +import com.floralquafloral.mariodata.MarioAuthoritativeData; import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.GroundedActionDefinition; import com.floralquafloral.registries.states.action.baseactions.airborne.LongJump; @@ -50,9 +51,9 @@ public void groundedTravel(MarioTravelData data) { ); } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) {} + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} - @Override public void serverTick(MarioServerData data) {} + @Override public void serverTick(MarioAuthoritativeData data) {} @Override public SneakLegalityRule getSneakLegalityRule() { return SneakLegalityRule.SLIP; diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java index 3b568fd..e6f42fe 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/DuckWaddle.java @@ -1,8 +1,9 @@ package com.floralquafloral.registries.states.action.baseactions.grounded; import com.floralquafloral.MarioQuaMario; +import com.floralquafloral.mariodata.MarioAuthoritativeData; import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.GroundedActionDefinition; import com.floralquafloral.registries.states.action.baseactions.airborne.Backflip; @@ -89,9 +90,9 @@ public void groundedTravel(MarioTravelData data) { ); } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) {} + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} - @Override public void serverTick(MarioServerData data) {} + @Override public void serverTick(MarioAuthoritativeData data) {} @Override public SneakLegalityRule getSneakLegalityRule() { return SneakLegalityRule.ALLOW; diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java index 1505a40..cb112f3 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/GroundPoundLanding.java @@ -1,21 +1,17 @@ package com.floralquafloral.registries.states.action.baseactions.grounded; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioMainClientData; -import com.floralquafloral.mariodata.moveable.MarioServerData; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.GroundedActionDefinition; -import com.floralquafloral.stats.CharaStat; import net.minecraft.util.Identifier; -import net.minecraft.util.math.MathHelper; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; -import static com.floralquafloral.stats.StatCategory.*; - public class GroundPoundLanding extends GroundedActionDefinition { @Override public @NotNull Identifier getID() { return Identifier.of(MarioQuaMario.MOD_ID, "ground_pound_landing"); @@ -35,9 +31,9 @@ public void groundedTravel(MarioTravelData data) { data.getTimers().actionTimer++; } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) {} + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} - @Override public void serverTick(MarioServerData data) {} + @Override public void serverTick(MarioAuthoritativeData data) {} @Override public SneakLegalityRule getSneakLegalityRule() { return SneakLegalityRule.PROHIBIT; diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java index f9428aa..7b77c7c 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.action.baseactions.grounded; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.GroundedActionDefinition; import com.floralquafloral.stats.CharaStat; @@ -45,9 +45,9 @@ public void groundedTravel(MarioTravelData data) { ); } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) {} + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} - @Override public void serverTick(MarioServerData data) {} + @Override public void serverTick(MarioAuthoritativeData data) {} @Override public SneakLegalityRule getSneakLegalityRule() { return SneakLegalityRule.ALLOW; diff --git a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java index 30f715a..18f35aa 100644 --- a/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java +++ b/src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/Skid.java @@ -1,8 +1,9 @@ package com.floralquafloral.registries.states.action.baseactions.grounded; import com.floralquafloral.MarioQuaMario; +import com.floralquafloral.mariodata.MarioAuthoritativeData; import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.states.action.GroundedActionDefinition; import com.floralquafloral.registries.states.action.baseactions.airborne.Sideflip; @@ -53,9 +54,9 @@ public void groundedTravel(MarioTravelData data) { if(MathHelper.approximatelyEquals(data.getForwardVel(), 0.0)) data.getTimers().actionTimer++; } - @Override public void clientTick(MarioClientSideData data, boolean isSelf) {} + @Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {} - @Override public void serverTick(MarioServerData data) {} + @Override public void serverTick(MarioAuthoritativeData data) {} @Override public SneakLegalityRule getSneakLegalityRule() { return SneakLegalityRule.ALLOW; diff --git a/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java b/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java index 2002eb8..eddedc2 100644 --- a/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java +++ b/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Luigi.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.character.basecharacters; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.registries.states.character.CharacterDefinition; import com.floralquafloral.stats.StatCategory; import net.minecraft.util.Identifier; @@ -47,12 +47,12 @@ public void populateStatModifiers(Map, Double> modifiers) { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) { + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } } diff --git a/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java b/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java index 1b9349f..fe25930 100644 --- a/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java +++ b/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Mario.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.character.basecharacters; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.registries.states.character.CharacterDefinition; import com.floralquafloral.stats.StatCategory; import net.minecraft.util.Identifier; @@ -33,12 +33,12 @@ public void populateStatModifiers(Map, Double> modifiers) { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) { + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } } diff --git a/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java b/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java index ab2f048..b61b8c8 100644 --- a/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java +++ b/src/main/java/com/floralquafloral/registries/states/character/basecharacters/Toadette.java @@ -1,8 +1,8 @@ package com.floralquafloral.registries.states.character.basecharacters; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.moveable.MarioServerData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.registries.states.character.CharacterDefinition; import com.floralquafloral.stats.StatCategory; import net.minecraft.util.Identifier; @@ -33,12 +33,12 @@ public void populateStatModifiers(Map, Double> modifiers) { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) { + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } } diff --git a/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java b/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java index 06dee7a..95a8e5a 100644 --- a/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java +++ b/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SmallForm.java @@ -1,9 +1,9 @@ package com.floralquafloral.registries.states.powerup.basepowerups; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; -import com.floralquafloral.mariodata.moveable.MarioServerData; import com.floralquafloral.registries.states.powerup.PowerUpDefinition; import com.floralquafloral.stats.StatCategory; import net.minecraft.sound.SoundEvent; @@ -20,12 +20,12 @@ public class SmallForm implements PowerUpDefinition { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) { + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java b/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java index d50a676..5f69e16 100644 --- a/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java +++ b/src/main/java/com/floralquafloral/registries/states/powerup/basepowerups/SuperForm.java @@ -1,9 +1,9 @@ package com.floralquafloral.registries.states.powerup.basepowerups; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioAuthoritativeData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; -import com.floralquafloral.mariodata.moveable.MarioServerData; import com.floralquafloral.registries.states.powerup.PowerUpDefinition; import com.floralquafloral.stats.StatCategory; import net.minecraft.sound.SoundEvent; @@ -20,12 +20,12 @@ public class SuperForm implements PowerUpDefinition { } @Override - public void clientTick(MarioClientSideData data, boolean isSelf) { + public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) { } @Override - public void serverTick(MarioServerData data) { + public void serverTick(MarioAuthoritativeData data) { } diff --git a/src/main/java/com/floralquafloral/registries/stomp/ParsedStomp.java b/src/main/java/com/floralquafloral/registries/stomp/ParsedStomp.java index 7b04ee2..8b261b3 100644 --- a/src/main/java/com/floralquafloral/registries/stomp/ParsedStomp.java +++ b/src/main/java/com/floralquafloral/registries/stomp/ParsedStomp.java @@ -1,12 +1,9 @@ package com.floralquafloral.registries.stomp; -import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; -import com.floralquafloral.mariodata.MarioDataPackets; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.moveable.MarioMoveableData; import com.floralquafloral.mariodata.moveable.MarioServerData; import com.floralquafloral.registries.RegistryManager; -import com.floralquafloral.registries.states.action.AirborneActionDefinition; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.AttributeModifierSlot; import net.minecraft.component.type.AttributeModifiersComponent; @@ -111,7 +108,7 @@ else if (entry.attribute().value().equals(EntityAttributes.GENERIC_ARMOR_TOUGHNE } return false; } - public void executeClient(MarioClientSideData data, boolean isSelf, Entity target, boolean harmless, long seed) { + public void executeClient(MarioClientSideDataImplementation data, boolean isSelf, Entity target, boolean harmless, long seed) { data.getMario().fallDistance = 0; if(this.SOUND_EVENT != null) { data.playSoundEvent( diff --git a/src/main/java/com/floralquafloral/registries/stomp/StompDefinition.java b/src/main/java/com/floralquafloral/registries/stomp/StompDefinition.java index 5b4adaa..277f11f 100644 --- a/src/main/java/com/floralquafloral/registries/stomp/StompDefinition.java +++ b/src/main/java/com/floralquafloral/registries/stomp/StompDefinition.java @@ -1,6 +1,6 @@ package com.floralquafloral.registries.stomp; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.moveable.MarioTravelData; import net.minecraft.entity.Entity; @@ -28,7 +28,7 @@ public interface StompDefinition { float calculateDamage(MarioData data, ServerPlayerEntity mario, ItemStack equipment, float equipmentArmorValue, Entity target); void executeTravellers(MarioTravelData data, Entity target, boolean harmless); - void executeClients(MarioClientSideData data, boolean isSelf, Entity target, boolean harmless, long seed); + void executeClients(MarioClientSideDataImplementation data, boolean isSelf, Entity target, boolean harmless, long seed); enum PainfulStompResponse { INJURY, diff --git a/src/main/java/com/floralquafloral/registries/stomp/StompHandler.java b/src/main/java/com/floralquafloral/registries/stomp/StompHandler.java index e2cc769..45a91d3 100644 --- a/src/main/java/com/floralquafloral/registries/stomp/StompHandler.java +++ b/src/main/java/com/floralquafloral/registries/stomp/StompHandler.java @@ -2,7 +2,7 @@ import com.floralquafloral.MarioPackets; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioPlayerData; import com.floralquafloral.registries.RegistryManager; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; @@ -69,7 +69,7 @@ public static void registerReceiver() { return; } MarioPlayerData data = getMarioData(mario); - stompType.executeClient((MarioClientSideData) data, mario.isMainPlayer(), target, payload.harmless, payload.seed); + stompType.executeClient((MarioClientSideDataImplementation) data, mario.isMainPlayer(), target, payload.harmless, payload.seed); // data.setActionTransitionless(RegistryManager.ACTIONS.get(stompType.POST_STOMP_ACTION)); }); } diff --git a/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/GroundPoundStomp.java b/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/GroundPoundStomp.java index 83de95c..8710db8 100644 --- a/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/GroundPoundStomp.java +++ b/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/GroundPoundStomp.java @@ -1,7 +1,7 @@ package com.floralquafloral.registries.stomp.basestomptypes; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.stomp.StompDefinition; @@ -10,12 +10,10 @@ import com.floralquafloral.stats.StatCategory; import com.floralquafloral.util.MarioSFX; import net.minecraft.entity.Entity; -import net.minecraft.entity.MovementType; import net.minecraft.item.ItemStack; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; -import net.minecraft.util.math.Vec3d; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -65,7 +63,7 @@ public class GroundPoundStomp implements StompDefinition { double deltaY = data.getMario().getY() - (target.getY() - target.getHeight()); } - @Override public void executeClients(MarioClientSideData data, boolean isSelf, Entity target, boolean harmless, long seed) { + @Override public void executeClients(MarioClientSideDataImplementation data, boolean isSelf, Entity target, boolean harmless, long seed) { } } diff --git a/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/JumpStomp.java b/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/JumpStomp.java index 0d252e0..500f2a2 100644 --- a/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/JumpStomp.java +++ b/src/main/java/com/floralquafloral/registries/stomp/basestomptypes/JumpStomp.java @@ -1,7 +1,7 @@ package com.floralquafloral.registries.stomp.basestomptypes; import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; import com.floralquafloral.mariodata.moveable.MarioTravelData; import com.floralquafloral.registries.stomp.StompDefinition; @@ -75,7 +75,7 @@ public class JumpStomp implements StompDefinition { data.setYVel(BOUNCE_VEL.get(data)); } - @Override public void executeClients(MarioClientSideData data, boolean isSelf, Entity target, boolean harmless, long seed) { + @Override public void executeClients(MarioClientSideDataImplementation data, boolean isSelf, Entity target, boolean harmless, long seed) { } } diff --git a/src/main/java/com/floralquafloral/util/JumpSoundPlayer.java b/src/main/java/com/floralquafloral/util/JumpSoundPlayer.java index 4a83813..ad6d54b 100644 --- a/src/main/java/com/floralquafloral/util/JumpSoundPlayer.java +++ b/src/main/java/com/floralquafloral/util/JumpSoundPlayer.java @@ -1,22 +1,12 @@ package com.floralquafloral.util; -import com.floralquafloral.MarioPackets; -import com.floralquafloral.MarioQuaMario; -import com.floralquafloral.mariodata.MarioClientSideData; +import com.floralquafloral.mariodata.MarioClientSideDataImplementation; import com.floralquafloral.mariodata.MarioData; -import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; -import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; -import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.client.sound.TickableSoundInstance; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.network.RegistryByteBuf; -import net.minecraft.network.codec.PacketCodec; -import net.minecraft.network.codec.PacketCodecs; -import net.minecraft.network.packet.CustomPayload; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvent; -import net.minecraft.util.Identifier; import net.minecraft.util.math.random.Random; import java.util.*; @@ -49,7 +39,7 @@ public void tick() { public static void playJumpSfx(SoundEvent event, MarioData data, long seed) { PlayerEntity mario = data.getMario(); - MarioClientSideData.SOUND_MANAGER.play(new JumpSoundInstance(event, mario, seed)); + MarioClientSideDataImplementation.SOUND_MANAGER.play(new JumpSoundInstance(event, mario, seed)); } public static void playJumpSfx(MarioData data, long seed) { playJumpSfx(MarioSFX.JUMP, data, seed);