Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@9b9de827 Update Alternate Current patch to v1.9.1 (#12115)
PaperMC/Paper@c62252e1 Add lore content guard (#12116)
PaperMC/Paper@40416784 [ci/skip] Mention missing World#regenerateChunk implementation in jd (#12109)
PaperMC/Paper@a6e82d90 [ci/skip] Clarify getChunkAtAsyncUrgently javadocs (#12125)
PaperMC/Paper@cb25c0cf [ci/skip] Fix annotation fields used in NMS getBukkitEntity (#12120)
PaperMC/Paper@00701267 [ci/skip] improvement example in javadoc for DatapackRegistrar (#12122)
PaperMC/Paper@608f004a add method on ItemStack to edit pdc (#12022)
PaperMC/Paper@7bee9971 Cleanup damage source a bit (#12106)
PaperMC/Paper@b9023b5d Add EntityAttemptSmashAttackEvent (#12113)
PaperMC/Paper@a3781ff3 Separate tick count to ensure vanilla parity (#12077)
PaperMC/Paper@2a4a1154 Add EntityEquipmentChangedEvent (#12011)
PaperMC/Paper@06f96dd6 Improvement in /plugins command (#12121)
PaperMC/Paper@28d07dc5 use correct spigot plugin count
PaperMC/Paper@60394c5b Fix PlayerReadyArrowEvent cancellation desync (#12111)
PaperMC/Paper@b27e11cc Fix bad world to chunk coordinate example in javadocs (#12131)
PaperMC/Paper@88cdd220 Fixup luck and random implementation in CB loot-tables (#11926)
PaperMC/Paper@84609dc0 Don't auto-create any brig redirects (#11954)
PaperMC/Paper@8eb8e44a Allow For Default Titles in InventoryView Builders (#12013)
This commit is contained in:
granny
2025-02-17 17:19:02 -08:00
parent 22bd4186ca
commit b0d36caeda
27 changed files with 144 additions and 153 deletions

View File

@@ -1,16 +1,16 @@
--- a/net/minecraft/world/damagesource/DamageSource.java
+++ b/net/minecraft/world/damagesource/DamageSource.java
@@ -28,6 +_,8 @@
private boolean sweep = false;
private boolean melting = false;
private boolean poison = false;
@@ -30,6 +_,8 @@
@Nullable
private org.bukkit.block.BlockState fromBlockSnapshot; // Captured block snapshot when the eventBlockDamager is not relevant (e.g. for bad respawn point explosions the block is already removed)
private boolean critical; // Supports arrows and sweeping damage
+ private boolean scissors = false; // Purpur - Dont run with scissors!
+ private boolean stonecutter = false; // Purpur - Stonecutter damage
@Nullable
private Entity customEventDamager = null; // This field is a helper for when causing entity damage is not set by vanilla // Paper - fix DamageSource API
@@ -58,6 +_,27 @@
return this.poison;
public DamageSource knownCause(final org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) {
final DamageSource damageSource = this.copy();
@@ -42,6 +_,29 @@
return this.knownCause;
}
+ // Purpur start - Dont run with scissors!
@@ -23,8 +23,10 @@
+ return this.scissors;
+ }
+ // Purpur end - Dont run with scissors!
+
+ // Purpur start - - Stonecutter damage
+ public DamageSource stonecutter() {
+ this.knownCause(org.bukkit.event.entity.EntityDamageEvent.DamageCause.CONTACT);
+ this.stonecutter = true;
+ return this;
+ }
@@ -34,19 +36,19 @@
+ }
+ // Purpur end - Stonecutter damage
+
// Paper start - fix DamageSource API
@Nullable
public Entity getCustomEventDamager() {
@@ -118,6 +_,8 @@
damageSource.sweep = this.isSweep();
damageSource.poison = this.isPoison();
damageSource.melting = this.isMelting();
public Entity eventEntityDamager() {
return this.eventEntityDamager;
@@ -103,6 +_,8 @@
damageSource.eventBlockDamager = this.eventBlockDamager;
damageSource.fromBlockSnapshot = this.fromBlockSnapshot;
damageSource.critical = this.critical;
+ damageSource.scissors = this.isScissors(); // Purpur - Dont run with scissors!
+ damageSource.stonecutter = this.isStonecutter(); // Purpur - Stonecutter damage
return damageSource;
}
// CraftBukkit end
@@ -184,11 +_,20 @@
@@ -169,11 +_,20 @@
} else {
Component component = this.causingEntity == null ? this.directEntity.getDisplayName() : this.causingEntity.getDisplayName();
ItemStack itemStack = this.causingEntity instanceof LivingEntity livingEntity1 ? livingEntity1.getMainHandItem() : ItemStack.EMPTY;

View File

@@ -1,26 +1,29 @@
--- a/net/minecraft/world/damagesource/DamageSources.java
+++ b/net/minecraft/world/damagesource/DamageSources.java
@@ -45,11 +_,15 @@
// CraftBukkit start
private final DamageSource melting;
private final DamageSource poison;
@@ -42,6 +_,8 @@
private final DamageSource stalagmite;
private final DamageSource outsideBorder;
private final DamageSource genericKill;
+ private final DamageSource scissors; // Purpur - Dont run with scissors!
+ private final DamageSource stonecutter; // Purpur - Stonecutter damage
public DamageSources(RegistryAccess registry) {
this.damageTypes = registry.lookupOrThrow(Registries.DAMAGE_TYPE);
this.melting = this.source(DamageTypes.ON_FIRE).melting();
this.poison = this.source(DamageTypes.MAGIC).poison();
@@ -70,6 +_,8 @@
this.stalagmite = this.source(DamageTypes.STALAGMITE);
this.outsideBorder = this.source(DamageTypes.OUTSIDE_BORDER);
this.genericKill = this.source(DamageTypes.GENERIC_KILL);
+ this.scissors = this.source(DamageTypes.MAGIC).scissors(); // Purpur - Dont run with scissors!
+ this.stonecutter = this.source(DamageTypes.MAGIC).stonecutter(); // Purpur - Stonecutter damage
// CraftBukkit end
this.inFire = this.source(DamageTypes.IN_FIRE);
this.campfire = this.source(DamageTypes.CAMPFIRE);
@@ -100,6 +_,17 @@
}
// CraftBukkit end
+ // Purpur start - Dont run with scissors!
private DamageSource source(ResourceKey<DamageType> damageTypeKey) {
@@ -83,6 +_,18 @@
private DamageSource source(ResourceKey<DamageType> damageTypeKey, @Nullable Entity causingEntity, @Nullable Entity directEntity) {
return new DamageSource(this.damageTypes.getOrThrow(damageTypeKey), causingEntity, directEntity);
}
+
+ // Purpur start - Dont run with scissor
+ public DamageSource scissors() {
+ return this.scissors;
+ }
@@ -31,6 +34,6 @@
+ return this.stonecutter;
+ }
+ // Purpur end - Stonecutter damage
public DamageSource inFire() {
return this.inFire;
}