PaperMC/paper-server/patches/sources/net/minecraft/world/damagesource/DamageSources.patch
CraftBukkit/Spigot a265d64138 Move CraftBukkit per-file patches
By: Initial <noreply+automated@papermc.io>
2024-12-11 22:26:36 +01:00

65 lines
2.5 KiB
Diff

--- a/net/minecraft/world/damagesource/DamageSources.java
+++ b/net/minecraft/world/damagesource/DamageSources.java
@@ -43,9 +43,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(IRegistryCustom iregistrycustom) {
this.damageTypes = iregistrycustom.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);
@@ -85,6 +91,16 @@
return new DamageSource(this.damageTypes.getOrThrow(resourcekey), entity, entity1);
}
+ // CraftBukkit start
+ public DamageSource melting() {
+ return this.melting;
+ }
+
+ public DamageSource poison() {
+ return this.poison;
+ }
+ // CraftBukkit end
+
public DamageSource inFire() {
return this.inFire;
}
@@ -254,7 +270,13 @@
}
public DamageSource explosion(@Nullable Entity entity, @Nullable Entity entity1) {
- return this.source(entity1 != null && entity != null ? DamageTypes.PLAYER_EXPLOSION : DamageTypes.EXPLOSION, entity, entity1);
+ // CraftBukkit start
+ return this.explosion(entity, entity1, entity1 != null && entity != null ? DamageTypes.PLAYER_EXPLOSION : DamageTypes.EXPLOSION);
+ }
+
+ public DamageSource explosion(@Nullable Entity entity, @Nullable Entity entity1, ResourceKey<DamageType> resourceKey) {
+ return this.source(resourceKey, entity, entity1);
+ // CraftBukkit end
}
public DamageSource sonicBoom(Entity entity) {
@@ -262,7 +284,13 @@
}
public DamageSource badRespawnPointExplosion(Vec3D vec3d) {
- return new DamageSource(this.damageTypes.getOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d);
+ // CraftBukkit start
+ return badRespawnPointExplosion(vec3d, null);
+ }
+
+ public DamageSource badRespawnPointExplosion(Vec3D vec3d, org.bukkit.block.BlockState blockState) {
+ return new DamageSource(this.damageTypes.getOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d).directBlockState(blockState);
+ // CraftBukkit end
}
public DamageSource outOfBorder() {