mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
Implement Firework.detonate(). Adds BUKKIT-4538
This implements the detonate method from bukkit by setting the fuse timer to 0. This makes a firework explode using the normal codepath, but without waiting for the fuse. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
parent
76c6e0cb14
commit
672d7e3316
1 changed files with 8 additions and 0 deletions
|
@ -47,14 +47,17 @@ public class CraftFirework extends CraftEntity implements Firework {
|
|||
return "CraftFirework";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getType() {
|
||||
return EntityType.FIREWORK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FireworkMeta getFireworkMeta() {
|
||||
return (FireworkMeta) item.getItemMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFireworkMeta(FireworkMeta meta) {
|
||||
item.setItemMeta(meta);
|
||||
|
||||
|
@ -63,4 +66,9 @@ public class CraftFirework extends CraftEntity implements Firework {
|
|||
|
||||
getHandle().getDataWatcher().h(FIREWORK_ITEM_INDEX); // Update
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detonate() {
|
||||
getHandle().expectedLifespan = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue