Portable gravitation stabilizer logic

This commit is contained in:
DBotThePony 2022-05-15 21:01:12 +07:00
parent 99340baf30
commit 9bde1932a9
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -9,6 +9,7 @@ import net.minecraft.network.protocol.PacketFlow
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.EquipmentSlot
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.item.ItemEntity
import net.minecraft.world.entity.player.Player
@ -262,7 +263,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn
for (living in level.getEntitiesOfClass(LivingEntity::class.java, affectedBoundsAABB)) {
val distance = living.position().distanceTo(center)
if (living !is Player || !living.abilities.mayfly) {
if (living !is Player || !living.abilities.mayfly && living.getItemBySlot(EquipmentSlot.CHEST).item != MItems.PORTABLE_GRAVITATION_STABILIZER) {
setDeltaMovement(living, center, distance, living !is Player)
}