Package studio.magemonkey.fabled.shield
Class ShieldEffect
java.lang.Object
studio.magemonkey.fabled.shield.ShieldEffect
-
Constructor Summary
ConstructorsConstructorDescriptionShieldEffect
(String name, String classifier, double amount) ShieldEffect
(String name, String classifier, double amount, double percent) -
Method Summary
Modifier and TypeMethodDescriptionvoid
breakShield
(org.bukkit.entity.LivingEntity entity) Breaks the shield effect, removing it from the entity.protected boolean
double
damage
(org.bukkit.entity.LivingEntity entity, double amount) Applies damage to the shield effect, first reducing the damage by the percent value.double
damageAndDisplay
(double amount, org.bukkit.entity.LivingEntity entity) void
destroy()
void
display
(org.bukkit.entity.Player player) Displays the shield effect to the player.boolean
double
org.bukkit.boss.BarColor
org.bukkit.boss.BarStyle
org.bukkit.Keyed
org.bukkit.Keyed
getName()
double
double
double
getTaken()
org.bukkit.scheduler.BukkitTask
getTask()
int
hashCode()
boolean
void
setBarColor
(org.bukkit.boss.BarColor barColor) void
setBarStyle
(org.bukkit.boss.BarStyle barStyle) void
setBreakSound
(org.bukkit.Keyed breakSound) void
setDisplayLocation
(ShieldDisplay displayLocation) void
setHitSound
(org.bukkit.Keyed hitSound) void
setPercent
(double percent) void
setTaken
(double taken) void
setTask
(org.bukkit.scheduler.BukkitTask task) toString()
-
Constructor Details
-
ShieldEffect
-
ShieldEffect
-
-
Method Details
-
destroy
public void destroy() -
breakShield
public void breakShield(org.bukkit.entity.LivingEntity entity) Breaks the shield effect, removing it from the entity. This calls aFabledShieldBreakEvent
Also, optionally plays a sound to the player.- Parameters:
entity
- the entity to break the shield for
-
damage
public double damage(org.bukkit.entity.LivingEntity entity, double amount) Applies damage to the shield effect, first reducing the damage by the percent value. If the shield does not absorb all the damage, the remaining damage is returned.- Parameters:
entity
- the entity to play the hit sound toamount
- the amount of damage to apply- Returns:
- the remaining damage that was not absorbed by the shield
-
damageAndDisplay
public double damageAndDisplay(double amount, org.bukkit.entity.LivingEntity entity) -
getRemaining
public double getRemaining() -
isExhausted
public boolean isExhausted() -
display
public void display(org.bukkit.entity.Player player) Displays the shield effect to the player.- Parameters:
player
- the player to display shields to
-
getName
-
getClassifier
-
getAmount
public double getAmount() -
getPercent
public double getPercent() -
getDisplayLocation
-
getTaken
public double getTaken() -
getBarColor
public org.bukkit.boss.BarColor getBarColor() -
getBarStyle
public org.bukkit.boss.BarStyle getBarStyle() -
getHitSound
public org.bukkit.Keyed getHitSound() -
getBreakSound
public org.bukkit.Keyed getBreakSound() -
getTask
public org.bukkit.scheduler.BukkitTask getTask() -
setPercent
public void setPercent(double percent) -
setDisplayLocation
-
setTaken
public void setTaken(double taken) -
setBarColor
public void setBarColor(org.bukkit.boss.BarColor barColor) -
setBarStyle
public void setBarStyle(org.bukkit.boss.BarStyle barStyle) -
setHitSound
public void setHitSound(org.bukkit.Keyed hitSound) -
setBreakSound
public void setBreakSound(org.bukkit.Keyed breakSound) -
setTask
public void setTask(org.bukkit.scheduler.BukkitTask task) -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-