mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
More lightning API
== AT == public net.minecraft.world.entity.LightningBolt life public net.minecraft.world.entity.LightningBolt flashes
This commit is contained in:
parent
e1ec33acb3
commit
e0fe76747b
1 changed files with 19 additions and 0 deletions
|
@ -66,4 +66,23 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
|
|||
return this.spigot;
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public int getFlashCount() {
|
||||
return getHandle().flashes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFlashCount(int flashes) {
|
||||
com.google.common.base.Preconditions.checkArgument(flashes >= 0, "Flashes has to be a positive number!");
|
||||
getHandle().flashes = flashes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @org.jetbrains.annotations.Nullable org.bukkit.entity.Entity getCausingEntity() {
|
||||
final var cause = this.getHandle().getCause();
|
||||
return cause == null ? null : cause.getBukkitEntity();
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue