mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) bc7ea673a Add internal channel initialization listeners (#5557) b28ad17ac Check for world change in MoveEvent API methods 3095c7592 [Auto] Updated Upstream (CraftBukkit) f56989c97 Add RespawnFlags to PlayerRespawnEvent (#5533) 7579c2667 Add more API to PlayerMoveEvent (#5553)
This commit is contained in:
91
patches/server/0169-End-crystal-explosion-options.patch
Normal file
91
patches/server/0169-End-crystal-explosion-options.patch
Normal file
@@ -0,0 +1,91 @@
|
||||
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/EntityEnderCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
|
||||
index 2c983e6a092464d1867fcbe875b2e1461ec8556b..a92c900a6092c07b34711428fac268f446043c90 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
|
||||
@@ -118,6 +118,22 @@ public class EntityEnderCrystal extends Entity {
|
||||
phantomDamageCooldown = 0;
|
||||
idleCooldown = 60;
|
||||
}
|
||||
+
|
||||
+ public boolean shouldExplode() {
|
||||
+ return isShowingBottom() ? world.purpurConfig.baseCrystalExplode : world.purpurConfig.baselessCrystalExplode;
|
||||
+ }
|
||||
+
|
||||
+ public float getExplosionPower() {
|
||||
+ return (float) (isShowingBottom() ? world.purpurConfig.baseCrystalExplosionPower : world.purpurConfig.baselessCrystalExplosionPower);
|
||||
+ }
|
||||
+
|
||||
+ public boolean hasExplosionFire() {
|
||||
+ return isShowingBottom() ? world.purpurConfig.baseCrystalExplosionFire : world.purpurConfig.baselessCrystalExplosionFire;
|
||||
+ }
|
||||
+
|
||||
+ public Explosion.Effect getExplosionEffect() {
|
||||
+ return isShowingBottom() ? world.purpurConfig.baseCrystalExplosionEffect : world.purpurConfig.baselessCrystalExplosionEffect;
|
||||
+ }
|
||||
// Purpur end
|
||||
|
||||
@Override
|
||||
@@ -161,15 +177,17 @@ public class EntityEnderCrystal extends Entity {
|
||||
// CraftBukkit end
|
||||
this.die();
|
||||
if (!damagesource.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.world.getServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
this.dead = false;
|
||||
return false;
|
||||
}
|
||||
- this.world.createExplosion(this, this.locX(), this.locY(), this.locZ(), event.getRadius(), event.getFire(), Explosion.Effect.DESTROY);
|
||||
+ this.world.createExplosion(this, this.locX(), this.locY(), this.locZ(), event.getRadius(), event.getFire(), getExplosionEffect()); // Purpur
|
||||
// CraftBukkit end
|
||||
+ } else this.dead = false; // Purpur
|
||||
}
|
||||
|
||||
this.a(damagesource);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 447188e570bbab37a225f9c2583a8481a90a22ef..d98671c6db4d86a9324f120c68e610364337bee6 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1963,4 +1963,33 @@ public class PurpurWorldConfig {
|
||||
private void imposeTeleportRestrictionsOnGateways() {
|
||||
imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways);
|
||||
}
|
||||
+
|
||||
+ public boolean baselessCrystalExplode = true;
|
||||
+ public double baselessCrystalExplosionPower = 6.0D;
|
||||
+ public boolean baselessCrystalExplosionFire = false;
|
||||
+ public Explosion.Effect baselessCrystalExplosionEffect = Explosion.Effect.DESTROY;
|
||||
+ public boolean baseCrystalExplode = true;
|
||||
+ public double baseCrystalExplosionPower = 6.0D;
|
||||
+ public boolean baseCrystalExplosionFire = false;
|
||||
+ public Explosion.Effect baseCrystalExplosionEffect = Explosion.Effect.DESTROY;
|
||||
+ private void crystalSettings() {
|
||||
+ baselessCrystalExplode = getBoolean("blocks.end-crystal.baseless.explode", baselessCrystalExplode);
|
||||
+ baselessCrystalExplosionPower = getDouble("blocks.end-crystal.baseless.explosion-power", baselessCrystalExplosionPower);
|
||||
+ baselessCrystalExplosionFire = getBoolean("blocks.end-crystal.baseless.explosion-fire", baselessCrystalExplosionFire);
|
||||
+ try {
|
||||
+ baselessCrystalExplosionEffect = Explosion.Effect.valueOf(getString("blocks.end-crystal.baseless.explosion-effect", baselessCrystalExplosionEffect.name()));
|
||||
+ } catch (IllegalArgumentException e) {
|
||||
+ log(Level.SEVERE, "Unknown value for `blocks.end-crystal.baseless.explosion-effect`! Using default of `DESTROY`");
|
||||
+ baselessCrystalExplosionEffect = Explosion.Effect.DESTROY;
|
||||
+ }
|
||||
+ baseCrystalExplode = getBoolean("blocks.end-crystal.base.explode", baseCrystalExplode);
|
||||
+ baseCrystalExplosionPower = getDouble("blocks.end-crystal.base.explosion-power", baseCrystalExplosionPower);
|
||||
+ baseCrystalExplosionFire = getBoolean("blocks.end-crystal.base.explosion-fire", baseCrystalExplosionFire);
|
||||
+ try {
|
||||
+ baseCrystalExplosionEffect = Explosion.Effect.valueOf(getString("blocks.end-crystal.base.explosion-effect", baseCrystalExplosionEffect.name()));
|
||||
+ } catch (IllegalArgumentException e) {
|
||||
+ log(Level.SEVERE, "Unknown value for `blocks.end-crystal.base.explosion-effect`! Using default of `DESTROY`");
|
||||
+ baseCrystalExplosionEffect = Explosion.Effect.DESTROY;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
Reference in New Issue
Block a user