0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/spigot.git synced 2024-11-24 12:56:24 +00:00
spigot/Bukkit-Patches/0002-Skeleton-API-Implementations.patch
2024-10-24 06:15:00 +11:00

162 lines
4.8 KiB
Diff

From 3e4e395c8289219ff3354a607ecef1c7d25861c4 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 15 May 2017 15:16:15 +1000
Subject: [PATCH] Skeleton API Implementations
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 083b98a9..eeb34a67 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2151,4 +2151,9 @@ public final class Bukkit {
public static UnsafeValues getUnsafe() {
return server.getUnsafe();
}
+
+ @NotNull
+ public static Server.Spigot spigot() {
+ return server.spigot();
+ }
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index b5740535..36fbd94a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1834,4 +1834,13 @@ public interface Server extends PluginMessageRecipient {
@Deprecated
@NotNull
UnsafeValues getUnsafe();
+
+ // Spigot start
+ public class Spigot {
+
+ }
+
+ @NotNull
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index e82e4d49..53cb50e6 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2828,6 +2828,15 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
StructureSearchResult locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored);
+ // Spigot start
+ public class Spigot {
+
+ }
+
+ @NotNull
+ Spigot spigot();
+ // Spigot end
+
/**
* Find the closest nearby location with a biome matching the provided
* {@link Biome}(s). Finding biomes can, and will, block if the world is looking
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
index a7a2587b..4b6b9540 100644
--- a/src/main/java/org/bukkit/command/CommandSender.java
+++ b/src/main/java/org/bukkit/command/CommandSender.java
@@ -53,4 +53,13 @@ public interface CommandSender extends Permissible {
*/
@NotNull
public String getName();
+
+ // Spigot start
+ public class Spigot {
+
+ }
+
+ @NotNull
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index dee99ac2..558fe6e2 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -766,4 +766,14 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@NotNull
@ApiStatus.Experimental
Entity copy(@NotNull Location to);
+
+ // Spigot start
+ public class Spigot extends CommandSender.Spigot {
+
+ }
+
+ @NotNull
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java
index 158ac20f..d913298e 100644
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -2,6 +2,7 @@ package org.bukkit.entity;
import org.bukkit.GameEvent;
import org.bukkit.enchantments.Enchantment;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -82,4 +83,13 @@ public interface LightningStrike extends Entity {
*/
public void setCausingPlayer(@Nullable Player player);
+ // Spigot start
+ public class Spigot extends Entity.Spigot {
+
+ }
+
+ @NotNull
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 3046ffe7..fa02099c 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2287,4 +2287,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @return whether the player allows server listings
*/
public boolean isAllowingServerListings();
+
+ // Spigot start
+ public class Spigot extends Entity.Spigot {
+
+ }
+
+ @NotNull
+ @Override
+ Spigot spigot();
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index 1be27b04..8a01c92d 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -113,4 +113,13 @@ public interface BookMeta extends WritableBookMeta {
@Override
@NotNull
BookMeta clone();
+
+ // Spigot start
+ public class Spigot {
+
+ }
+
+ @NotNull
+ Spigot spigot();
+ // Spigot end
}
--
2.47.0