-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from ManasMods/1.19.2/minh
Critical Chance Events
- Loading branch information
Showing
5 changed files
with
81 additions
and
15 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
21 changes: 21 additions & 0 deletions
21
...ain/java/com/github/manasmods/manascore/api/attribute/event/ArrowCriticalChanceEvent.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,21 @@ | ||
package com.github.manasmods.manascore.api.attribute.event; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.entity.projectile.Projectile; | ||
import net.minecraftforge.event.entity.living.LivingEvent; | ||
import net.minecraftforge.eventbus.api.Cancelable; | ||
|
||
@Getter | ||
@Cancelable | ||
public class ArrowCriticalChanceEvent extends LivingEvent { | ||
@Setter | ||
private double critChance; | ||
private final Projectile arrow; | ||
public ArrowCriticalChanceEvent(LivingEntity owner, Projectile arrow, double critChance) { | ||
super(owner); | ||
this.arrow = arrow; | ||
this.critChance = critChance; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/github/manasmods/manascore/api/attribute/event/CriticalChanceEvent.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,26 @@ | ||
package com.github.manasmods.manascore.api.attribute.event; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraftforge.event.entity.living.LivingEvent; | ||
import net.minecraftforge.eventbus.api.Cancelable; | ||
|
||
@Getter | ||
@Cancelable | ||
public class CriticalChanceEvent extends LivingEvent { | ||
@Setter | ||
private float damageModifier; | ||
@Setter | ||
private double critChance; | ||
private final float oldDamageModifier; | ||
private final Entity target; | ||
|
||
public CriticalChanceEvent(LivingEntity attacker, Entity target, float damageModifier, double critChance) { | ||
super(attacker); | ||
this.target = target; | ||
this.oldDamageModifier = damageModifier; | ||
this.critChance = critChance; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/github/manasmods/manascore/api/attribute/event/package-info.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,7 @@ | ||
@ParametersAreNonnullByDefault | ||
@MethodsReturnNonnullByDefault | ||
package com.github.manasmods.manascore.api.attribute.event; | ||
|
||
import com.github.manasmods.manascore.api.util.MethodsReturnNonnullByDefault; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; |
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