Skip to content

Commit 5f6ead8

Browse files
committed
Fix EntityHelpers not spawning any entities
Closes CyclopsMC/EvilCraft#1239 Regression due to CyclopsMC/EvilCraft#1102
1 parent 46a88ab commit 5f6ead8

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

loader-neoforge/src/main/java/org/cyclops/cyclopscore/helper/EntityHelpers.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
import net.minecraft.core.Vec3i;
55
import net.minecraft.nbt.CompoundTag;
66
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.*;
138
import net.minecraft.world.entity.player.Player;
149
import net.minecraft.world.level.Level;
1510
import net.minecraft.world.level.ServerLevelAccessor;
@@ -88,12 +83,9 @@ public static Optional<Entity> spawnEntity(Level world, @Nullable ResourceLocati
8883
* @return If the entity was spawned.
8984
*/
9085
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;
9789
}
9890

9991
/**

0 commit comments

Comments
 (0)