--- a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
+++ b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
@@ -8,6 +8,12 @@
 import net.minecraft.world.level.block.Blocks;
 import net.minecraft.world.level.levelgen.feature.configurations.WorldGenFeatureEmptyConfiguration;
 
+// CraftBukkit start
+import java.util.List;
+import org.bukkit.block.BlockState;
+import org.bukkit.event.world.PortalCreateEvent;
+// CraftBukkit end
+
 public class EndPlatformFeature extends WorldGenerator<WorldGenFeatureEmptyConfiguration> {
 
     public EndPlatformFeature(Codec<WorldGenFeatureEmptyConfiguration> codec) {
@@ -21,6 +27,13 @@
     }
 
     public static void createEndPlatform(WorldAccess worldaccess, BlockPosition blockposition, boolean flag) {
+        createEndPlatform(worldaccess, blockposition, flag, null);
+        // CraftBukkit start
+    }
+
+    public static void createEndPlatform(WorldAccess worldaccess, BlockPosition blockposition, boolean flag, Entity entity) {
+        org.bukkit.craftbukkit.util.BlockStateListPopulator blockList = new org.bukkit.craftbukkit.util.BlockStateListPopulator(worldaccess);
+        // CraftBukkit end
         BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
 
         for (int i = -2; i <= 2; ++i) {
@@ -29,16 +42,36 @@
                     BlockPosition.MutableBlockPosition blockposition_mutableblockposition1 = blockposition_mutableblockposition.set(blockposition).move(j, k, i);
                     Block block = k == -1 ? Blocks.OBSIDIAN : Blocks.AIR;
 
-                    if (!worldaccess.getBlockState(blockposition_mutableblockposition1).is(block)) {
+                    // CraftBukkit start
+                    if (!blockList.getBlockState(blockposition_mutableblockposition1).is(block)) {
                         if (flag) {
-                            worldaccess.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null);
+                            blockList.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null);
                         }
 
-                        worldaccess.setBlock(blockposition_mutableblockposition1, block.defaultBlockState(), 3);
+                        blockList.setBlock(blockposition_mutableblockposition1, block.defaultBlockState(), 3);
+                        // CraftBukkit end
                     }
                 }
             }
         }
+        // CraftBukkit start
+        // SPIGOT-7746: Entity will only be null during world generation, which is async, so just generate without event
+        if (entity != null) {
+            org.bukkit.World bworld = worldaccess.getLevel().getWorld();
+            PortalCreateEvent portalEvent = new PortalCreateEvent((List<BlockState>) (List) blockList.getList(), bworld, entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
+
+            worldaccess.getLevel().getCraftServer().getPluginManager().callEvent(portalEvent);
+            if (portalEvent.isCancelled()) {
+                return;
+            }
+        }
+
+        // SPIGOT-7856: End platform not dropping items after replacing blocks
+        if (flag) {
+            blockList.getList().forEach((state) -> worldaccess.destroyBlock(state.getPosition(), true, null));
+        }
+        blockList.updateList();
+        // CraftBukkit end
 
     }
 }
