Update upstream (Bukkit/CraftBukkit/Spigot) (#10875)
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: 376e37db SPIGOT-7677: Update which entities are marked as spawnable 06c4add3 SPIGOT-7737: Add separate TreeType.MEGA_PINE 19b7caaa SPIGOT-7731: Spawn eggs cannot have damage e585297e PR-1022: Add force option to Player#spawnParticle d26e0094 PR-1018: Add methods to get players seeing specific chunks 8df1ed18 PR-978: Add Material#isCompostable and Material#getCompostChance 4b9b59c7 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale 8d1e700a PR-1020: Cast instead of using #typed when getting BlockType and ItemType to better work with testing / mocks fa28607a PR-1016: Fix incorrect assumption of Fireball having constant speed 4c6c8586 PR-1015: Add a tool component to ItemMeta 6f6b2123 PR-1014: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects f511cfe1 PR-1013, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType def44cbf SPIGOT-7669: Fix typo in ProjectileHitEvent#getHitBlockFace documentation 53fa4f72 PR-1011: Throw an exception if a RecipeChoice is ever supplied air CraftBukkit Changes: ee95e171a SPIGOT-7737: Add separate TreeType.MEGA_PINE 0dae4c62c Fix spawn egg equality check and copy constructor ab59e847c Fix spawn eggs with no entity creating invalid stacks and disconnect creative clients 3b6093b28 SPIGOT-7736: Creative spawn egg use loses components c6b4d5a87 SPIGOT-7731: Spawn eggs cannot have damage 340ccd57f SPIGOT-7735: Fix serialization of player heads with note block sound fd2f41834 SPIGOT-7734: Can't register a custom advancement using unsafe() 02456e2a5 PR-1413: Add force option to Player#spawnParticle 6a61f38b2 SPIGOT-7680: Per-world weather command 58c41cebb PR-1409: Add methods to get players seeing specific chunks 16c976797 PR-1412: Fix shipwreck loot tables not being set for BlockTransformers 7189ba636 PR-1360: Add Material#isCompostable and Material#getCompostChance 900384556 SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale bdb40c5f1 Increase outdated build delay d6607c7dd SPIGOT-7675: Fix FoodComponent config deserialization b148ed332 PR-1406: Fix incorrect assumption of Fireball having constant speed 3ec31ca75 PR-1405: Add a tool component to ItemMeta 5d7d675b9 PR-1404: Add PotionEffectTypeCategory to distinguish between beneficial and harmful effects 960827981 PR-1403, SPIGOT-4288, SPIGOT-6202: Add material rerouting in preparation for the switch to ItemType and BlockType 94e44ec93 PR-1401: Add a config option to accept old keys in registry get calls a43701920 PR-1402: Fix ChunkSnapshot#isSectionEmpty() is always false 87d0a3368 SPIGOT-7668: Move NONE Registry updater to FieldRename to avoid some class loader issues 2ea1e7ac2 PR-1399: Fix regression preventing positive .setDamage value from causing knockback for 0 damage events ba2d49d21 Increase outdated build delay Spigot Changes: fcd94e21 Rebuild patches 342f4939 SPIGOT-7661: Add experimental unload-frozen-chunks option
This commit is contained in:
parent
5df0660d63
commit
b52915b54e
42 changed files with 276 additions and 164 deletions
|
@ -36,6 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import java.util.function.Predicate;
|
||||
+import java.util.stream.Collectors;
|
||||
+import java.util.stream.Stream;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
|
@ -83,12 +84,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ @ApiStatus.Internal
|
||||
+ protected Set<Material> getAllPossibleValues() {
|
||||
+ return Stream.of(Material.values()).collect(Collectors.toSet());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ @ApiStatus.Internal
|
||||
+ protected String getName(@NotNull Material value) {
|
||||
+ return value.name();
|
||||
+ }
|
||||
|
@ -849,6 +852,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+import org.bukkit.Keyed;
|
||||
+import org.bukkit.NamespacedKey;
|
||||
+import org.bukkit.Tag;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+import java.util.Collection;
|
||||
|
@ -1018,9 +1022,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @ApiStatus.Internal
|
||||
+ protected abstract Set<T> getAllPossibleValues();
|
||||
+
|
||||
+ @NotNull
|
||||
+ @ApiStatus.Internal
|
||||
+ protected abstract String getName(@NotNull T value);
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/tag/EntitySetTag.java b/src/main/java/io/papermc/paper/tag/EntitySetTag.java
|
||||
|
|
|
@ -376,12 +376,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
when(instance.getBukkitVersion()).thenReturn("BukkitVersion_" + TestServer.class.getPackage().getImplementationVersion());
|
||||
|
||||
- Map<Class<? extends Keyed>, Registry<?>> registers = new HashMap<>();
|
||||
- when(instance.getRegistry(any())).then(invocationOnMock -> registers.computeIfAbsent(invocationOnMock.getArgument(0), aClass -> new Registry<Keyed>() {
|
||||
- when(instance.getRegistry(any())).then(invocationOnMock -> registers.computeIfAbsent(invocationOnMock.getArgument(0), aClass -> new Registry<>() {
|
||||
- private final Map<NamespacedKey, Keyed> cache = new HashMap<>();
|
||||
-
|
||||
- @Override
|
||||
- public Keyed get(NamespacedKey key) {
|
||||
- return cache.computeIfAbsent(key, key2 -> mock(aClass, withSettings().stubOnly()));
|
||||
- Class<? extends Keyed> theClass;
|
||||
- // Some registries have extra Typed classes such as BlockType and ItemType.
|
||||
- // To avoid class cast exceptions during init mock the Typed class.
|
||||
- // To get the correct class, we just use the field type.
|
||||
- try {
|
||||
- theClass = (Class<? extends Keyed>) aClass.getField(key.getKey().toUpperCase(Locale.ROOT).replace('.', '_')).getType();
|
||||
- } catch (ClassCastException | NoSuchFieldException e) {
|
||||
- throw new RuntimeException(e);
|
||||
- }
|
||||
-
|
||||
- return cache.computeIfAbsent(key, key2 -> mock(theClass, withSettings().stubOnly()));
|
||||
- }
|
||||
-
|
||||
- @NotNull
|
||||
|
|
|
@ -872,7 +872,7 @@ diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java b
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.event.block.BlockExpEvent;
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
|
|
|
@ -497,51 +497,30 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/entity/Fireball.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Fireball.java
|
||||
@@ -0,0 +0,0 @@ public interface Fireball extends Projectile, Explosive {
|
||||
* Sets the direction the fireball should be flying towards.
|
||||
* The direction vector will be normalized and the default speed will be applied.
|
||||
* <br>
|
||||
- * To also change the speed of the fireball, use {@link #setVelocity(Vector)}.
|
||||
+ * To also change the acceleration of the fireball, use {@link #setPower(Vector)}.
|
||||
* <b>Note:</b> that the client may not respect non-default speeds and will therefore
|
||||
* mispredict the location of the fireball, causing visual stutter.
|
||||
* <br>
|
||||
- * <b>Also Note:</b> that this method and {@link #setVelocity(Vector)} will override each other.
|
||||
+ * <b>Also Note:</b> that this method and {@link #setPower(Vector)} will override each other.
|
||||
*
|
||||
* @param direction the direction this fireball should be flying towards
|
||||
* @see #setVelocity(Vector)
|
||||
@@ -0,0 +0,0 @@ public interface Fireball extends Projectile, Explosive {
|
||||
*/
|
||||
@NotNull
|
||||
public Vector getDirection();
|
||||
|
||||
+ // Paper start - Expose power on fireball projectiles
|
||||
+ /**
|
||||
+ * {@inheritDoc}
|
||||
+ * <p>
|
||||
+ * Note: For fireball entities, their movement is also controlled by their power.
|
||||
+ *
|
||||
+ * @param velocity New velocity to travel with
|
||||
+ * @see #setPower(Vector)
|
||||
+ */
|
||||
+ @Override
|
||||
+ public void setVelocity(@NotNull Vector velocity);
|
||||
Vector getAcceleration();
|
||||
+
|
||||
+ // Paper start - Expose power on fireball projectiles
|
||||
+ /**
|
||||
+ * Sets the power of a fireball. The power determines the direction and magnitude of its acceleration.
|
||||
+ *
|
||||
+ * @param power the power
|
||||
+ * @deprecated use #setAcceleration(Vector) instead.
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ public void setPower(@NotNull Vector power);
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the power of a fireball. The power determines the direction and magnitude of its acceleration.
|
||||
+ *
|
||||
+ * @return the power
|
||||
+ * @deprecated Use #getAcceleration instead.
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ @NotNull
|
||||
+ public Vector getPower();
|
||||
+ // Paper end - Expose power on fireball projectiles
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Fox.java b/src/main/java/org/bukkit/entity/Fox.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
|
|
@ -1743,7 +1743,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Nullable
|
||||
public Permission getPermission(@NotNull String name) {
|
||||
+ if (true) {return this.paperPluginManager.getPermission(name);} // Paper
|
||||
return permissions.get(name.toLowerCase(java.util.Locale.ENGLISH));
|
||||
return permissions.get(name.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1755,7 +1755,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Deprecated
|
||||
public void addPermission(@NotNull Permission perm, boolean dirty) {
|
||||
+ if (true) {this.paperPluginManager.addPermission(perm); return;} // Paper - This just has a performance implication, use the better api to avoid this.
|
||||
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
|
||||
String name = perm.getName().toLowerCase(Locale.ROOT);
|
||||
|
||||
if (permissions.containsKey(name)) {
|
||||
@@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
@ -1775,13 +1775,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public void removePermission(@NotNull String name) {
|
||||
+ if (true) {this.paperPluginManager.removePermission(name); return;} // Paper
|
||||
permissions.remove(name.toLowerCase(java.util.Locale.ENGLISH));
|
||||
permissions.remove(name.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recalculatePermissionDefaults(@NotNull Permission perm) {
|
||||
+ if (true) {this.paperPluginManager.recalculatePermissionDefaults(perm); return;} // Paper
|
||||
if (perm != null && permissions.containsKey(perm.getName().toLowerCase(java.util.Locale.ENGLISH))) {
|
||||
if (perm != null && permissions.containsKey(perm.getName().toLowerCase(Locale.ROOT))) {
|
||||
defaultPerms.get(true).remove(perm);
|
||||
defaultPerms.get(false).remove(perm);
|
||||
@@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
@ -1789,7 +1789,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public void subscribeToPermission(@NotNull String permission, @NotNull Permissible permissible) {
|
||||
+ if (true) {this.paperPluginManager.subscribeToPermission(permission, permissible); return;} // Paper
|
||||
String name = permission.toLowerCase(java.util.Locale.ENGLISH);
|
||||
String name = permission.toLowerCase(Locale.ROOT);
|
||||
Map<Permissible, Boolean> map = permSubs.get(name);
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
@ -1797,7 +1797,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public void unsubscribeFromPermission(@NotNull String permission, @NotNull Permissible permissible) {
|
||||
+ if (true) {this.paperPluginManager.unsubscribeFromPermission(permission, permissible); return;} // Paper
|
||||
String name = permission.toLowerCase(java.util.Locale.ENGLISH);
|
||||
String name = permission.toLowerCase(Locale.ROOT);
|
||||
Map<Permissible, Boolean> map = permSubs.get(name);
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
@ -1805,7 +1805,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@NotNull
|
||||
public Set<Permissible> getPermissionSubscriptions(@NotNull String permission) {
|
||||
+ if (true) {return this.paperPluginManager.getPermissionSubscriptions(permission);} // Paper
|
||||
String name = permission.toLowerCase(java.util.Locale.ENGLISH);
|
||||
String name = permission.toLowerCase(Locale.ROOT);
|
||||
Map<Permissible, Boolean> map = permSubs.get(name);
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
|
|
@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java
|
||||
@@ -0,0 +0,0 @@ public class PermissibleBase implements Permissible {
|
||||
|
||||
String name = inName.toLowerCase(java.util.Locale.ENGLISH);
|
||||
String name = inName.toLowerCase(Locale.ROOT);
|
||||
|
||||
- if (isPermissionSet(name)) {
|
||||
- return permissions.get(name).getValue();
|
||||
|
@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
@@ -0,0 +0,0 @@ public class PermissibleBase implements Permissible {
|
||||
|
||||
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
|
||||
String name = perm.getName().toLowerCase(Locale.ROOT);
|
||||
|
||||
- if (isPermissionSet(name)) {
|
||||
- return permissions.get(name).getValue();
|
||||
|
|
|
@ -874,17 +874,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ }
|
||||
+ ),
|
||||
+ toObjectMapper(input.tileEntityCounts.entrySet(),
|
||||
+ new Function<Map.Entry<Material, Counter>, JSONPair>() {
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public JSONPair apply(Map.Entry<Material, Counter> entry) {
|
||||
+ tileEntityTypeSet.add(entry.getKey());
|
||||
+ return pair(
|
||||
+ String.valueOf(entry.getKey().ordinal()),
|
||||
+ entry.getValue().count()
|
||||
+ );
|
||||
+ }
|
||||
+ toObjectMapper(
|
||||
+ input.tileEntityCounts.entrySet(),
|
||||
+ entry -> {
|
||||
+ tileEntityTypeSet.add(entry.getKey());
|
||||
+ return pair(
|
||||
+ String.valueOf(entry.getKey().ordinal()),
|
||||
+ entry.getValue().count()
|
||||
+ );
|
||||
+ }
|
||||
+ )
|
||||
+ );
|
||||
|
@ -3168,8 +3165,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
|
||||
+ command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper
|
||||
label = label.toLowerCase(java.util.Locale.ENGLISH).trim();
|
||||
fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim();
|
||||
label = label.toLowerCase(Locale.ROOT).trim();
|
||||
fallbackPrefix = fallbackPrefix.toLowerCase(Locale.ROOT).trim();
|
||||
boolean registered = register(label, command, false, fallbackPrefix);
|
||||
@@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue