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

205 lines
7.4 KiB
Diff

From 08e7661b34053cddee5ba2cba8ecb4f81364f981 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 2 Jun 2013 15:10:56 +1000
Subject: [PATCH] Skeleton API Implementations
This contains the basic, empty implementations for some Spigot-API extensions. They are included early in the patching progress so that compilation will still succeed midway despite the APIs only being provided by subsequent patches.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0217535a2b..d9cdc5db66 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2551,4 +2551,16 @@ public final class CraftServer implements Server {
public UnsafeValues getUnsafe() {
return CraftMagicNumbers.INSTANCE;
}
+
+ // Spigot start
+ private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
+ {
+
+ };
+
+ public org.bukkit.Server.Spigot spigot()
+ {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 0cffbfaac3..09506adef0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -2086,4 +2086,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
this.persistentDataContainer.putAll((NBTTagCompound) c);
}
}
+
+ // Spigot start
+ private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
+ {
+ };
+
+ public org.bukkit.World.Spigot spigot()
+ {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java
index f9d3b5a499..b63472322d 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java
@@ -132,4 +132,11 @@ public class ProxiedNativeCommandSender implements ProxiedCommandSender {
getCaller().setOp(value);
}
+ // Spigot start
+ @Override
+ public org.bukkit.command.CommandSender.Spigot spigot()
+ {
+ return getCaller().spigot();
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java
index be10d200e5..861739d4c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java
@@ -95,4 +95,16 @@ public abstract class ServerCommandSender implements CommandSender {
public void sendMessage(UUID uuid, String... messages) {
this.sendMessage(messages); // ServerCommandSenders have no use for senders
}
+
+ // Spigot start
+ private final org.bukkit.command.CommandSender.Spigot spigot = new org.bukkit.command.CommandSender.Spigot()
+ {
+ };
+
+ @Override
+ public org.bukkit.command.CommandSender.Spigot spigot()
+ {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 1ffd115276..ff47b09dcc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -894,4 +894,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
return perm;
}
+
+ // Spigot start
+ private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot()
+ {
+ };
+
+ public org.bukkit.entity.Entity.Spigot spigot()
+ {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
index 3a4fb14bff..3a68e1cf5c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
@@ -50,4 +50,15 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
public String toString() {
return "CraftLightningStrike";
}
+
+ // Spigot start
+ private final LightningStrike.Spigot spigot = new LightningStrike.Spigot() {
+
+ };
+
+ @Override
+ public LightningStrike.Spigot spigot() {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index fa364aa322..241a17ddd9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2357,4 +2357,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean isAllowingServerListings() {
return getHandle().allowsListing();
}
+
+ // Spigot start
+ private final Player.Spigot spigot = new Player.Spigot()
+ {
+ };
+
+ public Player.Spigot spigot()
+ {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
index d338430fde..ed599634a1 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
@@ -246,6 +246,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta, WritableBo
if (this.pages != null) {
meta.pages = new ArrayList<String>(this.pages);
}
+ meta.spigot = meta.new SpigotMeta(); // Spigot
return meta;
}
@@ -286,4 +287,15 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta, WritableBo
return builder;
}
+
+ // Spigot start
+ private BookMeta.Spigot spigot = new SpigotMeta();
+ private class SpigotMeta extends BookMeta.Spigot {
+ };
+
+ @Override
+ public BookMeta.Spigot spigot() {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
index 7a7c71927d..67c6bae183 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java
@@ -292,6 +292,7 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
if (this.pages != null) {
meta.pages = new ArrayList<IChatBaseComponent>(this.pages);
}
+ meta.spigot = meta.new SpigotMeta(); // Spigot
return meta;
}
@@ -364,4 +365,15 @@ public class CraftMetaBookSigned extends CraftMetaItem implements BookMeta {
return builder;
}
+
+ // Spigot start
+ private BookMeta.Spigot spigot = new SpigotMeta();
+ private class SpigotMeta extends BookMeta.Spigot {
+ };
+
+ @Override
+ public BookMeta.Spigot spigot() {
+ return spigot;
+ }
+ // Spigot end
}
--
2.47.0