mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Fix method name for Critical damage (#6813)
This commit is contained in:
parent
f024b4b48a
commit
61a906f4c8
@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
+ // Paper start - add critical damage API
|
+ // Paper start - add critical damage API
|
||||||
+ private boolean critical;
|
+ private boolean critical;
|
||||||
+ public boolean isCritcal() {
|
+ public boolean isCritical() {
|
||||||
+ return this.critical;
|
+ return this.critical;
|
||||||
+ }
|
+ }
|
||||||
+ public DamageSource critical() {
|
+ public DamageSource critical() {
|
||||||
@ -113,7 +113,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
damageCause = DamageCause.ENTITY_EXPLOSION;
|
damageCause = DamageCause.ENTITY_EXPLOSION;
|
||||||
}
|
}
|
||||||
- event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions);
|
- event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions);
|
||||||
+ event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions, source.isCritcal()); // Paper - add critical damage API
|
+ event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions, source.isCritical()); // Paper - add critical damage API
|
||||||
}
|
}
|
||||||
event.setCancelled(cancelled);
|
event.setCancelled(cancelled);
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
- return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled);
|
- return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled);
|
||||||
+ return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritcal()); // Paper - add critical damage API
|
+ return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
||||||
} else if (source == DamageSource.OUT_OF_WORLD) {
|
} else if (source == DamageSource.OUT_OF_WORLD) {
|
||||||
EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
|
EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
|
||||||
event.setCancelled(cancelled);
|
event.setCancelled(cancelled);
|
||||||
@ -131,7 +131,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.msgId));
|
throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.msgId));
|
||||||
}
|
}
|
||||||
- EntityDamageEvent event = new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions);
|
- EntityDamageEvent event = new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions);
|
||||||
+ EntityDamageEvent event = new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions, source.isCritcal()); // Paper - add critical damage API
|
+ EntityDamageEvent event = new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions, source.isCritical()); // Paper - add critical damage API
|
||||||
event.setCancelled(cancelled);
|
event.setCancelled(cancelled);
|
||||||
CraftEventFactory.callEvent(event);
|
CraftEventFactory.callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
@ -140,7 +140,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
if (cause != null) {
|
if (cause != null) {
|
||||||
- return CraftEventFactory.callEntityDamageEvent(null, entity, cause, modifiers, modifierFunctions, cancelled);
|
- return CraftEventFactory.callEntityDamageEvent(null, entity, cause, modifiers, modifierFunctions, cancelled);
|
||||||
+ return CraftEventFactory.callEntityDamageEvent(null, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritcal()); // Paper - add critical damage API
|
+ return CraftEventFactory.callEntityDamageEvent(null, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalStateException(String.format("Unhandled damage of %s from %s", entity, source.msgId));
|
throw new IllegalStateException(String.format("Unhandled damage of %s from %s", entity, source.msgId));
|
||||||
|
Loading…
Reference in New Issue
Block a user