-
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.
Vehicles no longer cancel Mario's Action FSM. Instead he has a Mounte…
…d action and dismounts by doing a backflip (currently just a regular jump). Also Toadette's enabled again (when did she leave??)
- Loading branch information
1 parent
3af2880
commit e3e4136
Showing
11 changed files
with
163 additions
and
17 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
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
85 changes: 85 additions & 0 deletions
85
src/main/java/com/floralquafloral/registries/states/action/baseactions/Mounted.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,85 @@ | ||
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.moveable.MarioTravelData; | ||
import com.floralquafloral.registries.states.action.ActionDefinition; | ||
import com.floralquafloral.registries.states.action.AirborneActionDefinition; | ||
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; | ||
|
||
public class Mounted implements ActionDefinition { | ||
@Override @NotNull public Identifier getID() { | ||
return Identifier.of(MarioQuaMario.MOD_ID, "mounted"); | ||
} | ||
@Override @Nullable public String getAnimationName() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void travelHook(MarioTravelData data) { | ||
AirborneActionDefinition.jumpCapped = false; | ||
} | ||
|
||
@Override | ||
public void clientTick(MarioClientSideData data, boolean isSelf) {} | ||
|
||
@Override | ||
public void serverTick(MarioServerData data) { | ||
|
||
} | ||
|
||
@Override public SneakLegalityRule getSneakLegalityRule() { | ||
return SneakLegalityRule.ALLOW; | ||
} | ||
@Override public SlidingStatus getConstantSlidingStatus() { | ||
return SlidingStatus.NOT_SLIDING; | ||
} | ||
@Override public @Nullable Identifier getStompType() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public List<ActionTransitionDefinition> getPreTickTransitions() { | ||
return List.of( | ||
new ActionTransitionDefinition("qua_mario:jump", | ||
data -> !data.getMario().hasVehicle() && ((MarioPlayerData) data).attemptDismount, | ||
data -> { | ||
((MarioPlayerData) data).attemptDismount = false; | ||
assert GroundedActionDefinition.GroundedTransitions.JUMP.EXECUTOR_TRAVELLERS != null; | ||
GroundedActionDefinition.GroundedTransitions.JUMP.EXECUTOR_TRAVELLERS.execute(data); | ||
}, | ||
GroundedActionDefinition.GroundedTransitions.JUMP.EXECUTOR_CLIENTS | ||
), | ||
new ActionTransitionDefinition("qua_mario:fall", | ||
data -> !data.getMario().hasVehicle() && !((MarioPlayerData) data).attemptDismount | ||
), | ||
new ActionTransitionDefinition("qua_mario:mounted", | ||
(data) -> (!((MarioPlayerData) data).attemptDismount) && data.getInputs().DUCK.isHeld() && data.getInputs().JUMP.isPressed(), | ||
data -> ((MarioPlayerData) data).attemptDismount = true, | ||
null | ||
) | ||
); | ||
} | ||
|
||
@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