13
0
geforkt von Mirrors/Paper

Updated Upstream (Bukkit/CraftBukkit/Spigot)

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:
9ae3f10f SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API
48c0c547 PR-786: Add methods to get sounds from entities

CraftBukkit Changes:
5cc9c022a SPIGOT-7152: Handle hand item changing during air interact event
4ffa1acf6 SPIGOT-7154: Players get kicked when interacting with a conversation
4daa21123 SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API
e5d6a9bbf PR-1100: Add methods to get sounds from entities
b7e9f1c8b SPIGOT-7146: Reduce use of Material switch in ItemMeta

Spigot Changes:
4c157bb4 Rebuild patches
Dieser Commit ist enthalten in:
Nassim Jahnke 2022-09-12 13:31:45 +02:00
Ursprung d1129b0ded
Commit 39ae9b75e9
16 geänderte Dateien mit 75 neuen und 79 gelöschten Zeilen

Datei anzeigen

@ -20,9 +20,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public java.util.UUID getSpawningEntity(); + public java.util.UUID getSpawningEntity();
+ /** + /**
+ * If this firework is boosting an entity, return it + * If this firework is boosting an entity, return it
+ * @deprecated use {@link #getAttachedTo()}
+ * @see #setAttachedTo(LivingEntity)
+ * @return The entity being boosted + * @return The entity being boosted
+ */ + */
+ @org.jetbrains.annotations.Nullable + @org.jetbrains.annotations.Nullable
+ public LivingEntity getBoostedEntity(); + @Deprecated
+ default LivingEntity getBoostedEntity() {
+ return getAttachedTo();
+ }
+ // Paper end + // Paper end
} }

Datei anzeigen

