-
-
Notifications
You must be signed in to change notification settings - Fork 873
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
Showing
5 changed files
with
79 additions
and
28 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
76 changes: 57 additions & 19 deletions
76
src/main/java/com/gmail/nossr50/events/skills/rupture/McMMOEntityDamageByRuptureEvent.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,57 @@ | ||
//package com.gmail.nossr50.events.skills.rupture; | ||
// | ||
//import com.gmail.nossr50.datatypes.player.McMMOPlayer; | ||
//import org.bukkit.entity.Entity; | ||
//import org.bukkit.event.entity.EntityDamageByEntityEvent; | ||
//import org.jetbrains.annotations.NotNull; | ||
// | ||
//public class McMMOEntityDamageByRuptureEvent extends EntityDamageByEntityEvent { | ||
// private final McMMOPlayer mcMMODamager; | ||
// | ||
// public McMMOEntityDamageByRuptureEvent(@NotNull McMMOPlayer damager, @NotNull Entity damagee, double damage) { | ||
// this.mcMMODamager = damager; | ||
// } | ||
// | ||
// @NotNull | ||
// public McMMOPlayer getMcMMODamager() { | ||
// return mcMMODamager; | ||
// } | ||
//} | ||
package com.gmail.nossr50.events.skills.rupture; | ||
|
||
import com.gmail.nossr50.datatypes.player.McMMOPlayer; | ||
import org.bukkit.entity.Entity; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
import org.bukkit.event.entity.EntityEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class McMMOEntityDamageByRuptureEvent extends EntityEvent implements Cancellable { | ||
private final McMMOPlayer damager; | ||
private final Entity damagee; | ||
private double damage; | ||
private boolean isCancelled = false; | ||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public McMMOEntityDamageByRuptureEvent(@NotNull McMMOPlayer damager, @NotNull Entity damagee, double damage) { | ||
super(damagee); | ||
this.damager = damager; | ||
this.damagee = damagee; | ||
this.damage = damage; | ||
} | ||
|
||
@NotNull | ||
@Deprecated | ||
public McMMOPlayer getMcMMODamager() { | ||
return damager; | ||
} | ||
|
||
public McMMOPlayer getDamager() { | ||
return damager; | ||
} | ||
|
||
public double getDamage() { | ||
return damage; | ||
} | ||
|
||
public void setDamage(double damage) { | ||
this.damage = Math.max(0, damage); | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return isCancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancel) { | ||
isCancelled = cancel; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
} |
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