From 6b0bae2fb607a747dbf0bcde4e63d48cc960a801 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot 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. By: md_5 --- .../java/org/bukkit/craftbukkit/CraftServer.java | 12 ++++++++++++ .../main/java/org/bukkit/craftbukkit/CraftWorld.java | 11 +++++++++++ .../command/ProxiedNativeCommandSender.java | 7 +++++++ .../craftbukkit/command/ServerCommandSender.java | 12 ++++++++++++ .../org/bukkit/craftbukkit/entity/CraftEntity.java | 11 +++++++++++ .../craftbukkit/entity/CraftLightningStrike.java | 11 +++++++++++ .../org/bukkit/craftbukkit/entity/CraftPlayer.java | 11 +++++++++++ .../bukkit/craftbukkit/inventory/CraftMetaBook.java | 12 ++++++++++++ .../craftbukkit/inventory/CraftMetaBookSigned.java | 12 ++++++++++++ 9 files changed, 99 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index d7c3c797c5..238658122a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2559,4 +2559,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 this.spigot; + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 1e5828ab5c..0870eefe60 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -2082,4 +2082,15 @@ public class CraftWorld extends CraftRegionAccessor implements World { this.persistentDataContainer.putAll((CompoundTag) c); } } + + // Spigot start + private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() + { + }; + + public org.bukkit.World.Spigot spigot() + { + return this.spigot; + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java b/paper-server/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java index 093b5ae6ba..53d6950ad2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java @@ -132,4 +132,11 @@ public class ProxiedNativeCommandSender implements ProxiedCommandSender { this.getCaller().setOp(value); } + // Spigot start + @Override + public org.bukkit.command.CommandSender.Spigot spigot() + { + return this.getCaller().spigot(); + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java b/paper-server/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java index 964d998069..ed9f153ea1 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +++ b/paper-server/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 this.spigot; + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 23e0fde78b..e8fba1c702 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -892,4 +892,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } return CraftEntity.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 this.spigot; + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java index e2e2aafdea..2ab50d18a5 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java +++ b/paper-server/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 this.spigot; + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index e017e8d1c2..b77e2990e3 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2338,4 +2338,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean isAllowingServerListings() { return this.getHandle().allowsListing(); } + + // Spigot start + private final Player.Spigot spigot = new Player.Spigot() + { + }; + + public Player.Spigot spigot() + { + return this.spigot; + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java index 910fa92e08..3f03e3b029 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/paper-server/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(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 this.spigot; + } + // Spigot end } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java index fd804f497c..8f8a69eea7 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBookSigned.java +++ b/paper-server/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(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 this.spigot; + } + // Spigot end }