@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/Mob.java --- a/src/main/java/org/bukkit/entity/Mob.java
+++ b/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java
@@ -0,0 +0,0 @@ public interface Mob extends LivingEntity, Lootable { @@ -0,0 +0,0 @@ public interface Mob extends LivingEntity, Lootable {
* @return whether the mob is aware
*/ */
public boolean isAware(); @Nullable
public Sound getAmbientSound();
+ +
+ // Paper start + // Paper start
+ /** + /**

Datei anzeigen

@ -424,9 +424,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/Raider.java --- a/src/main/java/org/bukkit/entity/Raider.java
+++ b/src/main/java/org/bukkit/entity/Raider.java +++ b/src/main/java/org/bukkit/entity/Raider.java
@@ -0,0 +0,0 @@ public interface Raider extends Monster { @@ -0,0 +0,0 @@ public interface Raider extends Monster {
* @param join CanJoinRaid status
*/ */
void setCanJoinRaid(boolean join); @NotNull
Sound getCelebrationSound();
+ +
+ // Paper start + // Paper start
+ /** + /**

Datei anzeigen

@ -233,9 +233,9 @@ diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Mob.java --- a/src/main/java/org/bukkit/entity/Mob.java
+++ b/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@ package org.bukkit.entity;
package org.bukkit.entity;
import org.bukkit.Sound;
import org.bukkit.loot.Lootable; import org.bukkit.loot.Lootable;
+import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;

Datei anzeigen

@ -19,8 +19,48 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
* @param meta The FireworkMeta to apply * @param meta The FireworkMeta to apply
*/ */
@@ -0,0 +0,0 @@ public interface Firework extends Projectile { @@ -0,0 +0,0 @@ public interface Firework extends Projectile {
@org.jetbrains.annotations.Nullable * {@link #getMaxLife()}, the firework will detonate.
public LivingEntity getBoostedEntity(); *
* @param ticks the ticks to set. Must be greater than or equal to 0
+ * @deprecated use {@link #setTicksFlown(int)}
* @return true if the life was set, false if this firework has already detonated
*/
+ @Deprecated(forRemoval = true) // Paper
boolean setLife(int ticks);
/**
* Get the ticks that this firework has been alive. When this value reaches
* {@link #getMaxLife()}, the firework will detonate.
*
+ * @deprecated use {@link #getTicksFlown()}
* @return the life ticks
*/
+ @Deprecated(forRemoval = true) // Paper
int getLife();
/**
* Set the time in ticks this firework will exist until it is detonated.
*
* @param ticks the ticks to set. Must be greater than 0
+ * @deprecated use {@link #setTicksToDetonate(int)}
* @return true if the time was set, false if this firework has already detonated
*/
+ @Deprecated(forRemoval = true) // Paper
boolean setMaxLife(int ticks);
/**
* Get the time in ticks this firework will exist until it is detonated.
*
+ * @deprecated use {@link #getTicksToDetonate()}
* @return the maximum life in ticks
*/
+ @Deprecated(forRemoval = true) // Paper
int getMaxLife();
/**
@@ -0,0 +0,0 @@ public interface Firework extends Projectile {
return getAttachedTo();
}
// Paper end // Paper end
+ +
+ // Paper start - Firework API + // Paper start - Firework API

Datei anzeigen

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

Datei anzeigen

@ -42,16 +42,16 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.ja
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
@@ -0,0 +0,0 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { @@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData;
case ZOMBIE_SPAWN_EGG: public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
case ZOMBIE_VILLAGER_SPAWN_EGG:
case ZOMBIFIED_PIGLIN_SPAWN_EGG: private static final Set<Material> SPAWN_EGG_MATERIALS = Sets.newHashSet(
+ // Paper start + // Paper start
+ case ALLAY_SPAWN_EGG: + Material. ALLAY_SPAWN_EGG,
+ case FROG_SPAWN_EGG: + Material. FROG_SPAWN_EGG,
+ case TADPOLE_SPAWN_EGG: + Material. TADPOLE_SPAWN_EGG,
+ case WARDEN_SPAWN_EGG: + Material. WARDEN_SPAWN_EGG,
+ // Paper end + // Paper end
return true; Material.AXOLOTL_SPAWN_EGG,
default: Material.BAT_SPAWN_EGG,
return false; Material.BEE_SPAWN_EGG,

Datei anzeigen

@ -3848,18 +3848,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.BookMeta.Generation;
+import org.checkerframework.checker.nullness.qual.NonNull;
// Spigot start
import static org.spigotmc.ValidateUtils.*;
+
import java.util.AbstractList;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.chat.ComponentSerializer;
@@ -0,0 +0,0 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { @@ -0,0 +0,0 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
this.generation = (generation == null) ? null : generation.ordinal(); this.generation = (generation == null) ? null : generation.ordinal();
} }

Datei anzeigen

@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { @@ -0,0 +0,0 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
public int lifetime; public int lifetime;
@Nullable @Nullable
public LivingEntity attachedToEntity; public LivingEntity attachedToEntity; // PAIL private -> public
+ public java.util.UUID spawningEntity; // Paper + public java.util.UUID spawningEntity; // Paper
public FireworkRocketEntity(EntityType<? extends FireworkRocketEntity> type, Level world) { public FireworkRocketEntity(EntityType<? extends FireworkRocketEntity> type, Level world) {
@ -87,11 +87,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public java.util.UUID getSpawningEntity() { + public java.util.UUID getSpawningEntity() {
+ return getHandle().spawningEntity; + return getHandle().spawningEntity;
+ } + }
+
+ @Override
+ public org.bukkit.entity.LivingEntity getBoostedEntity() {
+ net.minecraft.world.entity.LivingEntity boostedEntity = getHandle().attachedToEntity;
+ return boostedEntity != null ? (org.bukkit.entity.LivingEntity) boostedEntity.getBukkitEntity() : null;
+ }
+ // Paper end + // Paper end
} }

Datei anzeigen

@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lukasz Derlatka <toranktto@gmail.com>
Date: Mon, 11 Nov 2019 16:08:13 +0100
Subject: [PATCH] Fix AssertionError when player hand set to empty type
Fixes an AssertionError when setting the player's item in hand to null or a new ItemStack of Air in PlayerInteractEvent
Fixes GH-2718
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524
return;
}
+ // Paper start
+ itemstack = this.player.getItemInHand(enumhand);
+ if (itemstack.isEmpty()) return;
+ // Paper end
InteractionResult enuminteractionresult = this.player.gameMode.useItem(this.player, worldserver, itemstack, enumhand);
if (enuminteractionresult.shouldSwing()) {

Datei anzeigen

@ -8,14 +8,6 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -0,0 +0,0 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.UUID;
+import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffect;
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity(); return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity();
} }
@ -23,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start + // Paper start
+ @Override + @Override
+ public void setKiller(Player killer) { + public void setKiller(Player killer) {
+ ServerPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle(); + net.minecraft.server.level.ServerPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle();
+ getHandle().lastHurtByPlayer = entityPlayer; + getHandle().lastHurtByPlayer = entityPlayer;
+ getHandle().lastHurtByMob = entityPlayer; + getHandle().lastHurtByMob = entityPlayer;
+ getHandle().lastHurtByPlayerTime = entityPlayer == null ? 0 : 100; // 100 value taken from EntityLiving#damageEntity + getHandle().lastHurtByPlayerTime = entityPlayer == null ? 0 : 100; // 100 value taken from EntityLiving#damageEntity

Datei anzeigen

@ -451,8 +451,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftRaider.java
@@ -0,0 +0,0 @@ public abstract class CraftRaider extends CraftMonster implements Raider { @@ -0,0 +0,0 @@ public abstract class CraftRaider extends CraftMonster implements Raider {
public void setCanJoinRaid(boolean join) { public Sound getCelebrationSound() {
this.getHandle().setCanJoinRaid(join); return CraftSound.getBukkit(this.getHandle().getCelebrateSound());
} }
+ +
+ // Paper start + // Paper start

Datei anzeigen

@ -91,7 +91,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Copied from EntityFireworks constructor, update firework lifetime/power // Copied from EntityFireworks constructor, update firework lifetime/power
this.getHandle().lifetime = 10 * (1 + meta.getPower()) + this.random.nextInt(6) + this.random.nextInt(7); this.getHandle().lifetime = 10 * (1 + meta.getPower()) + this.random.nextInt(6) + this.random.nextInt(7);
@@ -0,0 +0,0 @@ public class CraftFirework extends CraftProjectile implements Firework { @@ -0,0 +0,0 @@ public class CraftFirework extends CraftProjectile implements Firework {
return boostedEntity != null ? (org.bukkit.entity.LivingEntity) boostedEntity.getBukkitEntity() : null; return getHandle().spawningEntity;
} }
// Paper end // Paper end
+ // Paper start - Expose firework item directly + manually setting flight + // Paper start - Expose firework item directly + manually setting flight

@ -1 +1 @@
Subproject commit 2683d766020628844637e800d4ec12fd19cc674a Subproject commit 9ae3f10f8fa50a825af823131c468c36da3be880

@ -1 +1 @@
Subproject commit 5901d580a4902919b10fc23a07d40eda50497634 Subproject commit 5cc9c022a0bd297f348d3c7e24e06227dca40c23

@ -1 +1 @@
Subproject commit e53686f7e0406156c8fa91a6e7748fbfed19c3a4 Subproject commit 4c157bb49aa5705967b066e9c2dec5520f720b22