--- a/net/minecraft/world/level/portal/BlockPortalShape.java
+++ b/net/minecraft/world/level/portal/BlockPortalShape.java
@@ -22,6 +22,11 @@
 import net.minecraft.world.phys.shapes.VoxelShape;
 import net.minecraft.world.phys.shapes.VoxelShapes;
 
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftPortalEvent;
+import org.bukkit.event.world.PortalCreateEvent;
+// CraftBukkit end
+
 public class BlockPortalShape {
 
     private static final int MIN_WIDTH = 2;
@@ -41,6 +46,7 @@
     private BlockPosition bottomLeft;
     private int height;
     private final int width;
+    org.bukkit.craftbukkit.util.BlockStateListPopulator blocks; // CraftBukkit - add field
 
     public static Optional<BlockPortalShape> findEmptyPortalShape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
         return findPortalShape(generatoraccess, blockposition, (blockportalshape) -> {
@@ -61,6 +67,7 @@
     }
 
     public BlockPortalShape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
+        blocks = new org.bukkit.craftbukkit.util.BlockStateListPopulator(generatoraccess.getMinecraftWorld()); // CraftBukkit
         this.level = generatoraccess;
         this.axis = enumdirection_enumaxis;
         this.rightDir = enumdirection_enumaxis == EnumDirection.EnumAxis.X ? EnumDirection.WEST : EnumDirection.SOUTH;
@@ -105,6 +112,7 @@
 
             if (!isEmpty(iblockdata)) {
                 if (BlockPortalShape.FRAME.test(iblockdata, this.level, blockposition_mutableblockposition)) {
+                    blocks.setBlock(blockposition_mutableblockposition, iblockdata, 18); // CraftBukkit - lower left / right
                     return i;
                 }
                 break;
@@ -115,6 +123,7 @@
             if (!BlockPortalShape.FRAME.test(iblockdata1, this.level, blockposition_mutableblockposition)) {
                 break;
             }
+            blocks.setBlock(blockposition_mutableblockposition, iblockdata1, 18); // CraftBukkit - bottom row
         }
 
         return 0;
@@ -134,6 +143,7 @@
             if (!BlockPortalShape.FRAME.test(this.level.getBlockState(blockposition_mutableblockposition1), this.level, blockposition_mutableblockposition1)) {
                 return false;
             }
+            blocks.setBlock(blockposition_mutableblockposition1, this.level.getBlockState(blockposition_mutableblockposition1), 18); // CraftBukkit - upper row
         }
 
         return true;
@@ -163,6 +173,10 @@
                     ++this.numPortalBlocks;
                 }
             }
+            // CraftBukkit start - left and right
+            blocks.setBlock(blockposition_mutableblockposition.set(this.bottomLeft).move(EnumDirection.UP, i).move(this.rightDir, -1), this.level.getBlockState(blockposition_mutableblockposition), 18);
+            blocks.setBlock(blockposition_mutableblockposition.set(this.bottomLeft).move(EnumDirection.UP, i).move(this.rightDir, this.width), this.level.getBlockState(blockposition_mutableblockposition), 18);
+            // CraftBukkit end
         }
 
         return 21;
@@ -176,12 +190,28 @@
         return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
     }
 
-    public void createPortalBlocks() {
+    // CraftBukkit start - return boolean
+    public boolean createPortalBlocks() {
+        org.bukkit.World bworld = this.level.getMinecraftWorld().getWorld();
+
+        // Copy below for loop
         IBlockData iblockdata = (IBlockData) Blocks.NETHER_PORTAL.defaultBlockState().setValue(BlockPortal.AXIS, this.axis);
 
         BlockPosition.betweenClosed(this.bottomLeft, this.bottomLeft.relative(EnumDirection.UP, this.height - 1).relative(this.rightDir, this.width - 1)).forEach((blockposition) -> {
+            blocks.setBlock(blockposition, iblockdata, 18);
+        });
+
+        PortalCreateEvent event = new PortalCreateEvent((java.util.List<org.bukkit.block.BlockState>) (java.util.List) blocks.getList(), bworld, null, PortalCreateEvent.CreateReason.FIRE);
+        this.level.getMinecraftWorld().getServer().server.getPluginManager().callEvent(event);
+
+        if (event.isCancelled()) {
+            return false;
+        }
+        // CraftBukkit end
+        BlockPosition.betweenClosed(this.bottomLeft, this.bottomLeft.relative(EnumDirection.UP, this.height - 1).relative(this.rightDir, this.width - 1)).forEach((blockposition) -> {
             this.level.setBlock(blockposition, iblockdata, 18);
         });
+        return true; // CraftBukkit
     }
 
     public boolean isComplete() {
@@ -217,7 +247,7 @@
         return new Vec3D(d3, d2, d4);
     }
 
-    public static ShapeDetectorShape createPortalInfo(WorldServer worldserver, BlockUtil.Rectangle blockutil_rectangle, EnumDirection.EnumAxis enumdirection_enumaxis, Vec3D vec3d, Entity entity, Vec3D vec3d1, float f, float f1) {
+    public static ShapeDetectorShape createPortalInfo(WorldServer worldserver, BlockUtil.Rectangle blockutil_rectangle, EnumDirection.EnumAxis enumdirection_enumaxis, Vec3D vec3d, Entity entity, Vec3D vec3d1, float f, float f1, CraftPortalEvent portalEventInfo) { // CraftBukkit
         BlockPosition blockposition = blockutil_rectangle.minCorner;
         IBlockData iblockdata = worldserver.getBlockState(blockposition);
         EnumDirection.EnumAxis enumdirection_enumaxis1 = (EnumDirection.EnumAxis) iblockdata.getOptionalValue(BlockProperties.HORIZONTAL_AXIS).orElse(EnumDirection.EnumAxis.X);
@@ -233,7 +263,7 @@
         Vec3D vec3d3 = new Vec3D((double) blockposition.getX() + (flag ? d2 : d4), (double) blockposition.getY() + d3, (double) blockposition.getZ() + (flag ? d4 : d2));
         Vec3D vec3d4 = findCollisionFreePosition(vec3d3, worldserver, entity, entitysize);
 
-        return new ShapeDetectorShape(vec3d4, vec3d2, f + (float) i, f1);
+        return new ShapeDetectorShape(vec3d4, vec3d2, f + (float) i, f1, worldserver, portalEventInfo); // CraftBukkit
     }
 
     private static Vec3D findCollisionFreePosition(Vec3D vec3d, WorldServer worldserver, Entity entity, EntitySize entitysize) {
