Skip to content

Commit

Permalink
rename RegisterSpawnPlacementsEvent usages. Fixes #8156
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Jul 9, 2024
1 parent bdbc095 commit 86e28de
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import net.minecraft.world.level.levelgen.Heightmap;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent;
import net.neoforged.neoforge.event.entity.SpawnPlacementRegisterEvent;
import net.neoforged.neoforge.event.entity.RegisterSpawnPlacementsEvent;
import org.jetbrains.annotations.NotNull;

public class EntityTypeDeferredRegister extends MekanismDeferredRegister<EntityType<?>> {
Expand All @@ -39,12 +39,12 @@ public <ENTITY extends Monster> MekanismDeferredHolder<EntityType<?>, EntityType
public <ENTITY extends LivingEntity> MekanismDeferredHolder<EntityType<?>, EntityType<ENTITY>> registerBasicPlacement(String name,
Supplier<EntityType.Builder<ENTITY>> builder, Supplier<AttributeSupplier.Builder> attributes, SpawnPlacements.SpawnPredicate<ENTITY> placementPredicate) {
return register(name, builder, attributes, SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, placementPredicate,
SpawnPlacementRegisterEvent.Operation.AND);
RegisterSpawnPlacementsEvent.Operation.AND);
}

public <ENTITY extends LivingEntity> MekanismDeferredHolder<EntityType<?>, EntityType<ENTITY>> register(String name, Supplier<EntityType.Builder<ENTITY>> builder,
Supplier<AttributeSupplier.Builder> attributes, @Nullable SpawnPlacementType placementType, @Nullable Heightmap.Types heightmap,
SpawnPlacements.SpawnPredicate<ENTITY> placementPredicate, SpawnPlacementRegisterEvent.Operation placementOperation) {
SpawnPlacements.SpawnPredicate<ENTITY> placementPredicate, RegisterSpawnPlacementsEvent.Operation placementOperation) {
MekanismDeferredHolder<EntityType<?>, EntityType<ENTITY>> entityTypeRO = register(name, builder, attributes);
livingEntityPlacements.put(entityTypeRO, new SpawnPlacementData<>(placementType, heightmap, placementPredicate, placementOperation));
return entityTypeRO;
Expand Down Expand Up @@ -81,7 +81,7 @@ private void registerEntityAttributes(EntityAttributeCreationEvent event) {
}
}

private void registerPlacements(SpawnPlacementRegisterEvent event) {
private void registerPlacements(RegisterSpawnPlacementsEvent event) {
if (livingEntityPlacements == null) {
Mekanism.logger.error("Entity Placements have already been set. This should not happen.");
} else {
Expand All @@ -96,9 +96,9 @@ private void registerPlacements(SpawnPlacementRegisterEvent event) {

private record SpawnPlacementData<ENTITY extends LivingEntity>(@Nullable SpawnPlacementType placementType, @Nullable Heightmap.Types heightmap,
SpawnPlacements.SpawnPredicate<ENTITY> predicate,
SpawnPlacementRegisterEvent.Operation operation) {
RegisterSpawnPlacementsEvent.Operation operation) {

private void register(SpawnPlacementRegisterEvent event, EntityType<?> entityType) {
private void register(RegisterSpawnPlacementsEvent event, EntityType<?> entityType) {
event.register((EntityType<ENTITY>) entityType, placementType, heightmap, predicate, operation);
}
}
Expand Down

0 comments on commit 86e28de

Please sign in to comment.