Updated Upstream (Bukkit/CraftBukkit)

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:
304e83eb PR-1002: Improve documentation and implementation of getMaxStackSize
e8215ea2 SPIGOT-7638: Library loader does not seem to resolve every dependency
79c595c0 SPIGOT-7637: Bad logic in checking nullability of AttributeModifier slots

CraftBukkit Changes:
91b1fc3f1 SPIGOT-7644: Fix ItemMeta#getAsString
4e77a81e1 SPIGOT-7615: PlayerLeashEntityEvent cancelled eats lead
996f660f3 Do not remove leash knot if leasing to an existing leash knot gets cancelled
f70367d42 SPIGOT-7643: Fix inverted leash event cancelled usage and remove leash knot if no entity gets leashed
7ddb48294 SPIGOT-7640: Abnormal jumping height of wind charge
080c8711e SPIGOT-7639: Incoming plugin channels not working
ad549847e Open a direct connection instead of pinging mojang server to check if it is reachable
38e2926c5 SPIGOT-7365: DamageCause blocked by shield should trigger invulnerableTime
This commit is contained in:
Jake Potrebic 2024-04-27 18:00:01 -07:00
parent 25e7f94c2a
commit dcbe8f75f2
9 changed files with 13 additions and 17 deletions

View file

@ -3,7 +3,7 @@ version=1.20.5-R0.1-SNAPSHOT
mcVersion=1.20.5 mcVersion=1.20.5
# Set to true while updating Minecraft version # Set to true while updating Minecraft version
updatingMinecraft=true updatingMinecraft=false
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View file

@ -21,6 +21,7 @@ dependencies {
} }
tasks.register<JavaExec>("generate") { tasks.register<JavaExec>("generate") {
dependsOn(tasks.check)
mainClass.set("io.papermc.generator.Main") mainClass.set("io.papermc.generator.Main")
classpath(sourceSets.main.map { it.runtimeClasspath }) classpath(sourceSets.main.map { it.runtimeClasspath })
args(projectDir.toPath().resolve("generated").toString()) args(projectDir.toPath().resolve("generated").toString())

View file

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/inventory/EquipmentSlot.java +++ b/src/main/java/org/bukkit/inventory/EquipmentSlot.java
@@ -0,0 +0,0 @@ public enum EquipmentSlot { @@ -0,0 +0,0 @@ public enum EquipmentSlot {
public EquipmentSlotGroup getGroup() { public EquipmentSlotGroup getGroup() {
return group; return group.get();
} }
+ // Paper start + // Paper start
+ /** + /**

View file

@ -222,12 +222,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/Explosion.java --- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion { @@ -0,0 +0,0 @@ public class Explosion {
Vec3 result = entity.getDeltaMovement().add(vec3d1); // since the code below (the setDeltaMovement call as well as the hitPlayers map)
org.bukkit.event.entity.EntityKnockbackEvent event = CraftEventFactory.callEntityKnockbackEvent((org.bukkit.craftbukkit.entity.CraftLivingEntity) entity.getBukkitEntity(), this.source, org.bukkit.event.entity.EntityKnockbackEvent.KnockbackCause.EXPLOSION, d13, vec3d1, result.x, result.y, result.z); // want the vector to be the relative velocity will the event provides the absolute velocity
vec3d1 = (event.isCancelled()) ? Vec3.ZERO : new Vec3(event.getFinalKnockback().getX(), event.getFinalKnockback().getY(), event.getFinalKnockback().getZ()).subtract(entity.getDeltaMovement());
- vec3d1 = (event.isCancelled()) ? Vec3.ZERO : new Vec3(event.getFinalKnockback().getX(), event.getFinalKnockback().getY(), event.getFinalKnockback().getZ());
+ // Paper start - call EntityKnockbackByEntityEvent for explosions + // Paper start - call EntityKnockbackByEntityEvent for explosions
+ vec3d1 = (event.isCancelled()) ? Vec3.ZERO : new Vec3(event.getFinalKnockback().getX(), event.getFinalKnockback().getY(), event.getFinalKnockback().getZ()).subtract(entity.getDeltaMovement()); // changes on this line fix a bug where vec3d1 wasn't reassigned with the "change", but instead the final deltaMovement
+ if (this.damageSource.getEntity() != null || this.source != null) { + if (this.damageSource.getEntity() != null || this.source != null) {
+ final org.bukkit.entity.Entity hitBy = this.damageSource.getEntity() != null ? this.damageSource.getEntity().getBukkitEntity() : this.source.getBukkitEntity(); + final org.bukkit.entity.Entity hitBy = this.damageSource.getEntity() != null ? this.damageSource.getEntity().getBukkitEntity() : this.source.getBukkitEntity();
+ com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent paperEvent = new com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent(((LivingEntity) entity).getBukkitLivingEntity(), hitBy, (float) event.getForce(), org.bukkit.craftbukkit.util.CraftVector.toBukkit(vec3d1)); + com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent paperEvent = new com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent(((LivingEntity) entity).getBukkitLivingEntity(), hitBy, (float) event.getForce(), org.bukkit.craftbukkit.util.CraftVector.toBukkit(vec3d1));

View file

@ -43,4 +43,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order + CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order
} }
return false; return true;

View file

@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti @@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
// CraftBukkit start - fire PlayerLeashEntityEvent
if (CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) { if (CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) {
((ServerPlayer) player).resendItemInHands(); // SPIGOT-7615: Resend to fix client desync with used item
((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, this.getLeashHolder())); ((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, this.getLeashHolder()));
+ player.containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync + player.containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync
return InteractionResult.PASS; return InteractionResult.PASS;

View file

@ -18,14 +18,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
final boolean human = this instanceof net.minecraft.world.entity.player.Player; final boolean human = this instanceof net.minecraft.world.entity.player.Player;
float originalDamage = f; float originalDamage = f;
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order
}
- return false; return true;
+ return true; // Paper - return false ONLY if event was cancelled
} else { } else {
- return originalDamage > 0; - return originalDamage >= 0;
+ return originalDamage > 0 || true; // Paper - return false ONLY if event was cancelled + return true; // Paper - return false ONLY if event was cancelled
} }
// CraftBukkit end // CraftBukkit end
} }

@ -1 +1 @@
Subproject commit 69fa46950cc65264d4e4db9f22e58d5f57e47f46 Subproject commit 304e83eb384c338546aa96eea51388e0e8407e26

@ -1 +1 @@
Subproject commit 90f1059bae911966b5629b3ec1ff242d109fde7f Subproject commit 91b1fc3f1cf89e2591367dca1fa7362fe376f289