Skip to content

Commit

Permalink
MarioClientSideData is now used instead of MarioClientSideDataImpleme…
Browse files Browse the repository at this point in the history
…ntation wherever possible.
  • Loading branch information
floral-qua-floral committed Nov 19, 2024
1 parent 96fdd8b commit 40ca890
Show file tree
Hide file tree
Showing 31 changed files with 60 additions and 67 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.floralquafloral.bumping;

import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.MarioData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import net.fabricmc.fabric.api.event.Event;
Expand Down Expand Up @@ -42,7 +42,7 @@ public interface BlockBumpCallback {
);

BlockBumpResult bump(
MarioData marioData, @Nullable MarioClientSideDataImplementation marioClientData, @Nullable MarioTravelData marioTravelData,
MarioData marioData, @Nullable MarioClientSideData marioClientData, @Nullable MarioTravelData marioTravelData,
World world, BlockPos blockPos, BlockState blockState,
int strength, int modifier, Direction direction
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.floralquafloral.bumping;

import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.MarioData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import net.minecraft.block.Block;
Expand Down Expand Up @@ -37,7 +37,7 @@ public class BlockBumpHandler {
public static final Set<ForcedSignalSpot> FORCED_SIGNALS_DATA = new HashSet<>();

public static BlockBumpResult processBumpResult(
MarioData marioData, @Nullable MarioClientSideDataImplementation marioClientData, @Nullable MarioTravelData marioTravelData,
MarioData marioData, @Nullable MarioClientSideData marioClientData, @Nullable MarioTravelData marioTravelData,
World world, BlockPos blockPos, BlockState blockState,
int strength, int modifier, Direction direction
) {
Expand Down Expand Up @@ -68,7 +68,7 @@ else if(result == BlockBumpResult.DISPLACE) {
private static class InvalidBumpResultException extends RuntimeException {}

private static BlockBumpResult getBumpResult(
MarioData marioData, @Nullable MarioClientSideDataImplementation marioClientData, @Nullable MarioTravelData marioTravelData,
MarioData marioData, @Nullable MarioClientSideData marioClientData, @Nullable MarioTravelData marioTravelData,
World world, BlockPos blockPos, BlockState blockState,
int strength, int modifier, Direction direction
) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/floralquafloral/bumping/BumpManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioPackets;
import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.MarioDataManager;
import com.floralquafloral.mariodata.moveable.MarioMainClientData;
import com.floralquafloral.mariodata.moveable.MarioServerData;
Expand Down Expand Up @@ -156,7 +156,7 @@ public static void attemptBumpBlocks(
}

public static Set<BlockPos> bumpBlocksClient(
MarioClientSideDataImplementation marioClientData, @Nullable MarioMainClientData marioMainClientData,
MarioClientSideData marioClientData, @Nullable MarioMainClientData marioMainClientData,
ClientWorld world, Iterable<BlockPos> positions,
int strength, Direction direction
) {
Expand Down Expand Up @@ -275,7 +275,7 @@ private record BumpS2CPayload(int player, Set<BlockPos> positions, Direction dir
);
public static void registerReceiver() {
ClientPlayNetworking.registerGlobalReceiver(ID, (payload, context) -> {
MarioClientSideDataImplementation data = (MarioClientSideDataImplementation) MarioDataManager.getMarioData(context.player());
MarioClientSideData data = (MarioClientSideData) MarioDataManager.getMarioData(context.player());
bumpBlocksClient(
data, null,
context.player().clientWorld, payload.positions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.floralquafloral.registries.states;

import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.NotNull;

public interface MarioStateDefinition {
@NotNull Identifier getID();

void clientTick(MarioClientSideDataImplementation data, boolean isSelf);
void clientTick(MarioClientSideData data, boolean isSelf);
void serverTick(MarioAuthoritativeData data);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.floralquafloral.registries.states;

import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioServerData;
import net.minecraft.util.Identifier;

Expand All @@ -13,7 +13,7 @@ protected ParsedMarioState(MarioStateDefinition definition) {
this.DEFINITION = definition;
}

public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {
public void clientTick(MarioClientSideData data, boolean isSelf) {
this.DEFINITION.clientTick(data, isSelf);
}
public void serverTick(MarioServerData data) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.floralquafloral.registries.states.action;

import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.MarioStateDefinition;
import net.minecraft.util.Identifier;
Expand Down Expand Up @@ -175,7 +175,7 @@ class ActionTransitionDefinition {
void execute(MarioTravelData data);
}
@FunctionalInterface public interface TransitionExecutorClients {
void execute(MarioClientSideDataImplementation data, boolean isSelf, long seed);
void execute(MarioClientSideData data, boolean isSelf, long seed);
}

public final Identifier TARGET_IDENTIFIER;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.floralquafloral.registries.states.action;

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioData;
import com.floralquafloral.mariodata.MarioDataPackets;
import com.floralquafloral.mariodata.MarioPlayerData;
import com.floralquafloral.mariodata.*;
import com.floralquafloral.mariodata.moveable.MarioMainClientData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.ParsedMarioState;
Expand Down Expand Up @@ -169,7 +166,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 MarioClientSideDataImplementation clientData)
if(this.EXECUTOR_CLIENTS != null && data instanceof MarioClientSideData clientData)
this.EXECUTOR_CLIENTS.execute(clientData, data.getMario().isMainPlayer(), seed);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.ActionDefinition;
import net.minecraft.util.Identifier;
Expand Down Expand Up @@ -34,7 +33,7 @@ public void travelHook(MarioTravelData data) {
}

@Override
public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override
public void serverTick(MarioAuthoritativeData data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.ActionDefinition;
import net.minecraft.sound.SoundEvents;
Expand Down Expand Up @@ -36,7 +36,7 @@ public void travelHook(MarioTravelData data) {
}

@Override
public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override
public void serverTick(MarioAuthoritativeData data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.ActionDefinition;
import com.floralquafloral.registries.states.action.AirborneActionDefinition;
Expand Down Expand Up @@ -52,7 +52,7 @@ public class GroundPound implements ActionDefinition {
);
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.ActionDefinition;
import net.minecraft.util.Identifier;
Expand Down Expand Up @@ -42,7 +42,7 @@ public void travelHook(MarioTravelData data) {
}

@Override
public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override
public void serverTick(MarioAuthoritativeData data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.MarioPlayerData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.ActionDefinition;
Expand Down Expand Up @@ -34,7 +34,7 @@ public void travelHook(MarioTravelData data) {
}

@Override
public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {
public void clientTick(MarioClientSideData data, boolean isSelf) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.AirborneActionDefinition;
import com.floralquafloral.stats.CharaStat;
Expand Down Expand Up @@ -50,7 +50,7 @@ public class Fall extends AirborneActionDefinition {
airborneAccel(data);
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.AirborneActionDefinition;
import com.floralquafloral.stats.CharaStat;
Expand Down Expand Up @@ -54,7 +54,7 @@ public class Jump extends AirborneActionDefinition {
airborneAccel(data);
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.AirborneActionDefinition;
import com.floralquafloral.stats.CharaStat;
Expand Down Expand Up @@ -57,7 +57,7 @@ public class LongJump extends AirborneActionDefinition {
airborneAccel(data);
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.GroundedActionDefinition;
import com.floralquafloral.stats.CharaStat;
Expand Down Expand Up @@ -150,7 +150,7 @@ else if(data.getForwardVel() < BACKPEDAL_SPEED.getAsLimit(data)) {
}
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override public void serverTick(MarioAuthoritativeData data) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideData;
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;
Expand Down Expand Up @@ -51,7 +50,7 @@ public void groundedTravel(MarioTravelData data) {
);
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override public void serverTick(MarioAuthoritativeData data) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideData;
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;
Expand Down Expand Up @@ -90,7 +89,7 @@ public void groundedTravel(MarioTravelData data) {
);
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override public void serverTick(MarioAuthoritativeData data) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioMainClientData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.GroundedActionDefinition;
Expand Down Expand Up @@ -31,7 +31,7 @@ public void groundedTravel(MarioTravelData data) {
data.getTimers().actionTimer++;
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override public void serverTick(MarioAuthoritativeData data) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideDataImplementation;
import com.floralquafloral.mariodata.MarioClientSideData;
import com.floralquafloral.mariodata.moveable.MarioTravelData;
import com.floralquafloral.registries.states.action.GroundedActionDefinition;
import com.floralquafloral.stats.CharaStat;
Expand Down Expand Up @@ -45,7 +45,7 @@ public void groundedTravel(MarioTravelData data) {
);
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override public void serverTick(MarioAuthoritativeData data) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.floralquafloral.MarioQuaMario;
import com.floralquafloral.mariodata.MarioAuthoritativeData;
import com.floralquafloral.mariodata.MarioClientSideData;
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;
Expand Down Expand Up @@ -54,7 +53,7 @@ public void groundedTravel(MarioTravelData data) {
if(MathHelper.approximatelyEquals(data.getForwardVel(), 0.0)) data.getTimers().actionTimer++;
}

@Override public void clientTick(MarioClientSideDataImplementation data, boolean isSelf) {}
@Override public void clientTick(MarioClientSideData data, boolean isSelf) {}

@Override public void serverTick(MarioAuthoritativeData data) {}

Expand Down
Loading

0 comments on commit 40ca890

Please sign in to comment.