Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appears 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:
fe0cadf0 Add BlockShearEntityEvent for Dispensers shearing Sheep
90e5cca3 SPIGOT-4892: Allow to set the currently viewed page of a book on a lectern inventory
a30337f7 SPIGOT-4887: Villager level minimum is 1
d88d828c SPIGOT-4886: Villager type SNOWY should be named SNOW

CraftBukkit Changes:
6ceffb0d SPIGOT-4895: Bed doesn't explode in Nether and The End
ee881847 SPIGOT-4888: setSleepingIgnored resets the night even when there is no one in a bed
15e02b40 SPIGOT-4890: EntityDeathEvent fires twice when breaking an armor stand in survival mode
b38a3c33 Add BlockShearEntityEvent for Dispensers shearing Sheep
70ebefca SPIGOT-4891: LecternInventory.getType() should return InventoryType.LECTERN
0036d1b7 SPIGOT-4887: Villager level minimum is 1
This commit is contained in:
Shane Freeder 2019-05-09 08:20:01 +01:00
parent 8191255cfa
commit 7f9b65035a
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C
9 changed files with 56 additions and 43 deletions

View file

@ -1,4 +1,4 @@
From b61f88251146a6769329d7ce7d1188f6dbd9e076 Mon Sep 17 00:00:00 2001
From 102438c9e61363d4cdc0d5c7330c1383523ebc4b Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 19 Jul 2018 15:07:02 -0500
Subject: [PATCH] Add an asterisk to legacy API plugins
@ -7,7 +7,7 @@ Not here to name and shame, only so server admins can be aware of which
plugins have and haven't been updated.
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 72c5501e..71da4a79 100644
index 72c5501e..9e96e12c 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -76,5 +76,9 @@ public interface UnsafeValues {
@ -16,7 +16,7 @@ index 72c5501e..71da4a79 100644
String getTimingsServerName();
+
+ static boolean isLegacyPlugin(org.bukkit.plugin.Plugin plugin) {
+ return !"1.13".equals(plugin.getDescription().getAPIVersion()) && !"1.14".equals(plugin.getDescription().getAPIVersion());
+ return !("1.13".equals(plugin.getDescription().getAPIVersion()));
+ }
// Paper end
}

View file

