spigot/Bukkit-Patches/0007-Silenceable-Lightning-API.patch

71 lines
2.7 KiB
Diff
Raw Permalink Normal View History

2025-03-26 03:05:00 +11:00
From facd769ef2e8f00b613442d42ad1f849cb84868a Mon Sep 17 00:00:00 2001
2014-02-23 16:20:51 -04:00
From: drXor <mcyoungsota@gmail.com>
Date: Sun, 23 Feb 2014 16:16:29 -0400
Subject: [PATCH] Silenceable Lightning API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
2024-12-04 03:20:00 +11:00
index 35c64636..55cfe19b 100644
2014-02-23 16:20:51 -04:00
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
2024-06-14 01:05:00 +10:00
@@ -2831,6 +2831,35 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
2020-01-24 17:56:32 +11:00
// Spigot start
public class Spigot {
2018-07-15 10:00:00 +10:00
2014-02-23 16:20:51 -04:00
+ /**
+ * Strikes lightning at the given {@link Location} and possibly without sound
+ *
+ * @param loc The location to strike lightning
+ * @param isSilent Whether this strike makes no sound
+ * @return The lightning entity.
+ * @deprecated sound is now client side and cannot be removed
+ * @see World#strikeLightning(org.bukkit.Location)
2018-07-15 10:00:00 +10:00
+ */
2019-03-13 17:43:06 +11:00
+ @NotNull
2024-11-25 07:52:36 +11:00
+ @Deprecated(since = "1.20.4")
2020-01-24 17:56:32 +11:00
+ public LightningStrike strikeLightning(@NotNull Location loc, boolean isSilent) {
+ throw new UnsupportedOperationException("Not supported yet.");
2014-02-23 16:20:51 -04:00
+ }
2018-07-15 10:00:00 +10:00
+
2014-02-23 16:20:51 -04:00
+ /**
+ * Strikes lightning at the given {@link Location} without doing damage and possibly without sound
+ *
+ * @param loc The location to strike lightning
+ * @param isSilent Whether this strike makes no sound
+ * @return The lightning entity.
+ * @deprecated sound is now client side and cannot be removed
+ * @see World#strikeLightningEffect(org.bukkit.Location)
2014-02-23 16:20:51 -04:00
+ */
2019-03-13 17:43:06 +11:00
+ @NotNull
2024-11-25 07:52:36 +11:00
+ @Deprecated(since = "1.20.4")
2020-01-24 17:56:32 +11:00
+ public LightningStrike strikeLightningEffect(@NotNull Location loc, boolean isSilent) {
+ throw new UnsupportedOperationException("Not supported yet.");
2014-02-23 16:20:51 -04:00
+ }
}
2019-03-13 17:43:06 +11:00
@NotNull
2014-02-23 16:20:51 -04:00
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
2024-12-04 03:20:00 +11:00
index d913298e..186d0bbf 100644
2014-02-23 16:20:51 -04:00
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -86,6 +86,16 @@ public interface LightningStrike extends Entity {
2020-01-24 17:56:32 +11:00
// Spigot start
public class Spigot extends Entity.Spigot {
2014-02-23 16:20:51 -04:00
+ /**
2014-02-23 16:20:51 -04:00
+ * Returns whether the strike is silent.
+ *
+ * @return whether the strike is silent.
+ * @deprecated sound is now client side and cannot be removed
2014-02-23 16:20:51 -04:00
+ */
2024-11-25 07:52:36 +11:00
+ @Deprecated(since = "1.20.4")
2020-01-24 17:56:32 +11:00
+ public boolean isSilent() {
+ throw new UnsupportedOperationException("Not supported yet.");
2014-02-23 16:20:51 -04:00
+ }
}
2019-03-13 17:43:06 +11:00
@NotNull
2014-02-23 16:20:51 -04:00
--
2025-03-26 03:05:00 +11:00
2.49.0
2014-02-23 16:20:51 -04:00