From 866776dc74d42875862f04ee84215cdc9e9e1f0c Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 3 Mar 2025 17:59:50 +0700 Subject: [PATCH 1/2] =?UTF-8?q?YuRaNnNzZZ=20=E2=80=94=20=D0=A1=D0=B5=D0=B3?= =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D1=8F,=20=D0=B2=2017:57=20=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=BE=D0=BD=20=D0=BF=D1=80=D0=BE=D0=B4=D0=BE=D0=BB=D0=B6=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=20=D0=BC=D0=B5=D0=BD=D1=8F=20=D0=B7=D0=B0=D1=80?= =?UTF-8?q?=D1=8F=D0=B6=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt index d037adba9..a648ef9ef 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt @@ -35,6 +35,7 @@ class AndroidChargerBlockEntity(blockPos: BlockPos, blockState: BlockState) : Ma override fun tick() { super.tick() + if (redstoneControl.isBlockedByRedstone) return val level = level ?: return var available = energyConfig.energy.extractEnergy(energyConfig.energy.batteryLevel, true) if (!available.isPositive) return From 362c3bd931b6eaa17654fdbedae3900495b2ee52 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 3 Mar 2025 18:01:03 +0700 Subject: [PATCH 2/2] Shuffle entities in vicinity of android charger, so all players around it will get charged more or less equally --- .../mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt index a648ef9ef..3c687d365 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AndroidChargerBlockEntity.kt @@ -17,6 +17,8 @@ import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage import ru.dbotthepony.mc.otm.capability.matteryPlayer import ru.dbotthepony.mc.otm.config.MachinesConfig import ru.dbotthepony.mc.otm.core.getEntitiesInEllipsoid +import ru.dbotthepony.mc.otm.core.otmRandom +import ru.dbotthepony.mc.otm.core.shuffle import ru.dbotthepony.mc.otm.menu.tech.AndroidChargerMenu import ru.dbotthepony.mc.otm.registry.game.MBlockEntities @@ -42,7 +44,7 @@ class AndroidChargerBlockEntity(blockPos: BlockPos, blockState: BlockState) : Ma val ents = level.getEntitiesInEllipsoid(blockPos.center, Vec3(MachinesConfig.AndroidCharger.RADIUS_WIDTH, MachinesConfig.AndroidCharger.RADIUS_HEIGHT, MachinesConfig.AndroidCharger.RADIUS_WIDTH)) { it is Player } - ents.sort() + ents.shuffle(level.otmRandom) for ((ent) in ents) { val ply = (ent as Player).matteryPlayer