Update PhantomAttractorBlock
This commit is contained in:
parent
350c1cc0a9
commit
302076b90b
@ -22,13 +22,13 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties
|
||||
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf
|
||||
import net.minecraft.world.level.material.MapColor
|
||||
import net.minecraft.world.level.material.PushReaction
|
||||
import net.minecraft.world.phys.AABB
|
||||
import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import net.minecraftforge.event.ForgeEventFactory
|
||||
import net.neoforged.neoforge.event.EventHooks
|
||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.addSimpleDescription
|
||||
import ru.dbotthepony.mc.otm.block.getShapeForEachState
|
||||
import ru.dbotthepony.mc.otm.core.AABB
|
||||
import ru.dbotthepony.mc.otm.core.get
|
||||
import ru.dbotthepony.mc.otm.core.math.minus
|
||||
import ru.dbotthepony.mc.otm.core.math.plus
|
||||
@ -42,7 +42,6 @@ class PhantomAttractorBlock : RotatableMatteryBlock(Properties.of().mapColor(Map
|
||||
tooltips.needsNoPower()
|
||||
}
|
||||
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
override fun randomTick(
|
||||
blockState: BlockState,
|
||||
level: ServerLevel,
|
||||
@ -68,7 +67,7 @@ class PhantomAttractorBlock : RotatableMatteryBlock(Properties.of().mapColor(Map
|
||||
) {
|
||||
val phantom = EntityType.PHANTOM.create(level) ?: continue
|
||||
phantom.moveTo(spawnPos, 0.0f, 0.0f)
|
||||
groupData = ForgeEventFactory.onFinalizeSpawn(phantom, level, level.getCurrentDifficultyAt(spawnPos), MobSpawnType.SPAWNER, groupData, null)
|
||||
groupData = EventHooks.finalizeMobSpawn(phantom, level, level.getCurrentDifficultyAt(spawnPos), MobSpawnType.SPAWNER, groupData)
|
||||
level.addFreshEntityWithPassengers(phantom)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user