Config for wither explosion radius

This commit is contained in:
Ben Kerllenevich
2025-01-11 18:18:47 -08:00
committed by granny
parent 94ddedf902
commit 438f5e1ee8
3 changed files with 15 additions and 43 deletions

View File

@@ -1,16 +1,25 @@
--- a/net/minecraft/world/entity/projectile/WitherSkull.java
+++ b/net/minecraft/world/entity/projectile/WitherSkull.java
@@ -103,6 +_,13 @@
@@ -92,7 +_,7 @@
super.onHit(result);
if (!this.level().isClientSide) {
// CraftBukkit start
- org.bukkit.event.entity.ExplosionPrimeEvent event = new org.bukkit.event.entity.ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false);
+ org.bukkit.event.entity.ExplosionPrimeEvent event = new org.bukkit.event.entity.ExplosionPrimeEvent(this.getBukkitEntity(), this.level().purpurConfig.witherExplosionRadius, false); // Purpur - Config for wither explosion radius
this.level().getCraftServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@@ -102,6 +_,13 @@
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
}
}
+
+ // Purpur start - Add canSaveToDisk to Entity
+ @Override
+ public boolean canSaveToDisk() {
+ return false;
+ }
+ // Purpur end - Add canSaveToDisk to Entity
+
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
builder.define(DATA_DANGEROUS, false);

View File

@@ -2408,6 +2408,7 @@ public class PurpurWorldConfig {
public boolean witherBypassMobGriefing = false;
public boolean witherTakeDamageFromWater = false;
public boolean witherCanRideVehicles = false;
public float witherExplosionRadius = 1.0F;
private void witherSettings() {
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
@@ -2429,6 +2430,7 @@ public class PurpurWorldConfig {
witherBypassMobGriefing = getBoolean("mobs.wither.bypass-mob-griefing", witherBypassMobGriefing);
witherTakeDamageFromWater = getBoolean("mobs.wither.takes-damage-from-water", witherTakeDamageFromWater);
witherCanRideVehicles = getBoolean("mobs.wither.can-ride-vehicles", witherCanRideVehicles);
witherExplosionRadius = (float) getDouble("mobs.wither.explosion-radius", witherExplosionRadius);
}
public boolean witherSkeletonRidable = false;