From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Mon, 17 Aug 2020 17:34:33 -0500
Subject: [PATCH] Crying obsidian valid for portal frames


diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index e18b3b575e4fe3fde869e749070feefb31548a25..26cda907063f104fd4a3fbd2286b37fb539f741a 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -141,6 +141,7 @@ public class Block extends BlockBase implements IMaterial {
         return tag.isTagged(this);
     }
 
+    public boolean equals(Block block) { return a(block); } // Purpur - OBFHELPER
     public boolean a(Block block) {
         return this == block;
     }
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
index e5f66cdf95b6073545efc8d1527b0a5e2741f79d..23a3b1b317b6b3e9d812f5a7b09b099b0528c59e 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
@@ -741,6 +741,7 @@ public abstract class BlockBase {
             return this.getBlock().a(tag) && predicate.test(this);
         }
 
+        public boolean equals(Block block) { return a(block); } // Purpur - OBFHELPER
         public boolean a(Block block) {
             return this.getBlock().a(block);
         }
diff --git a/src/main/java/net/minecraft/world/level/portal/BlockPortalShape.java b/src/main/java/net/minecraft/world/level/portal/BlockPortalShape.java
index 3f8a674345bcad8289a48d2daa5e2a283528e952..3c35f5d171df518f491cad1f49882622903302a6 100644
--- a/src/main/java/net/minecraft/world/level/portal/BlockPortalShape.java
+++ b/src/main/java/net/minecraft/world/level/portal/BlockPortalShape.java
@@ -30,7 +30,7 @@ import org.bukkit.event.world.PortalCreateEvent;
 public class BlockPortalShape {
 
     private static final BlockBase.e a = (iblockdata, iblockaccess, blockposition) -> {
-        return iblockdata.a(Blocks.OBSIDIAN);
+        return iblockdata.equals(Blocks.OBSIDIAN) || (net.pl3x.purpur.PurpurConfig.cryingObsidianValidForPortalFrame && iblockdata.equals(Blocks.CRYING_OBSIDIAN)); // Purpur
     };
     private final GeneratorAccess b;
     private final EnumDirection.EnumAxis c;
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index b587c96084a1ec3dd8fdec5a830fb8680e33e729..2409dbc4fca9b7510f01c0abc092ab67dd402b79 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -180,6 +180,7 @@ public class PurpurConfig {
     public static boolean barrelSixRows = false;
     public static boolean enderChestSixRows = false;
     public static boolean enderChestPermissionRows = false;
+    public static boolean cryingObsidianValidForPortalFrame = false;
     private static void blockSettings() {
         if (version < 3) {
             boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
@@ -194,6 +195,7 @@ public class PurpurConfig {
         enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
         InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
         enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
+        cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
     }
 
     public static boolean endermanShortHeight = false;
