Spin direction variable name

This commit is contained in:
DBotThePony 2022-09-29 20:42:09 +07:00
parent 5aeef8d6ce
commit 1ee2760a44
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -3,10 +3,6 @@ package ru.dbotthepony.mc.otm.block.entity.blackhole
import net.minecraft.client.Minecraft
import net.minecraft.core.BlockPos
import net.minecraft.nbt.CompoundTag
import net.minecraft.nbt.IntTag
import net.minecraft.network.Connection
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
@ -17,7 +13,6 @@ import net.minecraft.world.level.Explosion
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.entity.BlockEntity
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.levelgen.structure.BoundingBox
import net.minecraft.world.phys.AABB
@ -89,7 +84,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro
private set
private var suppressUpdates = true
var spin_direction = false
var spinDirection = false
private var sleepTicks = 4
@ -157,7 +152,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro
public override fun saveAdditional(nbt: CompoundTag) {
super.saveAdditional(nbt)
nbt["mass"] = mass.serializeNBT()
nbt["spin_direction"] = spin_direction
nbt["spin_direction"] = spinDirection
}
override val synchronizationRadius: Double = 256.0
@ -165,7 +160,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro
override fun load(tag: CompoundTag) {
super.load(tag)
mass = tag.mapIf("mass", ImpreciseFraction::deserializeNBT) ?: BASELINE_MASS
spin_direction = tag.getBoolean("spin_direction")
spinDirection = tag.getBoolean("spin_direction")
}
var affectedBounds = BoundingBox(0, 0, 0, 1, 1, 1)
@ -185,7 +180,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro
living.deltaMovement = living.deltaMovement.add(delta.multiply(mult, mult, mult))
} else {
// Закручивание
val rotate = if (spin_direction) delta.yRot((Math.PI / 2).toFloat()) else delta.yRot((-Math.PI / 2).toFloat())
val rotate = if (spinDirection) delta.yRot((Math.PI / 2).toFloat()) else delta.yRot((-Math.PI / 2).toFloat())
if (weaker)
living.deltaMovement = living.deltaMovement