-
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.
- Loading branch information
1 parent
4199844
commit 7a355be
Showing
17 changed files
with
343 additions
and
130 deletions.
There are no files selected for viewing
31 changes: 30 additions & 1 deletion
31
api/src/main/java/com/fqf/mario_qua_mario/definitions/AttackInterceptingStateDefinition.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 |
---|---|---|
@@ -1,21 +1,50 @@ | ||
package com.fqf.mario_qua_mario.definitions; | ||
|
||
import com.fqf.mario_qua_mario.mariodata.IMarioClientData; | ||
import com.fqf.mario_qua_mario.mariodata.IMarioData; | ||
import com.fqf.mario_qua_mario.mariodata.IMarioReadableMotionData; | ||
import com.fqf.mario_qua_mario.mariodata.IMarioTravelData; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.hit.BlockHitResult; | ||
import net.minecraft.util.hit.EntityHitResult; | ||
import net.minecraft.util.hit.HitResult; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
public interface AttackInterceptingStateDefinition extends MarioStateDefinition { | ||
List<AttackInterceptionDefinition> getUnarmedAttackInterceptions(); | ||
@NotNull List<AttackInterceptionDefinition> getUnarmedAttackInterceptions(); | ||
|
||
interface AttackInterceptionDefinition { | ||
@Nullable Identifier getActionTarget(); | ||
@Nullable Hand getHandToSwing(); | ||
boolean shouldTriggerAttackCooldown(); | ||
|
||
boolean shouldIntercept( | ||
IMarioReadableMotionData data, float attackCooldownProgress, | ||
@Nullable BlockHitResult blockHitResult, | ||
@Nullable EntityHitResult entityHitResult | ||
); | ||
|
||
void executeTravellers( | ||
IMarioTravelData data, float attackCooldownProgress, | ||
@Nullable BlockHitResult blockHitResult, | ||
@Nullable EntityHitResult entityHitResult | ||
); | ||
|
||
void executeClients( | ||
IMarioClientData data, float attackCooldownProgress, | ||
@Nullable BlockHitResult blockHitResult, | ||
@Nullable EntityHitResult entityHitResult | ||
); | ||
|
||
void strikeEntity( | ||
IMarioData data, float attackCooldownProgress, | ||
ServerWorld world, @NotNull Entity target | ||
); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
api/src/main/java/com/fqf/mario_qua_mario/definitions/StatAlteringStateDefinition.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,4 @@ | ||
package com.fqf.mario_qua_mario.definitions; | ||
|
||
public interface StatAlteringStateDefinition extends MarioStateDefinition { | ||
} |
22 changes: 15 additions & 7 deletions
22
api/src/main/java/com/fqf/mario_qua_mario/definitions/actions/ActionDefinition.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 |
---|---|---|
@@ -1,23 +1,31 @@ | ||
package com.fqf.mario_qua_mario.definitions.actions; | ||
|
||
import com.fqf.mario_qua_mario.definitions.AttackInterceptingStateDefinition; | ||
import com.fqf.mario_qua_mario.definitions.actions.util.BumpingRule; | ||
import com.fqf.mario_qua_mario.definitions.actions.util.CameraAnimationSet; | ||
import com.fqf.mario_qua_mario.definitions.actions.util.SneakingRule; | ||
import com.fqf.mario_qua_mario.definitions.actions.util.*; | ||
import com.fqf.mario_qua_mario.mariodata.IMarioTravelData; | ||
import net.minecraft.util.Identifier; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public interface ActionDefinition extends AttackInterceptingStateDefinition { | ||
@Nullable String getAnimationName(); | ||
@Nullable CameraAnimationSet getCameraAnimations(); | ||
@NotNull SlidingStatus getSlidingStatus(); | ||
|
||
@NotNull SneakingRule getSneakingRule(); | ||
@NotNull SprintingRule getSprintingRule(); | ||
|
||
@Nullable BumpType getBumpType(); | ||
@Nullable Identifier getStompTypeID(); | ||
|
||
boolean canSprint(); | ||
|
||
@Nullable Identifier getStompType(); | ||
void travelHook(IMarioTravelData data); | ||
|
||
@Nullable BumpingRule getBumpingRule(); | ||
@NotNull List<TransitionDefinition> getBasicTransitions(); | ||
@NotNull List<TransitionDefinition> getInputTransitions(); | ||
@NotNull List<TransitionDefinition> getWorldCollisionTransitions(); | ||
|
||
@NotNull Set<TransitionInjectionDefinition> getTransitionInjections(); | ||
} |
30 changes: 30 additions & 0 deletions
30
api/src/main/java/com/fqf/mario_qua_mario/definitions/actions/util/BumpType.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,30 @@ | ||
package com.fqf.mario_qua_mario.definitions.actions.util; | ||
|
||
import com.fqf.mario_qua_mario.util.CharaStat; | ||
import com.fqf.mario_qua_mario.util.StatCategory; | ||
|
||
public record BumpType(int ceilingBumpStrength, int floorBumpStrength, int wallBumpStrength, CharaStat wallBumpSpeedThreshold) { | ||
/** | ||
* A strength of 4 represents Super Mario being able to destroy a Brick Block, but Small Mario only bumping it. | ||
* (Example: Ground Pound, hitting a block from below) | ||
* <p> | ||
* A strength of 3 represents Super Mario and Small Mario both bumping a Brick Block without destroying it. | ||
* (Example: Rolling into a wall, Bonking) | ||
* <p> | ||
* A strength of 2 represents Super Mario being able to shatter a Flip Block, and Small Mario having no effect on it. | ||
* (Example: Spin Jump) | ||
* <p> | ||
* A strength of 1 represents Mario landing on a block and having no effect on it. | ||
* (Example: Regular jump) | ||
*/ | ||
public static final BumpType GROUNDED = new BumpType(0, 0); | ||
public static final BumpType JUMPING = new BumpType(4, 1); | ||
public static final BumpType FALLING = new BumpType(4, 1); | ||
public static final BumpType SWIMMING = new BumpType(4, 0); | ||
public static final BumpType GROUND_POUND = new BumpType(0, 4); | ||
public static final BumpType SPIN_JUMPING = new BumpType(2, 2); | ||
|
||
public BumpType(int ceilingBumpStrength, int floorBumpStrength) { | ||
this(ceilingBumpStrength, floorBumpStrength, 0, new CharaStat(0, StatCategory.THRESHOLD)); | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
api/src/main/java/com/fqf/mario_qua_mario/definitions/actions/util/BumpingRule.java
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
api/src/main/java/com/fqf/mario_qua_mario/definitions/actions/util/SlidingStatus.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
6 changes: 6 additions & 0 deletions
6
api/src/main/java/com/fqf/mario_qua_mario/definitions/actions/util/SprintingRule.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,6 @@ | ||
package com.fqf.mario_qua_mario.definitions.actions.util; | ||
|
||
public enum SprintingRule { | ||
ALLOW, | ||
PROHIBIT | ||
} |
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
8 changes: 5 additions & 3 deletions
8
mod/src/main/java/com/fqf/mario_qua_mario/mixin/PlayerEntityMixin.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 |
---|---|---|
@@ -1,19 +1,21 @@ | ||
package com.fqf.mario_qua_mario.mixin; | ||
|
||
import com.fqf.mario_qua_mario.MarioQuaMario; | ||
import com.fqf.mario_qua_mario.mariodata.MarioPlayerData; | ||
import com.fqf.mario_qua_mario.mariodata.injections.MarioDataHolder; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.math.Vec3d; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(PlayerEntity.class) | ||
public class PlayerEntityMixin { | ||
public abstract class PlayerEntityMixin implements MarioDataHolder { | ||
@Inject(method = "travel", at = @At("HEAD")) | ||
private void travelHook(Vec3d movementInput, CallbackInfo ci) { | ||
PlayerEntity meAsPlayer = (PlayerEntity) (Object) this; | ||
MarioQuaMario.LOGGER.info("Travel hook: \n{}\n{}\n{}", meAsPlayer, meAsPlayer.mqm$getMarioData(), meAsPlayer.mqm$getMarioData().getValue()); | ||
mqm$getMarioData().isClient(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
mod/src/main/java/com/fqf/mario_qua_mario/registries/ParsedMarioThing.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,14 @@ | ||
package com.fqf.mario_qua_mario.registries; | ||
|
||
import com.fqf.mario_qua_mario.definitions.MarioStateDefinition; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class ParsedMarioThing { | ||
public final Identifier ID; | ||
|
||
public ParsedMarioThing(MarioStateDefinition definition) { | ||
this.ID = definition.getID(); | ||
} | ||
|
||
// TODO: Additional constructor for use with Stomp Types | ||
} |
Oops, something went wrong.