|
4 | 4 | import net.minecraft.core.Vec3i; |
5 | 5 | import net.minecraft.nbt.CompoundTag; |
6 | 6 | import net.minecraft.resources.ResourceLocation; |
7 | | -import net.minecraft.world.entity.Entity; |
8 | | -import net.minecraft.world.entity.EntityType; |
9 | | -import net.minecraft.world.entity.ExperienceOrb; |
10 | | -import net.minecraft.world.entity.Mob; |
11 | | -import net.minecraft.world.entity.MobSpawnType; |
12 | | -import net.minecraft.world.entity.SpawnGroupData; |
| 7 | +import net.minecraft.world.entity.*; |
13 | 8 | import net.minecraft.world.entity.player.Player; |
14 | 9 | import net.minecraft.world.level.Level; |
15 | 10 | import net.minecraft.world.level.ServerLevelAccessor; |
@@ -88,12 +83,9 @@ public static Optional<Entity> spawnEntity(Level world, @Nullable ResourceLocati |
88 | 83 | * @return If the entity was spawned. |
89 | 84 | */ |
90 | 85 | public static boolean spawnEntity(ServerLevelAccessor world, Mob entityLiving, MobSpawnType spawnReason) { |
91 | | - SpawnGroupData spawnData = EventHooks.finalizeMobSpawn(entityLiving, world, world.getCurrentDifficultyAt(entityLiving.blockPosition()), spawnReason, null); |
92 | | - if (spawnData != null) { |
93 | | - world.addFreshEntity(entityLiving); |
94 | | - return true; |
95 | | - } |
96 | | - return false; |
| 86 | + EventHooks.finalizeMobSpawn(entityLiving, world, world.getCurrentDifficultyAt(entityLiving.blockPosition()), spawnReason, null); |
| 87 | + world.addFreshEntity(entityLiving); |
| 88 | + return true; |
97 | 89 | } |
98 | 90 |
|
99 | 91 | /** |
|
0 commit comments