@ -1,4 +1,4 @@
From 5f483e81347904f34054cde2b04bc116ddddd96b Mon Sep 17 00:00:00 2001
From 7d25bb0ecc3aabf4ae91d312e4dbdd10639f862e Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 29 Feb 2016 21:02:09 -0600
Subject: [PATCH] Paper config files
@ -6,7 +6,7 @@ Subject: [PATCH] Paper config files
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
new file mode 100644
index 0000000000..b5f318c00d
index 000000000..841edd010
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -0,0 +1,241 @@
@ -185,7 +185,7 @@ index 0000000000..b5f318c00d
+ }
+ WorldServer world = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle();
+
+ Collection<Entity> entities = world.entitiesById.values();
+ List<Entity> entities = world.globalEntityList;
+ entities.forEach(e -> {
+ MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch
+
@ -253,7 +253,7 @@ index 0000000000..b5f318c00d
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
new file mode 100644
index 0000000000..db79fe41b9
index 000000000..db79fe41b
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -0,0 +1,184 @@
@ -443,7 +443,7 @@ index 0000000000..db79fe41b9
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
new file mode 100644
index 0000000000..a738657394
index 000000000..a73865739
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -0,0 +1,67 @@
@ -515,7 +515,7 @@ index 0000000000..a738657394
+ }
+}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index e1ba833f3e..b60956218d 100644
index e1ba833f3..b60956218 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -152,6 +152,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@ -535,7 +535,7 @@ index e1ba833f3e..b60956218d 100644
this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals);
this.setSpawnNPCs(dedicatedserverproperties.spawnNpcs);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index fd8397bd4d..77015bc06e 100644
index fd8397bd4..77015bc06 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -134,9 +134,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener {
@ -552,7 +552,7 @@ index fd8397bd4d..77015bc06e 100644
public boolean impulse;
public int portalCooldown;
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index ee43aa24d2..01d9ed69c5 100644
index ee43aa24d..01d9ed69c 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -4,6 +4,7 @@ import com.mojang.datafixers.DataFixUtils;
@ -575,7 +575,7 @@ index ee43aa24d2..01d9ed69c5 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 84155573df..83fdea893c 100644
index 84155573d..83fdea893 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -86,6 +86,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@ -596,7 +596,7 @@ index 84155573df..83fdea893c 100644
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index be03fe24b8..5dc2bb1246 100644
index be03fe24b..5dc2bb124 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -751,6 +751,7 @@ public final class CraftServer implements Server {
@ -651,7 +651,7 @@ index be03fe24b8..5dc2bb1246 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index e17d914185..f406464ef8 100644
index e17d91418..f406464ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -128,6 +128,14 @@ public class Main {
@ -670,7 +670,7 @@ index e17d914185..f406464ef8 100644
};
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 6bceeb120b..9a51c0ef7a 100644
index 6bceeb120..9a51c0ef7 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -39,36 +39,36 @@ public class SpigotWorldConfig

View file

@ -1,4 +1,4 @@
From 4389a6628764d5dbda0afbbe6685f083d7490ef5 Mon Sep 17 00:00:00 2001
From 07c7a3d3c3d22facfc87700a4e70ba5a763336a5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 01:40:13 -0400
Subject: [PATCH] Add MinecraftKey Information to Objects
@ -6,12 +6,12 @@ Subject: [PATCH] Add MinecraftKey Information to Objects
Stores the reference to the objects respective MinecraftKey
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index b5f318c00d..ce190d88d6 100644
index 841edd010..3354fdd60 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -175,7 +175,7 @@ public class PaperCommand extends Command {
Collection<Entity> entities = world.entitiesById.values();
List<Entity> entities = world.globalEntityList;
entities.forEach(e -> {
- MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch
+ MinecraftKey key = e.getMinecraftKey();
@ -19,7 +19,7 @@ index b5f318c00d..ce190d88d6 100644
MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ());
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 77015bc06e..01e4863899 100644
index 77015bc06..01e486389 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -49,7 +49,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
@ -65,7 +65,7 @@ index 77015bc06e..01e4863899 100644
protected abstract void a(NBTTagCompound nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 3217a8ed18..c7fb8f513b 100644
index 3217a8ed1..c7fb8f513 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -238,6 +238,7 @@ public class EntityTypes<T extends Entity> {
@ -78,7 +78,7 @@ index 3217a8ed18..c7fb8f513b 100644
}
diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java
new file mode 100644
index 0000000000..743142d030
index 000000000..743142d03
--- /dev/null
+++ b/src/main/java/net/minecraft/server/KeyedObject.java
@@ -0,0 +1,9 @@
@ -92,7 +92,7 @@ index 0000000000..743142d030
+ }
+}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 080fd819b6..77d77fcb8b 100644
index 080fd819b..77d77fcb8 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -10,7 +10,7 @@ import org.bukkit.inventory.InventoryHolder;

View file

@ -1,11 +1,11 @@
From e1a693bed3d52e7114065c979613eb0b8323ec0f Mon Sep 17 00:00:00 2001
From 5fe55301db1583c6c925e28bd39a3672471539ea Mon Sep 17 00:00:00 2001
From: AlphaBlend <whizkid3000@hotmail.com>
Date: Thu, 8 Sep 2016 08:48:33 -0700
Subject: [PATCH] Add source to PlayerExpChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
index b20813be64..bfba08fb24 100644
index b20813be6..bfba08fb2 100644
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
@@ -190,7 +190,7 @@ public class EntityExperienceOrb extends Entity {
@ -18,10 +18,10 @@ index b20813be64..bfba08fb24 100644
this.die();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 1632969249..451d4f030c 100644
index e67b4cbac..0441afce9 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -101,6 +101,7 @@ import org.bukkit.entity.Projectile;
@@ -102,6 +102,7 @@ import org.bukkit.entity.Sheep;
import org.bukkit.entity.ThrownExpBottle;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.entity.Vehicle;

View file

@ -1,4 +1,4 @@
From 4ef25893309e1d6628834e36eaeedc142f64bc21 Mon Sep 17 00:00:00 2001
From 2c7c11780055e40e42eae8b6d6a5ab2f578bc92a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 7 Jan 2017 15:24:46 -0500
Subject: [PATCH] Provide E/TE/Chunk count stat methods
@ -6,8 +6,21 @@ Subject: [PATCH] Provide E/TE/Chunk count stat methods
Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ff75bb3c6..5ed0fbe5a 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -51,7 +51,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
public class WorldServer extends World {
private static final Logger LOGGER = LogManager.getLogger();
- private final List<Entity> globalEntityList = Lists.newArrayList();
+ public final List<Entity> globalEntityList = Lists.newArrayList(); // Paper - private -> public
public final Int2ObjectMap<Entity> entitiesById = new Int2ObjectLinkedOpenHashMap();
private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap();
private final Queue<Entity> entitiesToAdd = Queues.newArrayDeque();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index b8de760079..b3a77ec3c5 100644
index b8de76007..c79b0f42a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -265,6 +265,35 @@ public class CraftWorld implements World {
@ -17,7 +30,7 @@ index b8de760079..b3a77ec3c5 100644
+ // Paper start - Provide fast information methods
+ // TODO review these changes
+ public int getEntityCount() {
+ return world.entitiesById.size();
+ return world.globalEntityList.size();
+ }
+ public int getTileEntityCount() {
+ // We don't use the full world tile entity list, so we must iterate chunks

View file

@ -1,4 +1,4 @@
From 1c457fce53a45ff0246f01e6902749c035cbff96 Mon Sep 17 00:00:00 2001
From c7413121c172b4ff0a9da568223125f9f12bf5fb Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 28 Jul 2018 12:18:27 -0400
Subject: [PATCH] Ignore Dead Entities in entityList iteration
@ -11,11 +11,11 @@ This will ensure that dead entities are skipped from iteration since
they shouldn't of been in the list in the first place.
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
index ce190d88d6..352a39dcb3 100644
index 3354fdd60..ab0910454 100644
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -176,6 +176,7 @@ public class PaperCommand extends Command {
Collection<Entity> entities = world.entitiesById.values();
List<Entity> entities = world.globalEntityList;
entities.forEach(e -> {
MinecraftKey key = e.getMinecraftKey();
+ if (e.shouldBeRemoved) return; // Paper
@ -23,7 +23,7 @@ index ce190d88d6..352a39dcb3 100644
MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ());
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d787a4ab30..d313b9b3ca 100644
index d787a4ab3..d313b9b3c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -642,6 +642,7 @@ public class Chunk implements IChunkAccess {
@ -51,7 +51,7 @@ index d787a4ab30..d313b9b3ca 100644
if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check
list.add(t0);
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f8e837faec..aac0146fd2 100644
index f8e837fae..aac0146fd 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -126,6 +126,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -63,7 +63,7 @@ index f8e837faec..aac0146fd2 100644
private float av;
private float aw;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index d9f8223fec..fc04e736a4 100644
index 402aac677..219c71ff6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -843,6 +843,7 @@ public class WorldServer extends World {
@ -91,7 +91,7 @@ index d9f8223fec..fc04e736a4 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 19fa15d793..79a5adf482 100644
index 209e72648..3b0f9c86f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -864,6 +864,7 @@ public class CraftWorld implements World {

View file

@ -1,14 +1,14 @@
From 6e8e4cc4a23eb58b2f6e536c04485d4b9874d97b Mon Sep 17 00:00:00 2001
From 740e7b87b8504cf3086a7c636e45990e6cc20b13 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 28 Aug 2018 23:04:15 -0400
Subject: [PATCH] Inventory#removeItemAnySlot
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index 9fbedcede8..b7e08b55f9 100644
index 7e0a20d1d..c3516de7f 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -224,10 +224,16 @@ public class CraftInventory implements Inventory {
@@ -223,10 +223,16 @@ public class CraftInventory implements Inventory {
}
private int first(ItemStack item, boolean withAmount) {
@ -26,7 +26,7 @@ index 9fbedcede8..b7e08b55f9 100644
for (int i = 0; i < inventory.length; i++) {
if (inventory[i] == null) continue;
@@ -345,6 +351,17 @@ public class CraftInventory implements Inventory {
@@ -344,6 +350,17 @@ public class CraftInventory implements Inventory {
@Override
public HashMap<Integer, ItemStack> removeItem(ItemStack... items) {
@ -44,7 +44,7 @@ index 9fbedcede8..b7e08b55f9 100644
Validate.notNull(items, "Items cannot be null");
HashMap<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@@ -355,7 +372,10 @@ public class CraftInventory implements Inventory {
@@ -354,7 +371,10 @@ public class CraftInventory implements Inventory {
int toDelete = item.getAmount();
while (true) {

@ -1 +1 @@
Subproject commit 91b0487aed3000a9db40120e8c7c5605c28d1d51
Subproject commit fe0cadf0559d68852de1122f4c5e31f9bd4d4cef

@ -1 +1 @@
Subproject commit d20328368cdc37b8b0ef563b97192e22a13126d1
Subproject commit 6ceffb0d2aa1d4118b70274c5b7603fb2e32ab35