-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
why is playing sounds on the client side so hard! i'm sad!
- Loading branch information
1 parent
cb88e0c
commit 85ce505
Showing
11 changed files
with
148 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/com/floralquafloral/registries/states/action/baseactions/grounded/PRun.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.floralquafloral.registries.states.action.baseactions.grounded; | ||
|
||
import com.floralquafloral.MarioQuaMario; | ||
import com.floralquafloral.mariodata.MarioPlayerData; | ||
import com.floralquafloral.mariodata.client.Input; | ||
import com.floralquafloral.mariodata.client.MarioClientData; | ||
import com.floralquafloral.registries.states.action.GroundedActionDefinition; | ||
import net.minecraft.util.Identifier; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
import static com.floralquafloral.CharaStat.*; | ||
|
||
public class PRun extends GroundedActionDefinition { | ||
@Override public @NotNull Identifier getID() { | ||
return Identifier.of(MarioQuaMario.MOD_ID, "p_run"); | ||
} | ||
@Override public @Nullable String getAnimationName() { | ||
return "p-run"; | ||
} | ||
|
||
@Override | ||
public void groundedSelfTick(MarioClientData data) { | ||
boolean sprinting = data.getMario().isSprinting(); | ||
groundAccel(data, | ||
sprinting ? OVERRUN_ACCEL.get(data) : OVERWALK_ACCEL.get(data), | ||
sprinting ? P_SPEED.get(data) : WALK_SPEED.get(data), | ||
STRAFE_ACCEL.get(data), STRAFE_SPEED.get(data), | ||
Input.getForwardInput(), Input.getStrafeInput(), | ||
P_SPEED_REDIRECTION.get(data) | ||
); | ||
} | ||
|
||
@Override public void otherClientsTick(MarioPlayerData data) {} | ||
|
||
@Override public void serverTick(MarioPlayerData data) {} | ||
|
||
@Override public SneakLegalityRule getSneakLegalityRule() { | ||
return SneakLegalityRule.ALLOW; | ||
} | ||
@Override public SlidingStatus getConstantSlidingStatus() { | ||
return SlidingStatus.NOT_SLIDING_SMOOTH; | ||
} | ||
@Override public @Nullable Identifier getStompType() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public List<ActionTransitionDefinition> getPreTickTransitions() { | ||
return List.of( | ||
// GroundedTransitions.FALL, | ||
GroundedTransitions.DUCK_WADDLE, | ||
new ActionTransitionDefinition("qua_mario:basic", | ||
(data) -> data.getForwardVel() < RUN_SPEED.getAsThreshold(data)) | ||
); | ||
} | ||
|
||
@Override | ||
public List<ActionTransitionDefinition> getPostTickTransitions() { | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public List<ActionTransitionDefinition> getPostMoveTransitions() { | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public List<ActionTransitionInjection> getTransitionInjections() { | ||
return List.of(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters