Paper/CraftBukkit-Patches/0002-Skeleton-API-Implementations.patch

166 lines
5.6 KiB
Diff
Raw Normal View History

2016-03-07 09:52:16 +01:00
From 264ff17cfc09c59ab5b65acf5789129069ffe97c Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
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
2016-02-29 22:33:06 +01:00
index d330226..6b37266 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2016-02-29 22:33:06 +01:00
@@ -1653,4 +1653,14 @@ public final class CraftServer implements Server {
public UnsafeValues getUnsafe() {
return CraftMagicNumbers.INSTANCE;
}
+
+ private final Spigot spigot = new Spigot()
+ {
+
+ };
+
+ public Spigot spigot()
+ {
+ return spigot;
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2016-03-07 09:52:16 +01:00
index 9e0b5af..f85bf83 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2016-03-07 09:52:16 +01:00
@@ -1481,4 +1481,14 @@ public class CraftWorld implements World {
cps.queueUnload(chunk.locX, chunk.locZ);
}
}
+ // Spigot start
+ private final Spigot spigot = new Spigot()
+ {
+ };
+
+ public Spigot spigot()
+ {
+ return spigot;
+ }
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
2014-11-28 02:17:45 +01:00
index dca8520..bf48e6e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
@@ -71,4 +71,15 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
public void _INVALID_setShooter(LivingEntity shooter) {
getHandle().shooter = ((CraftLivingEntity) shooter).getHandle();
}
+
+ // Spigot start
+ private final Arrow.Spigot spigot = new Arrow.Spigot()
+ {
+ };
+
+ public Arrow.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
2016-02-29 22:33:06 +01:00
index 22d08a2..97dfc54 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
2016-02-29 22:33:06 +01:00
@@ -555,4 +555,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean isGlowing() {
return getHandle().glowing;
}
+
+ // Spigot start
+ private final Spigot spigot = new Spigot()
+ {
+ };
+
+ public Spigot spigot()
+ {
+ return spigot;
+ }
2014-11-28 02:17:45 +01:00
+ // 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 64e346d..243e8e5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
@@ -27,4 +27,15 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
public EntityType getType() {
return EntityType.LIGHTNING;
}
+
+ // 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
2016-03-06 04:36:33 +01:00
index 303da2d..01ba89f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2016-03-02 22:28:13 +01:00
@@ -1402,4 +1402,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
2016-02-29 22:33:06 +01:00
getHandle().playerConnection.sendPacket(packetplayoutworldparticles);
}
+
+ // 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/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 7c3adbb..e487d52 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -819,4 +819,16 @@ class CraftMetaItem implements ItemMeta, Repairable {
2015-01-18 19:17:11 +01:00
return HANDLED_TAGS;
}
}
+
+ // Spigot start
+ private final Spigot spigot = new Spigot()
+ {
+ };
+
+ @Override
+ public Spigot spigot()
+ {
+ return spigot;
+ }
2014-11-28 02:17:45 +01:00
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
2015-01-17 00:12:14 +01:00
index d3ae91b..0b71b53 100644
2014-11-28 02:17:45 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java
2015-01-17 00:12:14 +01:00
@@ -59,4 +59,11 @@ final class CraftScore implements Score {
2014-11-28 02:17:45 +01:00
public CraftScoreboard getScoreboard() {
return objective.getScoreboard();
}
+
+ // Spigot start
+ @Override
+ public boolean isScoreSet() throws IllegalStateException {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ // Spigot end
}
--
2016-02-29 22:33:06 +01:00
2.5.0