mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
94 lines
5.6 KiB
Diff
94 lines
5.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Ben Kerllenevich <me@notom3ga.me>
|
|
Date: Sat, 13 Feb 2021 09:28:56 -0500
|
|
Subject: [PATCH] End crystal explosion options
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
|
index 92e65f3fbc8f5d77bb8cc31e7a7780c2589f4227..0c46507ab0b904fb1f79bc5421c88c03e894c869 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
|
@@ -130,6 +130,22 @@ public class EndCrystal extends Entity {
|
|
phantomDamageCooldown = 0;
|
|
idleCooldown = 60;
|
|
}
|
|
+
|
|
+ public boolean shouldExplode() {
|
|
+ return showsBottom() ? level.purpurConfig.basedEndCrystalExplode : level.purpurConfig.baselessEndCrystalExplode;
|
|
+ }
|
|
+
|
|
+ public float getExplosionPower() {
|
|
+ return (float) (showsBottom() ? level.purpurConfig.basedEndCrystalExplosionPower : level.purpurConfig.baselessEndCrystalExplosionPower);
|
|
+ }
|
|
+
|
|
+ public boolean hasExplosionFire() {
|
|
+ return showsBottom() ? level.purpurConfig.basedEndCrystalExplosionFire : level.purpurConfig.baselessEndCrystalExplosionFire;
|
|
+ }
|
|
+
|
|
+ public Explosion.BlockInteraction getExplosionEffect() {
|
|
+ return showsBottom() ? level.purpurConfig.basedEndCrystalExplosionEffect : level.purpurConfig.baselessEndCrystalExplosionEffect;
|
|
+ }
|
|
// Purpur end
|
|
|
|
@Override
|
|
@@ -175,15 +191,17 @@ public class EndCrystal extends Entity {
|
|
// CraftBukkit end
|
|
this.remove(Entity.RemovalReason.KILLED);
|
|
if (!source.isExplosion()) {
|
|
+ if (shouldExplode()) { // Purpur
|
|
// CraftBukkit start
|
|
- ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false);
|
|
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), getExplosionPower(), hasExplosionFire()); // Purpur
|
|
this.level.getCraftServer().getPluginManager().callEvent(event);
|
|
if (event.isCancelled()) {
|
|
this.unsetRemoved();
|
|
return false;
|
|
}
|
|
- this.level.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Explosion.BlockInteraction.DESTROY);
|
|
+ this.level.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), getExplosionEffect()); // Purpur
|
|
// CraftBukkit end
|
|
+ } else this.unsetRemoved(); // Purpur
|
|
}
|
|
|
|
this.onDestroyedBy(source);
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 5a09eff3d6a0c4542cb8f647fb0cee45358bdcdd..b74cbdc1789b4fd6c6e93f639e25d84829d1d933 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -460,6 +460,35 @@ public class PurpurWorldConfig {
|
|
dispenserPlaceAnvils = getBoolean("blocks.dispenser.place-anvils", dispenserPlaceAnvils);
|
|
}
|
|
|
|
+ public boolean baselessEndCrystalExplode = true;
|
|
+ public double baselessEndCrystalExplosionPower = 6.0D;
|
|
+ public boolean baselessEndCrystalExplosionFire = false;
|
|
+ public Explosion.BlockInteraction baselessEndCrystalExplosionEffect = Explosion.BlockInteraction.DESTROY;
|
|
+ public boolean basedEndCrystalExplode = true;
|
|
+ public double basedEndCrystalExplosionPower = 6.0D;
|
|
+ public boolean basedEndCrystalExplosionFire = false;
|
|
+ public Explosion.BlockInteraction basedEndCrystalExplosionEffect = Explosion.BlockInteraction.DESTROY;
|
|
+ private void endCrystalSettings() {
|
|
+ baselessEndCrystalExplode = getBoolean("blocks.end-crystal.baseless.explode", baselessEndCrystalExplode);
|
|
+ baselessEndCrystalExplosionPower = getDouble("blocks.end-crystal.baseless.explosion-power", baselessEndCrystalExplosionPower);
|
|
+ baselessEndCrystalExplosionFire = getBoolean("blocks.end-crystal.baseless.explosion-fire", baselessEndCrystalExplosionFire);
|
|
+ try {
|
|
+ baselessEndCrystalExplosionEffect = Explosion.BlockInteraction.valueOf(getString("blocks.end-crystal.baseless.explosion-effect", baselessEndCrystalExplosionEffect.name()));
|
|
+ } catch (IllegalArgumentException e) {
|
|
+ log(Level.SEVERE, "Unknown value for `blocks.end-crystal.baseless.explosion-effect`! Using default of `DESTROY`");
|
|
+ baselessEndCrystalExplosionEffect = Explosion.BlockInteraction.DESTROY;
|
|
+ }
|
|
+ basedEndCrystalExplode = getBoolean("blocks.end-crystal.base.explode", basedEndCrystalExplode);
|
|
+ basedEndCrystalExplosionPower = getDouble("blocks.end-crystal.base.explosion-power", basedEndCrystalExplosionPower);
|
|
+ basedEndCrystalExplosionFire = getBoolean("blocks.end-crystal.base.explosion-fire", basedEndCrystalExplosionFire);
|
|
+ try {
|
|
+ basedEndCrystalExplosionEffect = Explosion.BlockInteraction.valueOf(getString("blocks.end-crystal.base.explosion-effect", basedEndCrystalExplosionEffect.name()));
|
|
+ } catch (IllegalArgumentException e) {
|
|
+ log(Level.SEVERE, "Unknown value for `blocks.end-crystal.base.explosion-effect`! Using default of `DESTROY`");
|
|
+ basedEndCrystalExplosionEffect = Explosion.BlockInteraction.DESTROY;
|
|
+ }
|
|
+ }
|
|
+
|
|
public boolean farmlandBypassMobGriefing = false;
|
|
public boolean farmlandGetsMoistFromBelow = false;
|
|
public boolean farmlandAlpha = false;
|