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

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:
8d818032 PR-723: Add Furnace#getRecipesUsed
d7b5a313 PR-726: Add Particle dataTypes to javadocs
72fe8b71 PR-724: Add PDC to World

CraftBukkit Changes:
c0326c28 PR-1009: Add Furnace#getRecipesUsed
cc5ddd79 PR-1010: Add PDC to World
6a54e5d3 PR-1012: Always save as skull owner and not as internal data

Spigot Changes:
699290cd Rebuild patches
This commit is contained in:
Nassim Jahnke
2022-02-15 11:30:58 +01:00
parent d2bb62d3f5
commit 2f49bcb7a2
14 changed files with 26 additions and 47 deletions

View File

@@ -1140,8 +1140,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
* Represents a world, which may contain entities, chunks and blocks * Represents a world, which may contain entities, chunks and blocks
*/ */
-public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable { -public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder {
+public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience { // Paper +public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience { // Paper
/** /**
* Gets the {@link Block} at the given coordinates * Gets the {@link Block} at the given coordinates

View File

@@ -57,8 +57,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
* Represents a world, which may contain entities, chunks and blocks * Represents a world, which may contain entities, chunks and blocks
*/ */
-public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience { // Paper -public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience { // Paper
+public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience, Keyed { // Paper +public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience, Keyed { // Paper
// Paper start // Paper start
/** /**

View File

@@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/block/Furnace.java --- a/src/main/java/org/bukkit/block/Furnace.java
+++ b/src/main/java/org/bukkit/block/Furnace.java +++ b/src/main/java/org/bukkit/block/Furnace.java
@@ -0,0 +0,0 @@ public interface Furnace extends Container { @@ -0,0 +0,0 @@ public interface Furnace extends Container {
*/ @NotNull
public void setCookTimeTotal(int cookTimeTotal); public Map<CookingRecipe<?>, Integer> getRecipesUsed();
+ // Paper start + // Paper start
+ /** + /**

View File

@@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; @@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
*/ */
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience { // Paper public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience { // Paper
+ // Paper start + // Paper start
+ /** + /**

View File

@@ -51,40 +51,17 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -0,0 +0,0 @@ import com.google.common.collect.ImmutableMap.Builder;
import com.mojang.authlib.GameProfile;
import java.util.Map;
import java.util.UUID;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.nbt.NbtUtils;
-import net.minecraft.nbt.Tag;
-import net.minecraft.world.level.block.entity.SkullBlockEntity;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.profile.PlayerProfile;
+import javax.annotation.Nullable;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.nbt.NbtUtils;
+import net.minecraft.nbt.Tag;
+import net.minecraft.world.level.block.entity.SkullBlockEntity;
@DelegateDeserialization(SerializableMeta.class)
class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -0,0 +0,0 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { @@ -0,0 +0,0 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
return this.hasOwner() ? this.profile.getName() : null; return this.hasOwner() ? this.profile.getName() : null;
} }
+ // Paper start + // Paper start
+ @Override + @Override
+ public void setPlayerProfile(@Nullable com.destroystokyo.paper.profile.PlayerProfile profile) { + public void setPlayerProfile(@org.jetbrains.annotations.Nullable com.destroystokyo.paper.profile.PlayerProfile profile) {
+ setProfile((profile == null) ? null : com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile)); + setProfile((profile == null) ? null : com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile));
+ } + }
+ +
+ @Nullable + @org.jetbrains.annotations.Nullable
+ @Override + @Override
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { + public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return profile != null ? com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(profile) : null; + return profile != null ? com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(profile) : null;
@@ -119,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { @@ -0,0 +0,0 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
Builder<String, Object> serialize(Builder<String, Object> builder) { Builder<String, Object> serialize(Builder<String, Object> builder) {
super.serialize(builder); super.serialize(builder);
if (this.hasOwner()) { if (this.profile != null) {
- return builder.put(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile)); - return builder.put(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile));
+ return builder.put(SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper + return builder.put(SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper
} }

View File

@@ -1844,9 +1844,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
private final List<BlockPopulator> populators = new ArrayList<BlockPopulator>();
private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this); private final BlockMetadataStore blockMetadata = new BlockMetadataStore(this);
private final Object2IntOpenHashMap<SpawnCategory> spawnCategoryLimit = new Object2IntOpenHashMap<>(); private final Object2IntOpenHashMap<SpawnCategory> spawnCategoryLimit = new Object2IntOpenHashMap<>();
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
+ private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers + private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers
private static final Random rand = new Random(); private static final Random rand = new Random();

View File

@@ -3607,8 +3607,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
// Spigot start
@Override @Override
public PersistentDataContainer getPersistentDataContainer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java

View File

@@ -48,4 +48,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
// Paper end // Paper end
// Spigot start @Override

View File

@@ -93,8 +93,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
@@ -0,0 +0,0 @@ public abstract class CraftFurnace<T extends AbstractFurnaceBlockEntity> extends @@ -0,0 +0,0 @@ public abstract class CraftFurnace<T extends AbstractFurnaceBlockEntity> extends
public void setCookTimeTotal(int cookTimeTotal) {
this.getSnapshot().cookingTotalTime = cookTimeTotal; return recipesUsed.build();
} }
+ +
+ // Paper start - cook speed multiplier API + // Paper start - cook speed multiplier API

View File

@@ -10,9 +10,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ import org.bukkit.util.Vector; @@ -0,0 +0,0 @@ import org.bukkit.util.Vector;
public class CraftWorld extends CraftRegionAccessor implements World { public class CraftWorld extends CraftRegionAccessor implements World {
public static final int CUSTOM_DIMENSION_OFFSET = 10; public static final int CUSTOM_DIMENSION_OFFSET = 10;
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
+ private static final ChunkStatus[] REGEN_CHUNK_STATUSES = {ChunkStatus.BIOMES, ChunkStatus.NOISE, ChunkStatus.SURFACE, ChunkStatus.CARVERS, ChunkStatus.LIQUID_CARVERS, ChunkStatus.FEATURES}; // Paper - implement regenerate chunk method + private static final ChunkStatus[] REGEN_CHUNK_STATUSES = {ChunkStatus.BIOMES, ChunkStatus.NOISE, ChunkStatus.SURFACE, ChunkStatus.CARVERS, ChunkStatus.LIQUID_CARVERS, ChunkStatus.FEATURES}; // Paper - implement regenerate chunk method
private final ServerLevel world; private final ServerLevel world;
@@ -25,6 +25,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- /* - /*
- if (!unloadChunk0(x, z, false)) { - if (!unloadChunk0(x, z, false)) {
- return false; - return false;
- }
-
- final long chunkKey = ChunkCoordIntPair.pair(x, z);
- world.getChunkProvider().unloadQueue.remove(chunkKey);
+ // Paper start - implement regenerateChunk method + // Paper start - implement regenerateChunk method
+ final ServerLevel serverLevel = this.world; + final ServerLevel serverLevel = this.world;
+ final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource(); + final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource();
@@ -33,10 +37,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ for (final BlockPos blockPos : BlockPos.betweenClosed(chunkPos.getMinBlockX(), serverLevel.getMinBuildHeight(), chunkPos.getMinBlockZ(), chunkPos.getMaxBlockX(), serverLevel.getMaxBuildHeight() - 1, chunkPos.getMaxBlockZ())) { + for (final BlockPos blockPos : BlockPos.betweenClosed(chunkPos.getMinBlockX(), serverLevel.getMinBuildHeight(), chunkPos.getMinBlockZ(), chunkPos.getMaxBlockX(), serverLevel.getMaxBuildHeight() - 1, chunkPos.getMaxBlockZ())) {
+ levelChunk.removeBlockEntity(blockPos); + levelChunk.removeBlockEntity(blockPos);
+ serverLevel.setBlock(blockPos, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(), 16); + serverLevel.setBlock(blockPos, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState(), 16);
} + }
+
- final long chunkKey = ChunkCoordIntPair.pair(x, z);
- world.getChunkProvider().unloadQueue.remove(chunkKey);
+ for (final ChunkStatus chunkStatus : REGEN_CHUNK_STATUSES) { + for (final ChunkStatus chunkStatus : REGEN_CHUNK_STATUSES) {
+ final List<ChunkAccess> list = new ArrayList<>(); + final List<ChunkAccess> list = new ArrayList<>();
+ final int range = Math.max(1, chunkStatus.getRange()); + final int range = Math.max(1, chunkStatus.getRange());

View File

@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
private final Object2IntOpenHashMap<SpawnCategory> spawnCategoryLimit = new Object2IntOpenHashMap<>(); private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftWorld.DATA_TYPE_REGISTRY);
private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers
+ // Paper start - Provide fast information methods + // Paper start - Provide fast information methods