mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Implementation of the EntityDamage*Events.
Many files were added to enable the correct hooking of these events, and a new event EntityDamageByProjectileEvent. EntityDamageByProjectileEvent adds the ability to get the projectile entity (such as an egg) and also set if the projectile 'bounces'. Only two projectiles currently respond to bouncing, Arrow and Fish - were if the fish bounces it means the fish is not hooked. Bouncing is independent of any damage caused via the event. In addition, the changes to EntityDamageEvent that enable setting post-event damage were implemented in all hooks. Finally, a bug in CraftArrow was fixed, where the constructor was not declared public. By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
parent
31192b03fe
commit
ffc7372165
2 changed files with 34 additions and 0 deletions
paper-server/src/main/java/org/bukkit/craftbukkit/entity
|
@ -0,0 +1,17 @@
|
|||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityFireball;
|
||||
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.Fireball;
|
||||
|
||||
/**
|
||||
* An egg.
|
||||
*
|
||||
* @author Cogito
|
||||
*/
|
||||
public class CraftFireball extends CraftEntity implements Fireball {
|
||||
public CraftFireball(CraftServer server, EntityFireball ent) {
|
||||
super(server, ent);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.bukkit.craftbukkit.entity;
|
||||
|
||||
import net.minecraft.server.EntityFish;
|
||||
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.entity.Fish;
|
||||
|
||||
/**
|
||||
* An egg.
|
||||
*
|
||||
* @author Cogito
|
||||
*/
|
||||
public class CraftFish extends CraftEntity implements Fish {
|
||||
public CraftFish(CraftServer server, EntityFish ent) {
|
||||
super(server, ent);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue