mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
58 lines
2.4 KiB
Diff
58 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: granny <contact@granny.dev>
|
|
Date: Wed, 17 Dec 2025 20:20:00 -0800
|
|
Subject: [PATCH] lightning transforms blocks
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java
|
|
index a16aadadae7b70a8f3140478feb8846b7fec13ff..e79db0f2e80fc2a5521f9ccc34009f31c4baa04f 100644
|
|
--- a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java
|
|
+++ b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java
|
|
@@ -16,6 +16,7 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
|
|
|
|
private final LightningStrike bolt;
|
|
private final Cause cause;
|
|
+ private final java.util.List<org.bukkit.block.BlockState> blocks; // Purpur - lightning transforms blocks
|
|
|
|
private boolean cancelled;
|
|
|
|
@@ -27,9 +28,16 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
|
|
|
|
@ApiStatus.Internal
|
|
public LightningStrikeEvent(@NotNull final World world, @NotNull final LightningStrike bolt, @NotNull final Cause cause) {
|
|
+ // Purpur start - lightning transforms blocks
|
|
+ this(world, bolt, cause, new java.util.ArrayList<>());
|
|
+ }
|
|
+ @ApiStatus.Internal
|
|
+ public LightningStrikeEvent(@NotNull final World world, @NotNull final LightningStrike bolt, @NotNull final Cause cause, @NotNull final java.util.List<org.bukkit.block.BlockState> blocks) {
|
|
+ // Purpur end - lightning transforms blocks
|
|
super(world);
|
|
this.bolt = bolt;
|
|
this.cause = cause;
|
|
+ this.blocks = blocks; // Purpur - lightning transforms blocks
|
|
}
|
|
|
|
/**
|
|
@@ -62,6 +70,21 @@ public class LightningStrikeEvent extends WeatherEvent implements Cancellable {
|
|
this.cancelled = cancel;
|
|
}
|
|
|
|
+ // Purpur start - lightning transforms blocks
|
|
+ /**
|
|
+ * Get a list of all blocks that will be modified by the lightning strike.
|
|
+ * <br>
|
|
+ * This list is mutable and contains the blocks in their changed state, i.e.
|
|
+ * having a type of {@link org.bukkit.Material#GLASS}.
|
|
+ *
|
|
+ * @return list of the modified blocks.
|
|
+ */
|
|
+ @NotNull
|
|
+ public java.util.List<org.bukkit.block.BlockState> getBlocks() {
|
|
+ return blocks;
|
|
+ }
|
|
+ // Purpur end - lightning transforms blocks
|
|
+
|
|
@NotNull
|
|
@Override
|
|
public HandlerList getHandlers() {
|