Rename AndroidConfig to PlayerConfig
This commit is contained in:
parent
cfd6b101d8
commit
c3b2681e89
@ -43,7 +43,7 @@ import ru.dbotthepony.mc.otm.client.render.blockentity.MatterBatteryBankRenderer
|
||||
import ru.dbotthepony.mc.otm.compat.curios.isCuriosLoaded
|
||||
import ru.dbotthepony.mc.otm.compat.curios.onCuriosSlotModifiersUpdated
|
||||
import ru.dbotthepony.mc.otm.compat.vanilla.MatteryChestMenu
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.config.CablesConfig
|
||||
import ru.dbotthepony.mc.otm.config.ClientConfig
|
||||
import ru.dbotthepony.mc.otm.config.ExopackConfig
|
||||
@ -170,7 +170,7 @@ object OverdriveThatMatters {
|
||||
ClientConfig.register(container)
|
||||
ServerConfig.register(container)
|
||||
CablesConfig.register(container)
|
||||
AndroidConfig.register(container)
|
||||
PlayerConfig.register(container)
|
||||
ExopackConfig.register(container)
|
||||
ItemsConfig.register(container)
|
||||
MachinesConfig.register(container)
|
||||
|
@ -9,7 +9,7 @@ import net.minecraft.network.chat.ComponentSerialization
|
||||
import net.neoforged.bus.api.IEventBus
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.client.ShiftPressedCond
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.core.TextComponent
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.core.util.formatPower
|
||||
@ -29,14 +29,14 @@ object AndroidResearchDescriptions {
|
||||
|
||||
val ENDER_TELEPORTER: AndroidResearchDescription.Singleton by registrar.register("ender_teleporter") {
|
||||
AndroidResearchDescription.singleton {
|
||||
TranslatableComponent("otm.gui.power_cost_per_use", AndroidConfig.EnderTeleporter.ENERGY_COST.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
TranslatableComponent("otm.gui.power_cost_per_use", PlayerConfig.EnderTeleporter.ENERGY_COST.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
}
|
||||
|
||||
val FALL_DAMPENERS: AndroidResearchDescription.Leveled by registrar.register("fall_dampeners") {
|
||||
AndroidResearchDescription.Leveled { _, list, level ->
|
||||
list.add(TranslatableComponent("otm.fall_dampeners.description",
|
||||
TextComponent("%.1f".format((AndroidConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_P * level).toFloat().coerceIn(0f, 1f) * 100f)).withStyle(ChatFormatting.YELLOW),
|
||||
TextComponent("%.1f".format((AndroidConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_F * level).toFloat())).withStyle(ChatFormatting.YELLOW),
|
||||
TextComponent("%.1f".format((PlayerConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_P * level).toFloat().coerceIn(0f, 1f) * 100f)).withStyle(ChatFormatting.YELLOW),
|
||||
TextComponent("%.1f".format((PlayerConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_F * level).toFloat())).withStyle(ChatFormatting.YELLOW),
|
||||
)) }
|
||||
}
|
||||
|
||||
@ -44,20 +44,20 @@ object AndroidResearchDescriptions {
|
||||
AndroidResearchDescription.Leveled { _, list, level ->
|
||||
list.add(TranslatableComponent(
|
||||
"android_research.overdrive_that_matters.swim_boosters.description",
|
||||
TextComponent("%.1f".format(AndroidConfig.SWIM_BOOSTERS * (1 + level) * 100.0)).withStyle(ChatFormatting.YELLOW)
|
||||
TextComponent("%.1f".format(PlayerConfig.SWIM_BOOSTERS * (1 + level) * 100.0)).withStyle(ChatFormatting.YELLOW)
|
||||
)) }
|
||||
}
|
||||
|
||||
val ITEM_MAGNET: AndroidResearchDescription.Singleton by registrar.register("item_magnet") {
|
||||
AndroidResearchDescription.singleton { TranslatableComponent("otm.gui.power_cost_per_tick", AndroidConfig.Magnet.POWER_DRAW.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
AndroidResearchDescription.singleton { TranslatableComponent("otm.gui.power_cost_per_tick", PlayerConfig.Magnet.POWER_DRAW.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
}
|
||||
|
||||
val JUMP_BOOST: AndroidResearchDescription.Singleton by registrar.register("jump_boost") {
|
||||
AndroidResearchDescription.singleton { TranslatableComponent("otm.gui.power_cost_per_use", AndroidConfig.JumpBoost.ENERGY_COST.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
AndroidResearchDescription.singleton { TranslatableComponent("otm.gui.power_cost_per_use", PlayerConfig.JumpBoost.ENERGY_COST.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
}
|
||||
|
||||
val SHOCKWAVE: AndroidResearchDescription.Singleton by registrar.register("shockwave") {
|
||||
AndroidResearchDescription.singleton { TranslatableComponent("otm.gui.power_cost_per_use", AndroidConfig.Shockwave.ENERGY_COST.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
AndroidResearchDescription.singleton { TranslatableComponent("otm.gui.power_cost_per_use", PlayerConfig.Shockwave.ENERGY_COST.formatPower(formatAsReadable = ShiftPressedCond).copy().withStyle(ChatFormatting.YELLOW)) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ import ru.dbotthepony.mc.otm.client.render.MGUIGraphics
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.client.render.linesIgnoreZRenderType
|
||||
import ru.dbotthepony.mc.otm.client.render.sprites.sprite
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.core.ResourceLocation
|
||||
import ru.dbotthepony.mc.otm.core.genericPositions
|
||||
import ru.dbotthepony.mc.otm.core.holder
|
||||
@ -60,10 +60,10 @@ class EnderTeleporterFeature(capability: MatteryPlayer) : AndroidActiveFeature(A
|
||||
private set
|
||||
|
||||
override val maxCooldown: Int
|
||||
get() = AndroidConfig.EnderTeleporter.COOLDOWN
|
||||
get() = PlayerConfig.EnderTeleporter.COOLDOWN
|
||||
|
||||
private fun canUse(): Boolean {
|
||||
return !isOnCooldown && android.androidEnergy.extractEnergyExact(AndroidConfig.EnderTeleporter.ENERGY_COST, true)
|
||||
return !isOnCooldown && android.androidEnergy.extractEnergyExact(PlayerConfig.EnderTeleporter.ENERGY_COST, true)
|
||||
}
|
||||
|
||||
private fun isValidGround(blockPos: BlockPos): Boolean {
|
||||
@ -112,14 +112,14 @@ class EnderTeleporterFeature(capability: MatteryPlayer) : AndroidActiveFeature(A
|
||||
}
|
||||
|
||||
private fun tryToPhaseThroughWall(blockPos: BlockPos, normal: Vec3i): TraceResult? {
|
||||
val phasedBlocks = ArrayList<BlockPos>(AndroidConfig.EnderTeleporter.MAX_PHASE_DISTANCE)
|
||||
val phasedBlocks = ArrayList<BlockPos>(PlayerConfig.EnderTeleporter.MAX_PHASE_DISTANCE)
|
||||
phasedBlocks.add(blockPos)
|
||||
|
||||
for (extend in 1 .. AndroidConfig.EnderTeleporter.MAX_PHASE_DISTANCE) {
|
||||
for (extend in 1 .. PlayerConfig.EnderTeleporter.MAX_PHASE_DISTANCE) {
|
||||
val pos = blockPos + normal * extend
|
||||
|
||||
if (isAirGap(pos)) {
|
||||
for (y in 0 .. AndroidConfig.EnderTeleporter.MAX_PHASE_DISTANCE - extend) {
|
||||
for (y in 0 .. PlayerConfig.EnderTeleporter.MAX_PHASE_DISTANCE - extend) {
|
||||
val newPos = BlockPos(pos.x, pos.y - y, pos.z)
|
||||
|
||||
if (isValidPosition(newPos)) {
|
||||
@ -142,7 +142,7 @@ class EnderTeleporterFeature(capability: MatteryPlayer) : AndroidActiveFeature(A
|
||||
|
||||
val result = ply.level().clip(ClipContext(
|
||||
headPosition,
|
||||
headPosition + aimVector * (AndroidConfig.EnderTeleporter.MAX_DISTANCE * 2.0),
|
||||
headPosition + aimVector * (PlayerConfig.EnderTeleporter.MAX_DISTANCE * 2.0),
|
||||
ClipContext.Block.COLLIDER,
|
||||
ClipContext.Fluid.NONE,
|
||||
ply
|
||||
@ -158,7 +158,7 @@ class EnderTeleporterFeature(capability: MatteryPlayer) : AndroidActiveFeature(A
|
||||
!ply.isShiftKeyDown &&
|
||||
result.direction == Direction.UP &&
|
||||
isValidPosition(result.blockPos.above()) &&
|
||||
shortestDistanceBetween(testPositions, result.blockPos.above().asVector()) <= AndroidConfig.EnderTeleporter.MAX_DISTANCE
|
||||
shortestDistanceBetween(testPositions, result.blockPos.above().asVector()) <= PlayerConfig.EnderTeleporter.MAX_DISTANCE
|
||||
) {
|
||||
return TraceResult(result.blockPos.above())
|
||||
}
|
||||
@ -216,14 +216,14 @@ class EnderTeleporterFeature(capability: MatteryPlayer) : AndroidActiveFeature(A
|
||||
if (!isAirGap(pos)) {
|
||||
phasedBlocks++
|
||||
|
||||
if (phasedBlocks >= AndroidConfig.EnderTeleporter.MAX_PHASE_DISTANCE) {
|
||||
if (phasedBlocks >= PlayerConfig.EnderTeleporter.MAX_PHASE_DISTANCE) {
|
||||
break
|
||||
}
|
||||
|
||||
phasedBlocksList.add(pos)
|
||||
}
|
||||
|
||||
if (shortestDistanceBetween(testPositions, pos.asVector()) > AndroidConfig.EnderTeleporter.MAX_DISTANCE) {
|
||||
if (shortestDistanceBetween(testPositions, pos.asVector()) > PlayerConfig.EnderTeleporter.MAX_DISTANCE) {
|
||||
break
|
||||
}
|
||||
|
||||
@ -270,14 +270,14 @@ class EnderTeleporterFeature(capability: MatteryPlayer) : AndroidActiveFeature(A
|
||||
if (!isAirGap(pos)) {
|
||||
phasedBlocks++
|
||||
|
||||
if (phasedBlocks >= AndroidConfig.EnderTeleporter.MAX_PHASE_DISTANCE) {
|
||||
if (phasedBlocks >= PlayerConfig.EnderTeleporter.MAX_PHASE_DISTANCE) {
|
||||
break
|
||||
}
|
||||
|
||||
phasedBlocksList.add(pos)
|
||||
}
|
||||
|
||||
if (shortestDistanceBetween(testPositions, pos.asVector()) > AndroidConfig.EnderTeleporter.MAX_DISTANCE) {
|
||||
if (shortestDistanceBetween(testPositions, pos.asVector()) > PlayerConfig.EnderTeleporter.MAX_DISTANCE) {
|
||||
break
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ class EnderTeleporterFeature(capability: MatteryPlayer) : AndroidActiveFeature(A
|
||||
|
||||
putOnCooldown()
|
||||
lastTeleport = ply.server!!.tickCount
|
||||
android.androidEnergy.extractEnergy(AndroidConfig.EnderTeleporter.ENERGY_COST, false)
|
||||
android.androidEnergy.extractEnergy(PlayerConfig.EnderTeleporter.ENERGY_COST, false)
|
||||
|
||||
ply.level().playSound(null, ply, SoundEvents.ENDERMAN_TELEPORT, SoundSource.PLAYERS, 0.3f, 0.8f + ply.level().random.nextFloat() * 0.4f)
|
||||
ply.teleportTo(event.targetX, event.targetY, event.targetZ)
|
||||
|
@ -4,7 +4,7 @@ import net.minecraft.server.level.ServerPlayer
|
||||
import net.neoforged.neoforge.event.entity.living.LivingIncomingDamageEvent
|
||||
import ru.dbotthepony.mc.otm.android.AndroidFeature
|
||||
import ru.dbotthepony.mc.otm.player.MatteryPlayer
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.core.isFall
|
||||
import ru.dbotthepony.mc.otm.registry.game.AndroidFeatures
|
||||
import ru.dbotthepony.mc.otm.triggers.FallDampenersSaveTrigger
|
||||
@ -12,8 +12,8 @@ import ru.dbotthepony.mc.otm.triggers.FallDampenersSaveTrigger
|
||||
class FallDampenersFeature(capability: MatteryPlayer) : AndroidFeature(AndroidFeatures.FALL_DAMPENERS, capability) {
|
||||
override fun onHurt(event: LivingIncomingDamageEvent) {
|
||||
if (event.source.isFall) {
|
||||
val reduction = (AndroidConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_P * (level + 1)).toFloat().coerceIn(0f, 1f)
|
||||
val flat = (AndroidConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_F * (level + 1)).toFloat().coerceIn(0f, Float.MAX_VALUE)
|
||||
val reduction = (PlayerConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_P * (level + 1)).toFloat().coerceIn(0f, 1f)
|
||||
val flat = (PlayerConfig.FALL_DAMAGE_REDUCTION_PER_LEVEL_F * (level + 1)).toFloat().coerceIn(0f, Float.MAX_VALUE)
|
||||
|
||||
val old = event.amount
|
||||
event.amount = ((event.amount - flat) * (1f - reduction)).coerceAtLeast(0f)
|
||||
|
@ -11,7 +11,7 @@ import net.neoforged.neoforge.network.PacketDistributor
|
||||
import net.neoforged.neoforge.network.handling.IPayloadContext
|
||||
import ru.dbotthepony.kommons.math.RGBAColor
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
|
||||
import ru.dbotthepony.mc.otm.player.MatteryPlayer
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyExact
|
||||
@ -76,13 +76,13 @@ class ItemMagnetFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(An
|
||||
private val clientPredicate = Predicate<Entity> { it is ItemEntity && (datatable[it] ?: SharedItemEntityData.EMPTY).let { !it.hasPickupDelay && (it.owner == null || it.owner != ply.uuid || it.lifespan - it.age <= 200) } }
|
||||
|
||||
private fun doTick(server: Boolean) {
|
||||
if (ply.isSpectator || server && !android.androidEnergy.extractEnergyExact(AndroidConfig.Magnet.POWER_DRAW, true)) {
|
||||
if (ply.isSpectator || server && !android.androidEnergy.extractEnergyExact(PlayerConfig.Magnet.POWER_DRAW, true)) {
|
||||
return
|
||||
}
|
||||
|
||||
val entities = ply.level().getEntitiesInEllipsoid(
|
||||
ply.position,
|
||||
Vector(AndroidConfig.Magnet.RADIUS_HORIZONTAL, AndroidConfig.Magnet.RADIUS_VERTICAL, AndroidConfig.Magnet.RADIUS_HORIZONTAL),
|
||||
Vector(PlayerConfig.Magnet.RADIUS_HORIZONTAL, PlayerConfig.Magnet.RADIUS_VERTICAL, PlayerConfig.Magnet.RADIUS_HORIZONTAL),
|
||||
if (server) Predicate<Entity> { it is ItemEntity } else clientPredicate
|
||||
)
|
||||
|
||||
@ -101,7 +101,7 @@ class ItemMagnetFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(An
|
||||
if (data.position.distanceToSqr(ent.position) < 1.0) {
|
||||
data.ticksSinceActivity++
|
||||
} else {
|
||||
if (!android.androidEnergy.extractEnergyExact(AndroidConfig.Magnet.POWER_DRAW, false)) {
|
||||
if (!android.androidEnergy.extractEnergyExact(PlayerConfig.Magnet.POWER_DRAW, false)) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ class ItemMagnetFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(An
|
||||
override fun tickClient() {
|
||||
super.tickClient()
|
||||
|
||||
if (!ply.isSpectator && isActive && android.androidEnergy.extractEnergyExact(AndroidConfig.Magnet.POWER_DRAW, true)) {
|
||||
if (!ply.isSpectator && isActive && android.androidEnergy.extractEnergyExact(PlayerConfig.Magnet.POWER_DRAW, true)) {
|
||||
doTick(false)
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import ru.dbotthepony.mc.otm.player.MatteryPlayer
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyExact
|
||||
import ru.dbotthepony.mc.otm.client.render.MGUIGraphics
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.config.ClientConfig
|
||||
import ru.dbotthepony.mc.otm.core.math.Vector
|
||||
import ru.dbotthepony.mc.otm.core.math.plus
|
||||
@ -24,7 +24,7 @@ class JumpBoostFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
private var tickCooldownClient = false
|
||||
|
||||
override val maxCooldown: Int
|
||||
get() = (AndroidConfig.JumpBoost.BASE_COOLDOWN - AndroidConfig.JumpBoost.COOLDOWN_REDUCTION * level).coerceAtLeast(0)
|
||||
get() = (PlayerConfig.JumpBoost.BASE_COOLDOWN - PlayerConfig.JumpBoost.COOLDOWN_REDUCTION * level).coerceAtLeast(0)
|
||||
|
||||
override var cooldown by syncher.int(setter = setter@{ access, value ->
|
||||
access.accept(value)
|
||||
@ -46,8 +46,8 @@ class JumpBoostFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
val old = lastGround
|
||||
lastGround = ply.onGround()
|
||||
|
||||
if (isActive && cooldown <= 0 && old != lastGround && !lastGround && isJumping && isShifting && ply.xRot <= ClientConfig.JUMP_BOOST_LOOK_ANGLE && android.androidEnergy.extractEnergyExact(AndroidConfig.JumpBoost.ENERGY_COST, true)) {
|
||||
ply.deltaMovement += Vector(0.0, AndroidConfig.JumpBoost.POWER * (level + 1) / 20.0, 0.0)
|
||||
if (isActive && cooldown <= 0 && old != lastGround && !lastGround && isJumping && isShifting && ply.xRot <= ClientConfig.JUMP_BOOST_LOOK_ANGLE && android.androidEnergy.extractEnergyExact(PlayerConfig.JumpBoost.ENERGY_COST, true)) {
|
||||
ply.deltaMovement += Vector(0.0, PlayerConfig.JumpBoost.POWER * (level + 1) / 20.0, 0.0)
|
||||
putOnCooldown()
|
||||
PacketDistributor.sendToServer(TriggerJumpBoostPacket)
|
||||
|
||||
|
@ -5,7 +5,7 @@ import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.level.GameRules
|
||||
import net.neoforged.neoforge.event.entity.living.LivingIncomingDamageEvent
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.android.AndroidFeature
|
||||
import ru.dbotthepony.mc.otm.player.MatteryPlayer
|
||||
import ru.dbotthepony.mc.otm.registry.game.AndroidFeatures
|
||||
@ -21,16 +21,16 @@ class NanobotsRegenerationFeature(android: MatteryPlayer) : AndroidFeature(Andro
|
||||
if (ply.isHurt && ply.level().gameRules.getBoolean(GameRules.RULE_NATURAL_REGENERATION)) {
|
||||
ticksPassed++
|
||||
|
||||
val waitTime = AndroidConfig.NanobotsRegeneration.COOLDOWN.getOrElse(healTicks) { AndroidConfig.NanobotsRegeneration.COOLDOWN.last() }
|
||||
val waitTime = PlayerConfig.NanobotsRegeneration.COOLDOWN.getOrElse(healTicks) { PlayerConfig.NanobotsRegeneration.COOLDOWN.last() }
|
||||
|
||||
if (ticksPassed > waitTime) {
|
||||
val missingHealth = (ply.maxHealth - ply.health).coerceAtMost(2f)
|
||||
val power = AndroidConfig.NanobotsRegeneration.ENERGY_PER_HITPOINT * missingHealth
|
||||
val power = PlayerConfig.NanobotsRegeneration.ENERGY_PER_HITPOINT * missingHealth
|
||||
val extracted = android.androidEnergy.extractEnergy(power, false)
|
||||
|
||||
if (extracted.isPositive) {
|
||||
healTicks = (healTicks + 1).coerceAtMost(level)
|
||||
val healed = (extracted / AndroidConfig.NanobotsRegeneration.ENERGY_PER_HITPOINT).toFloat()
|
||||
val healed = (extracted / PlayerConfig.NanobotsRegeneration.ENERGY_PER_HITPOINT).toFloat()
|
||||
ply.heal(healed)
|
||||
(ply as ServerPlayer?)?.awardStat(StatNames.HEALTH_REGENERATED, (healed * 10f).roundToInt())
|
||||
ticksPassed = 0
|
||||
|
@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.player.MatteryPlayer
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyExact
|
||||
import ru.dbotthepony.mc.otm.client.render.MGUIGraphics
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.registry.game.AndroidFeatures
|
||||
|
||||
class NightVisionFeature(android: MatteryPlayer) : AndroidSwitchableFeature(AndroidFeatures.NIGHT_VISION, android) {
|
||||
@ -19,7 +19,7 @@ class NightVisionFeature(android: MatteryPlayer) : AndroidSwitchableFeature(Andr
|
||||
if (isActive) {
|
||||
val effect = android.ply.activeEffectsMap[MobEffects.NIGHT_VISION]
|
||||
|
||||
if ((effect == null || effect.duration < 220) && (ply.isSpectator || android.androidEnergy.extractEnergyExact(AndroidConfig.NIGHT_VISION_POWER_DRAW, false))) {
|
||||
if ((effect == null || effect.duration < 220) && (ply.isSpectator || android.androidEnergy.extractEnergyExact(PlayerConfig.NIGHT_VISION_POWER_DRAW, false))) {
|
||||
android.ply.addEffect(MobEffectInstance(MobEffects.NIGHT_VISION, 220, 0, false, false))
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import ru.dbotthepony.mc.otm.player.MatteryPlayer
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyExact
|
||||
import ru.dbotthepony.mc.otm.client.render.MGUIGraphics
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.core.damageType
|
||||
import ru.dbotthepony.mc.otm.core.getEntitiesInEllipsoid
|
||||
import ru.dbotthepony.mc.otm.core.getExplosionResistance
|
||||
@ -37,7 +37,7 @@ import kotlin.math.roundToInt
|
||||
|
||||
class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(AndroidFeatures.SHOCKWAVE, capability) {
|
||||
override val maxCooldown: Int
|
||||
get() = AndroidConfig.Shockwave.COOLDOWN
|
||||
get() = PlayerConfig.Shockwave.COOLDOWN
|
||||
|
||||
private var wasMidair = false
|
||||
private var highestSpeed = 0.0
|
||||
@ -52,18 +52,18 @@ class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
isActive &&
|
||||
ply.isShiftKeyDown &&
|
||||
!isOnCooldown &&
|
||||
android.androidEnergy.extractEnergyExact(AndroidConfig.Shockwave.ENERGY_COST, true) &&
|
||||
android.androidEnergy.extractEnergyExact(PlayerConfig.Shockwave.ENERGY_COST, true) &&
|
||||
ply.deltaMovement.y < -0.01 &&
|
||||
creativeFlightTicks == 0
|
||||
) {
|
||||
ply.deltaMovement += Vector(0.0, -AndroidConfig.Shockwave.ACCELERATION / 20.0, 0.0)
|
||||
ply.deltaMovement += Vector(0.0, -PlayerConfig.Shockwave.ACCELERATION / 20.0, 0.0)
|
||||
}
|
||||
|
||||
ticker(true)
|
||||
}
|
||||
|
||||
fun shockwave() {
|
||||
if (ply.isSpectator || isOnCooldown || !android.androidEnergy.extractEnergyExact(AndroidConfig.Shockwave.ENERGY_COST, false)) {
|
||||
if (ply.isSpectator || isOnCooldown || !android.androidEnergy.extractEnergyExact(PlayerConfig.Shockwave.ENERGY_COST, false)) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -86,14 +86,14 @@ class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
// TODO: raycasting
|
||||
val entities = ply.level().getEntitiesInEllipsoid(
|
||||
ply.position,
|
||||
Vector(AndroidConfig.Shockwave.RADIUS_HORIZONTAL, AndroidConfig.Shockwave.RADIUS_VERTICAL, AndroidConfig.Shockwave.RADIUS_HORIZONTAL),
|
||||
Vector(PlayerConfig.Shockwave.RADIUS_HORIZONTAL, PlayerConfig.Shockwave.RADIUS_VERTICAL, PlayerConfig.Shockwave.RADIUS_HORIZONTAL),
|
||||
except = ply,
|
||||
) { (it !is LivingEntity || !it.isSpectator && it.isAlive) }
|
||||
|
||||
val wardens = ply.level().getEntitiesInEllipsoid(
|
||||
Warden::class.java,
|
||||
ply.position,
|
||||
Vector(AndroidConfig.Shockwave.RADIUS_HORIZONTAL_WARDEN, AndroidConfig.Shockwave.RADIUS_VERTICAL_WARDEN, AndroidConfig.Shockwave.RADIUS_HORIZONTAL_WARDEN),
|
||||
Vector(PlayerConfig.Shockwave.RADIUS_HORIZONTAL_WARDEN, PlayerConfig.Shockwave.RADIUS_VERTICAL_WARDEN, PlayerConfig.Shockwave.RADIUS_HORIZONTAL_WARDEN),
|
||||
) { true }
|
||||
|
||||
val seen = ReferenceArraySet<Entity>()
|
||||
@ -103,7 +103,7 @@ class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
val multiplier = (1.0 - distanceMultiplier).pow(0.5)
|
||||
|
||||
val source = MatteryDamageSource(ply.level().registryAccess().damageType(MDamageTypes.SHOCKWAVE), ply)
|
||||
val damage = multiplier.toFloat() * AndroidConfig.Shockwave.DAMAGE.toFloat() * AndroidConfig.Shockwave.WARDEN_DAMAGE_MULT.toFloat()
|
||||
val damage = multiplier.toFloat() * PlayerConfig.Shockwave.DAMAGE.toFloat() * PlayerConfig.Shockwave.WARDEN_DAMAGE_MULT.toFloat()
|
||||
entity.hurt(source, damage)
|
||||
entity.deltaMovement += (entity.position - ply.position).normalize() * (multiplier * 3.0)
|
||||
|
||||
@ -119,7 +119,7 @@ class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
// don't hurt items, arrows, etc etc
|
||||
if (entity is LivingEntity) {
|
||||
val source = MatteryDamageSource(ply.level().registryAccess().damageType(MDamageTypes.SHOCKWAVE), ply)
|
||||
val damage = multiplier.toFloat() * AndroidConfig.Shockwave.DAMAGE.toFloat()
|
||||
val damage = multiplier.toFloat() * PlayerConfig.Shockwave.DAMAGE.toFloat()
|
||||
entity.hurt(source, damage)
|
||||
entity.deltaMovement += (entity.position - ply.position).normalize() * (multiplier * 3.0)
|
||||
|
||||
@ -132,10 +132,10 @@ class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
}
|
||||
}
|
||||
|
||||
if (AndroidConfig.Shockwave.BREAK_BLOCKS) {
|
||||
if (PlayerConfig.Shockwave.BREAK_BLOCKS) {
|
||||
val rounded = ply.position.roundToIntVector()
|
||||
|
||||
for (blockPos in getEllipsoidBlockPositions(AndroidConfig.Shockwave.RADIUS_HORIZONTAL.roundToInt(), AndroidConfig.Shockwave.RADIUS_VERTICAL.roundToInt(), AndroidConfig.Shockwave.RADIUS_HORIZONTAL.roundToInt())) {
|
||||
for (blockPos in getEllipsoidBlockPositions(PlayerConfig.Shockwave.RADIUS_HORIZONTAL.roundToInt(), PlayerConfig.Shockwave.RADIUS_VERTICAL.roundToInt(), PlayerConfig.Shockwave.RADIUS_HORIZONTAL.roundToInt())) {
|
||||
val newBlockPos = blockPos + rounded
|
||||
|
||||
val blockState = ply.level().getBlockState(newBlockPos)
|
||||
@ -168,7 +168,7 @@ class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
!ply.isSpectator &&
|
||||
isActive &&
|
||||
!isOnCooldown &&
|
||||
android.androidEnergy.extractEnergyExact(AndroidConfig.Shockwave.ENERGY_COST, true) &&
|
||||
android.androidEnergy.extractEnergyExact(PlayerConfig.Shockwave.ENERGY_COST, true) &&
|
||||
creativeFlightTicks == 0
|
||||
) {
|
||||
val old = wasMidair
|
||||
@ -178,7 +178,7 @@ class ShockwaveFeature(capability: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
highestSpeed = (-ply.deltaMovement.y).coerceAtLeast(highestSpeed)
|
||||
}
|
||||
|
||||
if (old != wasMidair && !wasMidair && AndroidConfig.Shockwave.TERMINAL_VELOCITY <= (highestSpeed * 20.0) && ply.isShiftKeyDown) {
|
||||
if (old != wasMidair && !wasMidair && PlayerConfig.Shockwave.TERMINAL_VELOCITY <= (highestSpeed * 20.0) && ply.isShiftKeyDown) {
|
||||
if (isClient) {
|
||||
// I HATE SELF-UPDATING PLAYERS
|
||||
// I HATE SELF-UPDATING PLAYERS
|
||||
|
@ -6,7 +6,7 @@ import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
|
||||
import ru.dbotthepony.mc.otm.player.MatteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.render.MGUIGraphics
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.kommons.math.RGBAColor
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.core.ResourceLocation
|
||||
@ -20,7 +20,7 @@ class SwimBoostersFeature(android: MatteryPlayer) : AndroidSwitchableFeature(And
|
||||
val attr = ply.getAttribute(NeoForgeMod.SWIM_SPEED) ?: return
|
||||
|
||||
attr.removeModifier(MODIFIER_ID)
|
||||
attr.addPermanentModifier(AttributeModifier(MODIFIER_ID, (level + 1) * AndroidConfig.SWIM_BOOSTERS, AttributeModifier.Operation.ADD_VALUE))
|
||||
attr.addPermanentModifier(AttributeModifier(MODIFIER_ID, (level + 1) * PlayerConfig.SWIM_BOOSTERS, AttributeModifier.Operation.ADD_VALUE))
|
||||
}
|
||||
|
||||
override fun removeModifiers() {
|
||||
|
@ -7,7 +7,7 @@ import com.mojang.blaze3d.vertex.VertexFormat
|
||||
import net.minecraft.client.renderer.GameRenderer
|
||||
import net.neoforged.neoforge.client.event.RenderLevelStageEvent
|
||||
import org.lwjgl.opengl.GL11.GL_LESS
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.core.math.Vector
|
||||
import ru.dbotthepony.mc.otm.core.math.component1
|
||||
import ru.dbotthepony.mc.otm.core.math.component2
|
||||
@ -74,6 +74,6 @@ object ShockwaveRenderer {
|
||||
}
|
||||
|
||||
fun handle(packet: ShockwaveEffectPacket) {
|
||||
State(packet.pos, AndroidConfig.Shockwave.RADIUS_HORIZONTAL.toFloat())
|
||||
State(packet.pos, PlayerConfig.Shockwave.RADIUS_HORIZONTAL.toFloat())
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import ru.dbotthepony.kommons.util.getValue
|
||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.math.defineDecimal
|
||||
|
||||
object AndroidConfig : AbstractConfig("androids") {
|
||||
object PlayerConfig : AbstractConfig("player") {
|
||||
val REGENERATE_ENERGY: Boolean by builder
|
||||
.comment("If (technically) hunger is above threshold, it turns into energy")
|
||||
.comment("This setting controls whenever to regenerate small amount of energy while eating as Android")
|
@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.player.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.MatteryGUI
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.client.render.GlitchRenderer
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.core.ResourceLocation
|
||||
import ru.dbotthepony.mc.otm.core.readComponent
|
||||
import ru.dbotthepony.mc.otm.core.writeComponent
|
||||
@ -366,7 +366,7 @@ object TriggerJumpBoostPacket : CustomPacketPayload {
|
||||
|
||||
val feature = mattery.getFeature(AndroidFeatures.JUMP_BOOST) ?: return
|
||||
|
||||
if (feature.isActive && feature.cooldown <= 4 && mattery.androidEnergy.extractEnergyExact(AndroidConfig.JumpBoost.ENERGY_COST, false)) {
|
||||
if (feature.isActive && feature.cooldown <= 4 && mattery.androidEnergy.extractEnergyExact(PlayerConfig.JumpBoost.ENERGY_COST, false)) {
|
||||
feature.putOnCooldown()
|
||||
|
||||
context.player().level().playSound(
|
||||
|
@ -78,7 +78,7 @@ import ru.dbotthepony.mc.otm.capability.energy.extractEnergyExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.receiveEnergyExact
|
||||
import ru.dbotthepony.mc.otm.capability.receiveEnergy
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.config.AndroidConfig
|
||||
import ru.dbotthepony.mc.otm.config.PlayerConfig
|
||||
import ru.dbotthepony.mc.otm.config.ExopackConfig
|
||||
import ru.dbotthepony.mc.otm.container.CombinedContainer
|
||||
import ru.dbotthepony.mc.otm.container.DynamicallyProxiedContainer
|
||||
@ -561,7 +561,7 @@ class MatteryPlayer(val ply: Player) {
|
||||
/**
|
||||
* [IMatteryEnergyStorage] instance, representing Android' battery charge
|
||||
*/
|
||||
val androidEnergy = BatteryBackedEnergyStorage(ply, syncher, AndroidConfig.ANDROID_MAX_ENERGY, AndroidConfig.ANDROID_MAX_ENERGY, true)
|
||||
val androidEnergy = BatteryBackedEnergyStorage(ply, syncher, PlayerConfig.ANDROID_MAX_ENERGY, PlayerConfig.ANDROID_MAX_ENERGY, true)
|
||||
|
||||
/**
|
||||
* [IMatteryEnergyStorage] instance, representing Exopack battery charge
|
||||
@ -659,8 +659,8 @@ class MatteryPlayer(val ply: Player) {
|
||||
shouldPlaySound = false
|
||||
iteration = 0
|
||||
deathLog.clear()
|
||||
androidEnergy.batteryLevel = AndroidConfig.ANDROID_MAX_ENERGY
|
||||
androidEnergy.maxBatteryLevel = AndroidConfig.ANDROID_MAX_ENERGY
|
||||
androidEnergy.batteryLevel = PlayerConfig.ANDROID_MAX_ENERGY
|
||||
androidEnergy.maxBatteryLevel = PlayerConfig.ANDROID_MAX_ENERGY
|
||||
|
||||
lastLiquidPosition = ply.position()
|
||||
wasInLiquid = false
|
||||
@ -714,7 +714,7 @@ class MatteryPlayer(val ply: Player) {
|
||||
iteration = 0
|
||||
deathLog.clear()
|
||||
androidEnergy.batteryLevel = Decimal.ZERO
|
||||
androidEnergy.maxBatteryLevel = AndroidConfig.ANDROID_MAX_ENERGY
|
||||
androidEnergy.maxBatteryLevel = PlayerConfig.ANDROID_MAX_ENERGY
|
||||
dropBattery()
|
||||
|
||||
lastLiquidPosition = ply.position()
|
||||
@ -1215,26 +1215,26 @@ class MatteryPlayer(val ply: Player) {
|
||||
}
|
||||
|
||||
val stats = ply.foodData
|
||||
val fourTimesTheHunger = AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT * 4
|
||||
val fourTimesTheHunger = PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT * 4
|
||||
|
||||
// истощение
|
||||
if (stats.exhaustionLevel > 0f) {
|
||||
val extracted = androidEnergy.extractEnergy(AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT * (stats.exhaustionLevel / 4f), false)
|
||||
stats.setExhaustion(stats.exhaustionLevel - (extracted / AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT).toFloat() * 4f)
|
||||
val extracted = androidEnergy.extractEnergy(PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT * (stats.exhaustionLevel / 4f), false)
|
||||
stats.setExhaustion(stats.exhaustionLevel - (extracted / PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT).toFloat() * 4f)
|
||||
}
|
||||
|
||||
// Обычный голод
|
||||
while (
|
||||
stats.foodLevel < 18 &&
|
||||
androidEnergy.batteryLevel >= fourTimesTheHunger &&
|
||||
androidEnergy.extractEnergyExact(AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT, false)
|
||||
androidEnergy.extractEnergyExact(PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT, false)
|
||||
) {
|
||||
stats.foodLevel++
|
||||
}
|
||||
|
||||
// "поглощение" излишек голода, как при мирном режиме, так и при поедании обычной еды
|
||||
if (AndroidConfig.REGENERATE_ENERGY) {
|
||||
while (stats.foodLevel > 18 && androidEnergy.receiveEnergyExact(AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT / 2, false)) {
|
||||
if (PlayerConfig.REGENERATE_ENERGY) {
|
||||
while (stats.foodLevel > 18 && androidEnergy.receiveEnergyExact(PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT / 2, false)) {
|
||||
stats.foodLevel--
|
||||
}
|
||||
} else if (ply.level().difficulty != Difficulty.PEACEFUL) {
|
||||
@ -1245,22 +1245,22 @@ class MatteryPlayer(val ply: Player) {
|
||||
|
||||
// насыщение
|
||||
if (stats.saturationLevel < foodLevel && androidEnergy.batteryLevel >= fourTimesTheHunger) {
|
||||
val extracted = androidEnergy.extractEnergy(AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT * (foodLevel - stats.saturationLevel), false)
|
||||
stats.setSaturation(stats.saturationLevel + (extracted / AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT).toFloat())
|
||||
val extracted = androidEnergy.extractEnergy(PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT * (foodLevel - stats.saturationLevel), false)
|
||||
stats.setSaturation(stats.saturationLevel + (extracted / PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT).toFloat())
|
||||
}
|
||||
|
||||
if (androidEnergy.batteryLevel <= Decimal.TEN && !ply.isCreative && ply.level().difficulty != Difficulty.PEACEFUL) {
|
||||
if (stats.saturationLevel > 1f) {
|
||||
if (androidEnergy.receiveEnergyExact(AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT, false)) {
|
||||
if (androidEnergy.receiveEnergyExact(PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT, false)) {
|
||||
stats.setSaturation(stats.saturationLevel - 1f)
|
||||
}
|
||||
} else if (stats.saturationLevel > 0f) {
|
||||
val received = androidEnergy.receiveEnergy(AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT * stats.saturationLevel, false)
|
||||
stats.setSaturation(stats.saturationLevel - (received / AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT).toFloat())
|
||||
val received = androidEnergy.receiveEnergy(PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT * stats.saturationLevel, false)
|
||||
stats.setSaturation(stats.saturationLevel - (received / PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT).toFloat())
|
||||
} else if (stats.foodLevel > 0) {
|
||||
// так как голод не тикает для андроидов, "умереть с голоду" мы не можем
|
||||
// но со стороны будет выглядеть как будто мы умираем с голода
|
||||
if (androidEnergy.receiveEnergyExact(AndroidConfig.ANDROID_ENERGY_PER_HUNGER_POINT, false)) {
|
||||
if (androidEnergy.receiveEnergyExact(PlayerConfig.ANDROID_ENERGY_PER_HUNGER_POINT, false)) {
|
||||
stats.foodLevel--
|
||||
}
|
||||
}
|
||||
@ -1281,11 +1281,11 @@ class MatteryPlayer(val ply: Player) {
|
||||
|
||||
if (ply.isHurt && ply.level().gameRules.getBoolean(GameRules.RULE_NATURAL_REGENERATION)) {
|
||||
if (--nextHealTick <= 0) {
|
||||
nextHealTick = if (ply.level().difficulty == Difficulty.PEACEFUL) 10 else AndroidConfig.TIME_BETWEEN_NATURAL_REGENERATION
|
||||
nextHealTick = if (ply.level().difficulty == Difficulty.PEACEFUL) 10 else PlayerConfig.TIME_BETWEEN_NATURAL_REGENERATION
|
||||
ply.heal(1f)
|
||||
}
|
||||
} else {
|
||||
nextHealTick = if (ply.level().difficulty == Difficulty.PEACEFUL) 10 else AndroidConfig.TIME_BETWEEN_NATURAL_REGENERATION
|
||||
nextHealTick = if (ply.level().difficulty == Difficulty.PEACEFUL) 10 else PlayerConfig.TIME_BETWEEN_NATURAL_REGENERATION
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1476,8 +1476,8 @@ class MatteryPlayer(val ply: Player) {
|
||||
ply.matteryPlayer.shouldSendIteration = true
|
||||
ply.matteryPlayer.deathLog.addLast(ply.tickCount to ply.combatTracker.deathMessage)
|
||||
|
||||
if (ply.matteryPlayer.androidEnergy.batteryLevel < AndroidConfig.ANDROID_MAX_ENERGY * Decimal("0.2"))
|
||||
ply.matteryPlayer.androidEnergy.batteryLevel = AndroidConfig.ANDROID_MAX_ENERGY * Decimal("0.2") // если смерть была от разряда батареи, то предотвращаем софтлок
|
||||
if (ply.matteryPlayer.androidEnergy.batteryLevel < PlayerConfig.ANDROID_MAX_ENERGY * Decimal("0.2"))
|
||||
ply.matteryPlayer.androidEnergy.batteryLevel = PlayerConfig.ANDROID_MAX_ENERGY * Decimal("0.2") // если смерть была от разряда батареи, то предотвращаем софтлок
|
||||
|
||||
while (ply.matteryPlayer.deathLog.size > 6) {
|
||||
ply.matteryPlayer.deathLog.removeFirst()
|
||||
|
Loading…
Reference in New Issue
Block a user