--- a/net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece.java
@@ -6,6 +6,7 @@
 import net.minecraft.util.RandomSource;
 import net.minecraft.world.entity.EntityType;
 import net.minecraft.world.entity.MobSpawnType;
+import net.minecraft.world.entity.SpawnGroupData;
 import net.minecraft.world.entity.animal.Cat;
 import net.minecraft.world.entity.monster.Witch;
 import net.minecraft.world.level.ChunkPos;
@@ -23,6 +24,7 @@
 import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
 
 public class SwampHutPiece extends ScatteredFeaturePiece {
+
     private boolean spawnedWitch;
     private boolean spawnedCat;
 
@@ -44,15 +46,7 @@
     }
 
     @Override
-    public void postProcess(
-        WorldGenLevel world,
-        StructureManager structureAccessor,
-        ChunkGenerator chunkGenerator,
-        RandomSource random,
-        BoundingBox chunkBox,
-        ChunkPos chunkPos,
-        BlockPos pivot
-    ) {
+    public void postProcess(WorldGenLevel world, StructureManager structureAccessor, ChunkGenerator chunkGenerator, RandomSource random, BoundingBox chunkBox, ChunkPos chunkPos, BlockPos pivot) {
         if (this.updateAverageGroundHeight(world, chunkBox, 0)) {
             this.generateBox(world, chunkBox, 1, 1, 1, 5, 1, 7, Blocks.SPRUCE_PLANKS.defaultBlockState(), Blocks.SPRUCE_PLANKS.defaultBlockState(), false);
             this.generateBox(world, chunkBox, 1, 4, 2, 5, 4, 7, Blocks.SPRUCE_PLANKS.defaultBlockState(), Blocks.SPRUCE_PLANKS.defaultBlockState(), false);
@@ -75,18 +69,19 @@
             this.placeBlock(world, Blocks.CAULDRON.defaultBlockState(), 4, 2, 6, chunkBox);
             this.placeBlock(world, Blocks.OAK_FENCE.defaultBlockState(), 1, 2, 1, chunkBox);
             this.placeBlock(world, Blocks.OAK_FENCE.defaultBlockState(), 5, 2, 1, chunkBox);
-            BlockState blockState = Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.NORTH);
-            BlockState blockState2 = Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.EAST);
-            BlockState blockState3 = Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.WEST);
-            BlockState blockState4 = Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.SOUTH);
-            this.generateBox(world, chunkBox, 0, 4, 1, 6, 4, 1, blockState, blockState, false);
-            this.generateBox(world, chunkBox, 0, 4, 2, 0, 4, 7, blockState2, blockState2, false);
-            this.generateBox(world, chunkBox, 6, 4, 2, 6, 4, 7, blockState3, blockState3, false);
-            this.generateBox(world, chunkBox, 0, 4, 8, 6, 4, 8, blockState4, blockState4, false);
-            this.placeBlock(world, blockState.setValue(StairBlock.SHAPE, StairsShape.OUTER_RIGHT), 0, 4, 1, chunkBox);
-            this.placeBlock(world, blockState.setValue(StairBlock.SHAPE, StairsShape.OUTER_LEFT), 6, 4, 1, chunkBox);
-            this.placeBlock(world, blockState4.setValue(StairBlock.SHAPE, StairsShape.OUTER_LEFT), 0, 4, 8, chunkBox);
-            this.placeBlock(world, blockState4.setValue(StairBlock.SHAPE, StairsShape.OUTER_RIGHT), 6, 4, 8, chunkBox);
+            BlockState iblockdata = (BlockState) Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.NORTH);
+            BlockState iblockdata1 = (BlockState) Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.EAST);
+            BlockState iblockdata2 = (BlockState) Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.WEST);
+            BlockState iblockdata3 = (BlockState) Blocks.SPRUCE_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.SOUTH);
+
+            this.generateBox(world, chunkBox, 0, 4, 1, 6, 4, 1, iblockdata, iblockdata, false);
+            this.generateBox(world, chunkBox, 0, 4, 2, 0, 4, 7, iblockdata1, iblockdata1, false);
+            this.generateBox(world, chunkBox, 6, 4, 2, 6, 4, 7, iblockdata2, iblockdata2, false);
+            this.generateBox(world, chunkBox, 0, 4, 8, 6, 4, 8, iblockdata3, iblockdata3, false);
+            this.placeBlock(world, (BlockState) iblockdata.setValue(StairBlock.SHAPE, StairsShape.OUTER_RIGHT), 0, 4, 1, chunkBox);
+            this.placeBlock(world, (BlockState) iblockdata.setValue(StairBlock.SHAPE, StairsShape.OUTER_LEFT), 6, 4, 1, chunkBox);
+            this.placeBlock(world, (BlockState) iblockdata3.setValue(StairBlock.SHAPE, StairsShape.OUTER_LEFT), 0, 4, 8, chunkBox);
+            this.placeBlock(world, (BlockState) iblockdata3.setValue(StairBlock.SHAPE, StairsShape.OUTER_RIGHT), 6, 4, 8, chunkBox);
 
             for (int i = 2; i <= 7; i += 5) {
                 for (int j = 1; j <= 5; j += 4) {
@@ -95,15 +90,17 @@
             }
 
             if (!this.spawnedWitch) {
-                BlockPos blockPos = this.getWorldPos(2, 2, 5);
-                if (chunkBox.isInside(blockPos)) {
+                BlockPos.MutableBlockPos blockposition_mutableblockposition = this.getWorldPos(2, 2, 5);
+
+                if (chunkBox.isInside(blockposition_mutableblockposition)) {
                     this.spawnedWitch = true;
-                    Witch witch = EntityType.WITCH.create(world.getLevel());
-                    if (witch != null) {
-                        witch.setPersistenceRequired();
-                        witch.moveTo((double)blockPos.getX() + 0.5, (double)blockPos.getY(), (double)blockPos.getZ() + 0.5, 0.0F, 0.0F);
-                        witch.finalizeSpawn(world, world.getCurrentDifficultyAt(blockPos), MobSpawnType.STRUCTURE, null);
-                        world.addFreshEntityWithPassengers(witch);
+                    Witch entitywitch = (Witch) EntityType.WITCH.create(world.getLevel());
+
+                    if (entitywitch != null) {
+                        entitywitch.setPersistenceRequired();
+                        entitywitch.moveTo((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
+                        entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(blockposition_mutableblockposition), MobSpawnType.STRUCTURE, (SpawnGroupData) null);
+                        world.addFreshEntityWithPassengers(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
                     }
                 }
             }
@@ -114,17 +111,20 @@
 
     private void spawnCat(ServerLevelAccessor world, BoundingBox box) {
         if (!this.spawnedCat) {
-            BlockPos blockPos = this.getWorldPos(2, 2, 5);
-            if (box.isInside(blockPos)) {
+            BlockPos.MutableBlockPos blockposition_mutableblockposition = this.getWorldPos(2, 2, 5);
+
+            if (box.isInside(blockposition_mutableblockposition)) {
                 this.spawnedCat = true;
-                Cat cat = EntityType.CAT.create(world.getLevel());
-                if (cat != null) {
-                    cat.setPersistenceRequired();
-                    cat.moveTo((double)blockPos.getX() + 0.5, (double)blockPos.getY(), (double)blockPos.getZ() + 0.5, 0.0F, 0.0F);
-                    cat.finalizeSpawn(world, world.getCurrentDifficultyAt(blockPos), MobSpawnType.STRUCTURE, null);
-                    world.addFreshEntityWithPassengers(cat);
+                Cat entitycat = (Cat) EntityType.CAT.create(world.getLevel());
+
+                if (entitycat != null) {
+                    entitycat.setPersistenceRequired();
+                    entitycat.moveTo((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
+                    entitycat.finalizeSpawn(world, world.getCurrentDifficultyAt(blockposition_mutableblockposition), MobSpawnType.STRUCTURE, (SpawnGroupData) null);
+                    world.addFreshEntityWithPassengers(entitycat, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
                 }
             }
         }
+
     }
 }
