PaperMC/paper-server/patches/sources/net/minecraft/world/damagesource/DamageSources.java.patch
2024-12-20 12:00:24 +01:00

50 lines
1.8 KiB
Diff

--- a/net/minecraft/world/damagesource/DamageSources.java
+++ b/net/minecraft/world/damagesource/DamageSources.java
@@ -42,9 +_,15 @@
private final DamageSource stalagmite;
private final DamageSource outsideBorder;
private final DamageSource genericKill;
+ // CraftBukkit start
+ private final DamageSource melting;
+ private final DamageSource poison;
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();
+ // CraftBukkit end
this.inFire = this.source(DamageTypes.IN_FIRE);
this.campfire = this.source(DamageTypes.CAMPFIRE);
this.lightningBolt = this.source(DamageTypes.LIGHTNING_BOLT);
@@ -84,6 +_,16 @@
return new DamageSource(this.damageTypes.getOrThrow(damageTypeKey), causingEntity, directEntity);
}
+ // CraftBukkit start
+ public DamageSource melting() {
+ return this.melting;
+ }
+
+ public DamageSource poison() {
+ return this.poison;
+ }
+ // CraftBukkit end
+
public DamageSource inFire() {
return this.inFire;
}
@@ -261,7 +_,13 @@
}
public DamageSource badRespawnPointExplosion(Vec3 position) {
- return new DamageSource(this.damageTypes.getOrThrow(DamageTypes.BAD_RESPAWN_POINT), position);
+ // CraftBukkit start
+ return this.badRespawnPointExplosion(position, null);
+ }
+
+ public DamageSource badRespawnPointExplosion(Vec3 position, org.bukkit.block.BlockState blockState) {
+ return new DamageSource(this.damageTypes.getOrThrow(DamageTypes.BAD_RESPAWN_POINT), position).directBlockState(blockState);
+ // CraftBukkit end
}
public DamageSource outOfBorder() {