2023-03-14 17:30:00 +01:00
|
|
|
--- a/net/minecraft/world/damagesource/DamageSources.java
|
|
|
|
+++ b/net/minecraft/world/damagesource/DamageSources.java
|
2023-06-07 17:30:00 +02:00
|
|
|
@@ -41,9 +41,15 @@
|
2023-03-14 17:30:00 +01:00
|
|
|
private final DamageSource stalagmite;
|
2023-06-07 17:30:00 +02:00
|
|
|
private final DamageSource outsideBorder;
|
|
|
|
private final DamageSource genericKill;
|
2023-03-14 17:30:00 +01:00
|
|
|
+ // CraftBukkit start
|
2024-02-10 23:54:25 +01:00
|
|
|
+ private final DamageSource melting;
|
|
|
|
+ private final DamageSource poison;
|
2023-03-14 17:30:00 +01:00
|
|
|
|
|
|
|
public DamageSources(IRegistryCustom iregistrycustom) {
|
|
|
|
this.damageTypes = iregistrycustom.registryOrThrow(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.lightningBolt = this.source(DamageTypes.LIGHTNING_BOLT);
|
|
|
|
this.onFire = this.source(DamageTypes.ON_FIRE);
|
2024-02-10 23:54:25 +01:00
|
|
|
@@ -81,6 +87,16 @@
|
|
|
|
return new DamageSource(this.damageTypes.getHolderOrThrow(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;
|
|
|
|
}
|
2024-05-04 00:15:51 +02:00
|
|
|
@@ -242,7 +258,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) {
|
|
|
|
@@ -250,7 +272,13 @@
|
2024-04-29 12:08:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public DamageSource badRespawnPointExplosion(Vec3D vec3d) {
|
|
|
|
- return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d);
|
|
|
|
+ // CraftBukkit start
|
2024-05-04 00:15:51 +02:00
|
|
|
+ return badRespawnPointExplosion(vec3d, null);
|
2024-04-29 12:08:56 +02:00
|
|
|
+ }
|
|
|
|
+
|
2024-05-04 00:15:51 +02:00
|
|
|
+ public DamageSource badRespawnPointExplosion(Vec3D vec3d, org.bukkit.block.BlockState blockState) {
|
|
|
|
+ return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d).directBlockState(blockState);
|
2024-04-29 12:08:56 +02:00
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
|
|
|
public DamageSource outOfBorder() {
|