From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 4 Jul 2020 13:23:19 -0500
Subject: [PATCH] Implement respawn anchor explosion options


diff --git a/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java b/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java
index 028e98decf8b0496b4ebcd1aad3aa474e5c4e7c1..9b7a7f1ae50baf53d314bbf1588afeb8e61dae5d 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java
@@ -115,10 +115,7 @@ public class BlockRespawnAnchor extends Block {
 
     private void d(IBlockData iblockdata, World world, final BlockPosition blockposition) {
         world.a(blockposition, false);
-        Stream stream = EnumDirection.EnumDirectionLimit.HORIZONTAL.a();
-
-        blockposition.getClass();
-        boolean flag = stream.map(blockposition::shift).anyMatch((blockposition1) -> {
+        boolean flag = EnumDirection.EnumDirectionLimit.HORIZONTAL.a().map(blockposition::shift).anyMatch((blockposition1) -> { // Purpur - decompile error
             return a(blockposition1, world);
         });
         final boolean flag1 = flag || world.getFluid(blockposition.up()).a((Tag) TagsFluid.WATER);
@@ -129,7 +126,7 @@ public class BlockRespawnAnchor extends Block {
             }
         };
 
-        world.createExplosion((Entity) null, DamageSource.a(), explosiondamagecalculator, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.Effect.DESTROY);
+        if (world.purpurConfig.respawnAnchorExplode) world.createExplosion(null, DamageSource.a(), explosiondamagecalculator, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (float) world.purpurConfig.respawnAnchorExplosionPower, world.purpurConfig.respawnAnchorExplosionFire, world.purpurConfig.respawnAnchorExplosionEffect); // Purpur
     }
 
     public static boolean a(World world) {
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 5486dd15752e9c260275a6b3d5ed702e6bf14a81..a366742e8d11513b469ffb8dafd98a4c0d8ab30a 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -251,6 +251,22 @@ public class PurpurWorldConfig {
         lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether);
     }
 
+    public boolean respawnAnchorExplode = true;
+    public double respawnAnchorExplosionPower = 5.0D;
+    public boolean respawnAnchorExplosionFire = true;
+    public Explosion.Effect respawnAnchorExplosionEffect = Explosion.Effect.DESTROY;
+    private void respawnAnchorSettings() {
+        respawnAnchorExplode = getBoolean("blocks.respawn_anchor.explode", respawnAnchorExplode);
+        respawnAnchorExplosionPower = getDouble("blocks.respawn_anchor.explosion-power", respawnAnchorExplosionPower);
+        respawnAnchorExplosionFire = getBoolean("blocks.respawn_anchor.explosion-fire", respawnAnchorExplosionFire);
+        try {
+            respawnAnchorExplosionEffect = Explosion.Effect.valueOf(getString("blocks.respawn_anchor.explosion-effect", respawnAnchorExplosionEffect.name()));
+        } catch (IllegalArgumentException e) {
+            log(Level.SEVERE, "Unknown value for `blocks.respawn_anchor.explosion-effect`! Using default of `DESTROY`");
+            respawnAnchorExplosionEffect = Explosion.Effect.DESTROY;
+        }
+    }
+
     public boolean signAllowColors = false;
     public boolean signRightClickEdit = false;
     private void signSettings() {
