Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5325)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
d264e972 #591: Add option for a consumer before spawning an item
1c537fce #590: Add spawn and transform reasons for piglin zombification.

CraftBukkit Changes:
ee5006d1 #810: Add option for a consumer before spawning an item
f6a39d3c #809: Add spawn and transform reasons for piglin zombification.
0c24068a Organise imports

Spigot Changes:
bff52619 Organise imports
This commit is contained in:
Josh Roy 2021-03-08 18:12:31 -05:00
parent b154b7f941
commit 8a65e6b959
22 changed files with 50 additions and 47 deletions

View File

@ -16,8 +16,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java
@@ -0,0 +0,0 @@ import org.bukkit.Material;
import org.bukkit.configuration.serialization.DelegateDeserialization;
@@ -0,0 +0,0 @@ import org.bukkit.configuration.serialization.DelegateDeserialization;
import org.bukkit.craftbukkit.inventory.CraftMetaItem.ItemMetaKey;
@DelegateDeserialization(CraftMetaItem.SerializableMeta.class)
-public class CraftMetaArmorStand extends CraftMetaItem {

View File

@ -8,8 +8,8 @@ diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntityBeacon.java
+++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.potion.CraftPotionUtil;
import org.bukkit.entity.HumanEntity;
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
import org.bukkit.craftbukkit.potion.CraftPotionUtil;
import org.bukkit.potion.PotionEffect;
// CraftBukkit end
+// Paper start

View File

@ -96,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
import org.spigotmc.CustomTimingsHandler; // Spigot
-public abstract class TileEntity {

View File

@ -16,9 +16,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot start - spawn location event
Player bukkitPlayer = entityplayer.getBukkitEntity();
- PlayerSpawnLocationEvent ev = new PlayerSpawnLocationEvent(bukkitPlayer, bukkitPlayer.getLocation());
+ PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(bukkitPlayer, bukkitPlayer.getLocation()); // Paper use our duplicate event
Bukkit.getPluginManager().callEvent(ev);
- org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(bukkitPlayer, bukkitPlayer.getLocation());
+ org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(bukkitPlayer, bukkitPlayer.getLocation()); // Paper use our duplicate event
cserver.getPluginManager().callEvent(ev);
Location loc = ev.getSpawnLocation();
@@ -0,0 +0,0 @@ public abstract class PlayerList {

View File

@ -124,8 +124,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end
+import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent
// PAIL: Fixme
public class EntityEnderDragon extends EntityInsentient implements IMonster {
@@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
});
craftBlock.getNMS().dropNaturally((WorldServer) world, blockposition, ItemStack.b);

View File

@ -62,14 +62,14 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.Main;
import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end
@@ -0,0 +0,0 @@ import org.bukkit.event.server.ServerLoadEvent;
import co.aikar.timings.MinecraftTimings; // Paper
+import io.papermc.paper.util.PaperJvmChecker; // Paper
import org.spigotmc.SlackActivityAccountant; // Spigot
+import io.papermc.paper.util.PaperJvmChecker; // Paper
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
LOGGER.info("Done ({})! For help, type \"help\"", doneTime);
// Paper end

View File

@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@@ -0,0 +0,0 @@ import com.mojang.serialization.Lifecycle;
import com.google.common.collect.ImmutableSet;
// import jline.console.ConsoleReader; // Paper
import joptsimple.OptionSet;
@ -56,12 +56,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-import org.bukkit.craftbukkit.Main;
import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end
import co.aikar.timings.MinecraftTimings; // Paper
import org.spigotmc.SlackActivityAccountant; // Spigot
import io.papermc.paper.util.PaperJvmChecker; // Paper
+import io.papermc.paper.event.server.ServerResourcesReloadedEvent; // Paper
import org.spigotmc.SlackActivityAccountant; // Spigot
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
return this.customFunctionData;
}

View File

@ -41,7 +41,7 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ import com.mojang.serialization.Lifecycle;
@@ -0,0 +0,0 @@ import com.mojang.datafixers.DataFixer;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.buffer.Unpooled;

View File

@ -159,7 +159,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
+
// Spigot start
private final Spigot spigot = new Spigot()
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View File

@ -33,9 +33,9 @@ diff --git a/src/main/java/net/minecraft/server/CommandListenerWrapper.java b/sr
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/CommandListenerWrapper.java
+++ b/src/main/java/net/minecraft/server/CommandListenerWrapper.java
@@ -0,0 +0,0 @@ import java.util.function.BinaryOperator;
import java.util.stream.Stream;
import javax.annotation.Nullable;
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
import com.mojang.brigadier.tree.CommandNode; // CraftBukkit
-public class CommandListenerWrapper implements ICompletionProvider {
+public class CommandListenerWrapper implements ICompletionProvider, com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource { // Paper

View File

@ -900,9 +900,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry;
import it.unimi.dsi.fastutil.longs.LongIterator;
@@ -0,0 +0,0 @@ import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.logging.log4j.LogManager;
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.entity.Player; // CraftBukkit
+import org.spigotmc.AsyncCatcher;

View File

@ -81,9 +81,9 @@ diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -0,0 +0,0 @@ import java.util.Objects;
import java.util.UUID;
@@ -0,0 +0,0 @@ import java.util.UUID;
import javax.annotation.Nullable;
// CraftBukkit start
+import org.bukkit.Material; // Paper
import org.bukkit.event.entity.EntityPickupItemEvent;

View File

@ -14,9 +14,9 @@ diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/mai
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java
+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java
@@ -0,0 +0,0 @@ import java.util.List;
import java.util.Map;
@@ -0,0 +0,0 @@ import java.util.Map;
import javax.annotation.Nullable;
// CraftBukkit start
+import java.util.List;
import org.bukkit.craftbukkit.block.CraftBlock;

View File

@ -669,7 +669,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end - per player view distance
+
// Spigot start
private final Spigot spigot = new Spigot()
private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
{
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644

View File

@ -92,8 +92,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import com.google.common.base.Preconditions;
import net.minecraft.server.EntityLlama;
import org.bukkit.craftbukkit.CraftServer;
@@ -0,0 +0,0 @@ import org.bukkit.entity.Horse;
import org.bukkit.entity.Llama;
@@ -0,0 +0,0 @@ import org.bukkit.entity.Llama;
import org.bukkit.entity.Llama.Color;
import org.bukkit.inventory.LlamaInventory;
-public class CraftLlama extends CraftChestedHorse implements Llama {
@ -153,6 +153,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Skeleton.SkeletonType;
-public class CraftSkeleton extends CraftMonster implements Skeleton {
+public class CraftSkeleton extends CraftMonster implements Skeleton, CraftRangedEntity<EntitySkeletonAbstract> { // Paper

View File

@ -8,10 +8,10 @@ diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/EntitySlime.java
+++ b/src/main/java/net/minecraft/server/EntitySlime.java
@@ -0,0 +0,0 @@ import java.util.Objects;
import java.util.Optional;
@@ -0,0 +0,0 @@ import java.util.Optional;
import java.util.Random;
import javax.annotation.Nullable;
+// Paper start
+import com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent;
+import com.destroystokyo.paper.event.entity.SlimeSwimEvent;

View File

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - move logic in Entity to here, to use bukkit supplied world UUID.
+ if (nbttagcompound != null && nbttagcompound.hasKey("WorldUUIDMost") && nbttagcompound.hasKey("WorldUUIDLeast")) {
+ UUID uid = new UUID(nbttagcompound.getLong("WorldUUIDMost"), nbttagcompound.getLong("WorldUUIDLeast"));
+ org.bukkit.World bWorld = Bukkit.getServer().getWorld(uid);
+ org.bukkit.World bWorld = org.bukkit.Bukkit.getServer().getWorld(uid);
+ if (bWorld != null) {
+ resourcekey = ((CraftWorld) bWorld).getHandle().getDimensionKey();
+ } else {

View File

@ -1176,10 +1176,10 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.Main;
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.Main;
import org.bukkit.event.server.ServerLoadEvent;
// CraftBukkit end
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
+import co.aikar.timings.MinecraftTimings; // Paper
import org.spigotmc.SlackActivityAccountant; // Spigot
@ -1620,11 +1620,10 @@ diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry;
import org.bukkit.inventory.InventoryHolder;
@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
-import org.spigotmc.CustomTimingsHandler; // Spigot
import org.spigotmc.CustomTimingsHandler; // Spigot
+import co.aikar.timings.MinecraftTimings; // Paper
+import co.aikar.timings.Timing; // Paper
@ -1814,7 +1813,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
private final Spigot spigot = new Spigot()
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{
+ @Deprecated
@ -2121,13 +2120,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitTask;
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
-import org.spigotmc.CustomTimingsHandler; // Spigot
import org.spigotmc.CustomTimingsHandler; // Spigot
+import co.aikar.timings.MinecraftTimings; // Paper
+import co.aikar.timings.Timing; // Paper
public class CraftTask implements BukkitTask, Runnable { // Spigot
@@ -0,0 +0,0 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot
*/
private volatile long period;

View File

@ -189,9 +189,9 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
// CraftBukkit start
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle;
import com.google.common.collect.ImmutableSet;
-import jline.console.ConsoleReader;
+// import jline.console.ConsoleReader; // Paper

@ -1 +1 @@
Subproject commit 9d0ad3184ec89c61eecd7a1234005391fee66297
Subproject commit d264e972e9fecfea2f4a016c5d89ab8611680eb3

@ -1 +1 @@
Subproject commit a021e334aa342a60945b330d11b7dbd5d0fff017
Subproject commit ee5006d1873170ce1ad908455f680b228096da87

@ -1 +1 @@
Subproject commit db99f82161b38f74d56351b3f941d4fb42bfa588
Subproject commit bff526193eec525c624bf7e65f8a5239866bfcbf