--- a/net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece.java
@@ -24,6 +24,7 @@
 import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
 
 public class SwampHutPiece extends ScatteredFeaturePiece {
+
     private boolean spawnedWitch;
     private boolean spawnedCat;
 
@@ -68,35 +69,38 @@
             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);
 
-            for(int i = 2; i <= 7; i += 5) {
-                for(int j = 1; j <= 5; j += 4) {
+            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) {
                     this.fillColumnDown(world, Blocks.OAK_LOG.defaultBlockState(), j, -1, i, chunkBox);
                 }
             }
 
             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.5D, (double)blockPos.getY(), (double)blockPos.getZ() + 0.5D, 0.0F, 0.0F);
-                        witch.finalizeSpawn(world, world.getCurrentDifficultyAt(blockPos), MobSpawnType.STRUCTURE, (SpawnGroupData)null, (CompoundTag)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, (CompoundTag) null);
+                        world.addFreshEntityWithPassengers(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
                     }
                 }
             }
@@ -107,15 +111,17 @@
 
     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.5D, (double)blockPos.getY(), (double)blockPos.getZ() + 0.5D, 0.0F, 0.0F);
-                    cat.finalizeSpawn(world, world.getCurrentDifficultyAt(blockPos), MobSpawnType.STRUCTURE, (SpawnGroupData)null, (CompoundTag)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, (CompoundTag) null);
+                    world.addFreshEntityWithPassengers(entitycat, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
                 }
             }
         }
