Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +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.
Dieser Commit ist enthalten in:
Ursprung
8a29829d1a
Commit
dc86362c9a
@ -47,14 +47,17 @@ public class CraftFirework extends CraftEntity implements Firework {
|
|||||||
return "CraftFirework";
|
return "CraftFirework";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public EntityType getType() {
|
public EntityType getType() {
|
||||||
return EntityType.FIREWORK;
|
return EntityType.FIREWORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public FireworkMeta getFireworkMeta() {
|
public FireworkMeta getFireworkMeta() {
|
||||||
return (FireworkMeta) item.getItemMeta();
|
return (FireworkMeta) item.getItemMeta();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setFireworkMeta(FireworkMeta meta) {
|
public void setFireworkMeta(FireworkMeta meta) {
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
|
|
||||||
@ -63,4 +66,9 @@ public class CraftFirework extends CraftEntity implements Firework {
|
|||||||
|
|
||||||
getHandle().getDataWatcher().h(FIREWORK_ITEM_INDEX); // Update
|
getHandle().getDataWatcher().h(FIREWORK_ITEM_INDEX); // Update
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detonate() {
|
||||||
|
getHandle().expectedLifespan = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren