-
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.
Starting to change Stomps to use interface injection
- Loading branch information
1 parent
e45e86d
commit 3c8e9f5
Showing
5 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
api/src/main/java/com/floralquafloral/StompableEntity.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,17 @@ | ||
package com.floralquafloral; | ||
|
||
import net.minecraft.entity.damage.DamageSource; | ||
import net.minecraft.util.Identifier; | ||
|
||
public interface StompableEntity { | ||
StompResult qua_mario$stomp(Identifier stompType, DamageSource damageSource, float amount); | ||
|
||
enum StompResult { | ||
NORMAL, | ||
PAINFUL, | ||
GLANCING, | ||
RESISTED, | ||
FAIL_IF_BASIC, | ||
FAIL | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
api/src/main/java/com/floralquafloral/mixin/EntityStompabilityMixin.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,25 @@ | ||
package com.floralquafloral.mixin; | ||
|
||
import com.floralquafloral.StompableEntity; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityType; | ||
import net.minecraft.entity.MovementType; | ||
import net.minecraft.entity.damage.DamageSource; | ||
import net.minecraft.util.Identifier; | ||
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(Entity.class) | ||
public abstract class EntityStompabilityMixin implements StompableEntity { | ||
@Shadow public abstract EntityType<?> getType(); | ||
|
||
@Override public StompResult qua_mario$stomp(Identifier stompType, DamageSource damageSource, float amount) { | ||
// if(getType().isIn()) | ||
|
||
return StompResult.NORMAL; | ||
} | ||
} |
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