From 1ee2760a4450c9835acd170ca3d063d915f14da4 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 29 Sep 2022 20:42:09 +0700 Subject: [PATCH] Spin direction variable name --- .../block/entity/blackhole/BlackHoleBlockEntity.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt index cb2989694..23d1ada44 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt @@ -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