--- a/net/minecraft/block/NetherPortalBlock.java
+++ b/net/minecraft/block/NetherPortalBlock.java
@@ -70,7 +70,7 @@
 
    public static boolean func_176548_d(IWorld p_176548_0_, BlockPos p_176548_1_) {
       NetherPortalBlock.Size netherportalblock$size = func_201816_b(p_176548_0_, p_176548_1_);
-      if (netherportalblock$size != null) {
+      if (netherportalblock$size != null && !net.minecraftforge.event.ForgeEventFactory.onTrySpawnPortal(p_176548_0_, p_176548_1_, netherportalblock$size)) {
          netherportalblock$size.func_150859_c();
          return true;
       } else {
@@ -241,12 +241,12 @@
          int i;
          for(i = 0; i < 22; ++i) {
             BlockPos blockpos = p_180120_1_.func_177967_a(p_180120_2_, i);
-            if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).func_203425_a(Blocks.field_150343_Z)) {
+            if (!this.func_196900_a(this.field_150867_a.func_180495_p(blockpos)) || !this.field_150867_a.func_180495_p(blockpos.func_177977_b()).isPortalFrame(field_150867_a, blockpos.func_177977_b())) {
                break;
             }
          }
 
-         return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).func_203425_a(Blocks.field_150343_Z) ? i : 0;
+         return this.field_150867_a.func_180495_p(p_180120_1_.func_177967_a(p_180120_2_, i)).isPortalFrame(field_150867_a, p_180120_1_.func_177967_a(p_180120_2_, i)) ? i : 0;
       }
 
       public int func_181100_a() {
@@ -272,17 +272,17 @@
                }
 
                if (i == 0) {
-                  if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).func_203425_a(Blocks.field_150343_Z)) {
+                  if (!this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150863_d)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150863_d))) {
                      break label56;
                   }
-               } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).func_203425_a(Blocks.field_150343_Z)) {
+               } else if (i == this.field_150868_h - 1 && !this.field_150867_a.func_180495_p(blockpos.func_177972_a(this.field_150866_c)).isPortalFrame(field_150867_a, blockpos.func_177972_a(this.field_150866_c))) {
                   break label56;
                }
             }
          }
 
          for(int j = 0; j < this.field_150868_h; ++j) {
-            if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).func_203425_a(Blocks.field_150343_Z)) {
+            if (!this.field_150867_a.func_180495_p(this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g)).isPortalFrame(field_150867_a, this.field_150861_f.func_177967_a(this.field_150866_c, j).func_177981_b(this.field_150862_g))) {
                this.field_150862_g = 0;
                break;
             }
