From 643ca8385131f9f7ba942066009e057076600c1d Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 30 Jan 2023 15:52:59 +0700 Subject: [PATCH] BlockShape.rotateFromNorth and rotateFromSouth --- .../dbotthepony/mc/otm/shapes/BlockShape.java | 23 +++++++++++++++++-- .../mc/otm/block/decorative/EngineBlock.kt | 2 +- .../mc/otm/block/decorative/HoloSignBlock.kt | 2 +- .../mc/otm/block/matter/MatterBottlerBlock.kt | 6 ++--- .../block/matter/MatterCapacitorBankBlock.kt | 6 ++--- .../otm/block/matter/MatterDecomposerBlock.kt | 6 ++--- .../otm/block/matter/MatterRecyclerBlock.kt | 6 ++--- .../otm/block/matter/MatterReplicatorBlock.kt | 6 ++--- .../mc/otm/block/matter/MatterScannerBlock.kt | 6 ++--- .../otm/block/matter/PatternStorageBlock.kt | 6 ++--- .../mc/otm/block/storage/DriveRackBlock.kt | 6 ++--- .../mc/otm/block/storage/DriveViewerBlock.kt | 6 ++--- .../mc/otm/block/storage/ItemMonitorBlock.kt | 6 ++--- .../mc/otm/block/storage/StorageBusBlock.kt | 2 +- .../mc/otm/block/storage/StorageInterfaces.kt | 4 ++-- .../storage/StoragePowerSupplierBlock.kt | 6 ++--- .../mc/otm/block/tech/BatteryBankBlock.kt | 6 ++--- .../otm/block/tech/ChemicalGeneratorBlock.kt | 6 ++--- .../mc/otm/block/tech/EnergyCounterBlock.kt | 2 +- .../mc/otm/block/tech/EnergyServoBlock.kt | 12 +++++----- .../block/tech/GravitationStabilizerBlock.kt | 12 +++++----- .../otm/block/tech/PhantomAttractorBlock.kt | 2 +- .../mc/otm/block/tech/PlatePressBlock.kt | 6 ++--- 23 files changed, 82 insertions(+), 63 deletions(-) diff --git a/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java b/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java index 225b5afdc..daadec952 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java +++ b/src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShape.java @@ -5,6 +5,7 @@ import net.minecraft.core.Direction; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +import ru.dbotthepony.mc.otm.core.math.BlockRotation; import javax.annotation.ParametersAreNonnullByDefault; @@ -47,7 +48,7 @@ public record BlockShape(SimpleCuboid ...shapes) { return new BlockShape(list); } - public BlockShape rotate(Direction dir) { + public BlockShape rotateFromSouth(Direction dir) { if (dir == Direction.SOUTH) return this; @@ -69,7 +70,7 @@ public record BlockShape(SimpleCuboid ...shapes) { return this; } - public BlockShape rotateInv(Direction dir) { + public BlockShape rotateFromNorth(Direction dir) { if (dir == Direction.SOUTH) return rotateAroundY(Math.PI); @@ -91,6 +92,24 @@ public record BlockShape(SimpleCuboid ...shapes) { return this; } + public BlockShape rotateFromNorth(BlockRotation dir) { + var result = rotateFromNorth(dir.getFront()); + + if (dir.getTop() != Direction.DOWN && dir.getTop() != Direction.UP) + result = result.rotateFromNorth(dir.getTop()); + + return result; + } + + public BlockShape rotateFromSouth(BlockRotation dir) { + var result = rotateFromSouth(dir.getFront()); + + if (dir.getTop() != Direction.DOWN && dir.getTop() != Direction.UP) + result = result.rotateFromSouth(dir.getTop()); + + return result; + } + public VoxelShape computeShape() { VoxelShape final_shape = shapes[0].getShape(); diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt index 43b24a62e..9590835f8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt @@ -18,7 +18,7 @@ class EngineBlock : RotatableMatteryBlock(Properties.of(Material.METAL, DyeColor } private val shapes = getShapeForEachState { - BlockShapes.ENGINE.rotateInv(it[rotationProperty].front).computeShape() + BlockShapes.ENGINE.rotateFromNorth(it[rotationProperty].front).computeShape() } override fun getShape( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt index 124c10eb1..c5c275f34 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt @@ -23,7 +23,7 @@ class HoloSignBlock : RotatableMatteryBlock(), EntityBlock { } private val shapes = getShapeForEachState { - BlockShapes.HOLO_SIGN.rotateInv(it[rotationProperty].front).computeShape() + BlockShapes.HOLO_SIGN.rotateFromNorth(it[rotationProperty]).computeShape() } override fun getShape( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt index dcf6e2cd6..9fbe19b32 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt @@ -76,9 +76,9 @@ class MatterBottlerBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.MATTER_BOTTLER.rotate(Direction.NORTH).computeShape(), - BlockShapes.MATTER_BOTTLER.rotate(Direction.WEST).computeShape(), - BlockShapes.MATTER_BOTTLER.rotate(Direction.EAST).computeShape() + BlockShapes.MATTER_BOTTLER.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.MATTER_BOTTLER.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.MATTER_BOTTLER.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt index 323b3f199..354c80bf3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt @@ -55,9 +55,9 @@ class MatterCapacitorBankBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.MATTER_CAPACITOR_BANK.rotate(Direction.NORTH).computeShape(), - BlockShapes.MATTER_CAPACITOR_BANK.rotate(Direction.WEST).computeShape(), - BlockShapes.MATTER_CAPACITOR_BANK.rotate(Direction.EAST).computeShape() + BlockShapes.MATTER_CAPACITOR_BANK.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.MATTER_CAPACITOR_BANK.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.MATTER_CAPACITOR_BANK.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt index 3adfc867f..d9f7f955d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt @@ -61,9 +61,9 @@ class MatterDecomposerBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.MATTER_DECOMPOSER.rotate(Direction.NORTH).computeShape(), - BlockShapes.MATTER_DECOMPOSER.rotate(Direction.WEST).computeShape(), - BlockShapes.MATTER_DECOMPOSER.rotate(Direction.EAST).computeShape() + BlockShapes.MATTER_DECOMPOSER.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.MATTER_DECOMPOSER.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.MATTER_DECOMPOSER.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt index 34d471188..e1e4d406a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt @@ -60,9 +60,9 @@ class MatterRecyclerBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.MATTER_RECYCLER.rotate(Direction.NORTH).computeShape(), - BlockShapes.MATTER_RECYCLER.rotate(Direction.WEST).computeShape(), - BlockShapes.MATTER_RECYCLER.rotate(Direction.EAST).computeShape() + BlockShapes.MATTER_RECYCLER.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.MATTER_RECYCLER.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.MATTER_RECYCLER.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt index c90943d5d..9219a2cec 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt @@ -60,9 +60,9 @@ class MatterReplicatorBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.MATTER_REPLICATOR.rotate(Direction.NORTH).computeShape(), - BlockShapes.MATTER_REPLICATOR.rotate(Direction.WEST).computeShape(), - BlockShapes.MATTER_REPLICATOR.rotate(Direction.EAST).computeShape() + BlockShapes.MATTER_REPLICATOR.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.MATTER_REPLICATOR.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.MATTER_REPLICATOR.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt index a7efee532..352d218ba 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt @@ -60,9 +60,9 @@ class MatterScannerBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.MATTER_SCANNER.rotate(Direction.NORTH).computeShape(), - BlockShapes.MATTER_SCANNER.rotate(Direction.WEST).computeShape(), - BlockShapes.MATTER_SCANNER.rotate(Direction.EAST).computeShape() + BlockShapes.MATTER_SCANNER.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.MATTER_SCANNER.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.MATTER_SCANNER.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt index 30813617f..cb2a17a62 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt @@ -87,9 +87,9 @@ class PatternStorageBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.PATTERN_STORAGE.rotate(Direction.NORTH).computeShape(), - BlockShapes.PATTERN_STORAGE.rotate(Direction.WEST).computeShape(), - BlockShapes.PATTERN_STORAGE.rotate(Direction.EAST).computeShape() + BlockShapes.PATTERN_STORAGE.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.PATTERN_STORAGE.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.PATTERN_STORAGE.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt index f88f67b5e..0b5f87892 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt @@ -65,9 +65,9 @@ class DriveRackBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.DRIVE_RACK.rotate(Direction.NORTH).computeShape(), - BlockShapes.DRIVE_RACK.rotate(Direction.WEST).computeShape(), - BlockShapes.DRIVE_RACK.rotate(Direction.EAST).computeShape() + BlockShapes.DRIVE_RACK.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.DRIVE_RACK.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.DRIVE_RACK.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt index 45fe6a2bd..4e1c2007b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt @@ -84,9 +84,9 @@ class DriveViewerBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.DRIVE_VIEWER.rotate(Direction.NORTH).computeShape(), - BlockShapes.DRIVE_VIEWER.rotate(Direction.WEST).computeShape(), - BlockShapes.DRIVE_VIEWER.rotate(Direction.EAST).computeShape() + BlockShapes.DRIVE_VIEWER.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.DRIVE_VIEWER.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.DRIVE_VIEWER.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt index 95dfe2786..5a8566257 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt @@ -65,9 +65,9 @@ class ItemMonitorBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.ITEM_MONITOR.rotate(Direction.NORTH).computeShape(), - BlockShapes.ITEM_MONITOR.rotate(Direction.WEST).computeShape(), - BlockShapes.ITEM_MONITOR.rotate(Direction.EAST).computeShape() + BlockShapes.ITEM_MONITOR.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.ITEM_MONITOR.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.ITEM_MONITOR.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt index 544f5d006..d5f054f7f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt @@ -98,7 +98,7 @@ class StorageBusBlock : RotatableMatteryBlock(), EntityBlock { finalShape = Shapes.joinUnoptimized(finalShape, shapes[i], BooleanOp.OR) } - finalShape = Shapes.joinUnoptimized(finalShape, BlockShapes.STORAGE_BUS.rotateInv(it.facingTwo).computeShape(), BooleanOp.OR) + finalShape = Shapes.joinUnoptimized(finalShape, BlockShapes.STORAGE_BUS.rotateFromNorth(it.facingTwo).computeShape(), BooleanOp.OR) return@getShapeForEachState finalShape } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt index 0b8fb51f3..9d333a0db 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt @@ -99,7 +99,7 @@ class StorageImporterBlock : RotatableMatteryBlock(), EntityBlock { finalShape = Shapes.joinUnoptimized(finalShape, shapes[i], BooleanOp.OR) } - finalShape = Shapes.joinUnoptimized(finalShape, BlockShapes.STORAGE_IMPORTER.rotateInv(it.facingTwo).computeShape(), BooleanOp.OR) + finalShape = Shapes.joinUnoptimized(finalShape, BlockShapes.STORAGE_IMPORTER.rotateFromNorth(it.facingTwo).computeShape(), BooleanOp.OR) return@getShapeForEachState finalShape } @@ -203,7 +203,7 @@ class StorageExporterBlock : RotatableMatteryBlock(), EntityBlock { finalShape = Shapes.joinUnoptimized(finalShape, shapes[i], BooleanOp.OR) } - finalShape = Shapes.joinUnoptimized(finalShape, BlockShapes.STORAGE_EXPORTER.rotateInv(it.facingTwo).computeShape(), BooleanOp.OR) + finalShape = Shapes.joinUnoptimized(finalShape, BlockShapes.STORAGE_EXPORTER.rotateFromNorth(it.facingTwo).computeShape(), BooleanOp.OR) return@getShapeForEachState finalShape } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt index e4d59f655..2aad23266 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt @@ -68,9 +68,9 @@ class StoragePowerSupplierBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.STORAGE_POWER_SUPPLIER.rotate(Direction.NORTH).computeShape(), - BlockShapes.STORAGE_POWER_SUPPLIER.rotate(Direction.WEST).computeShape(), - BlockShapes.STORAGE_POWER_SUPPLIER.rotate(Direction.EAST).computeShape() + BlockShapes.STORAGE_POWER_SUPPLIER.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.STORAGE_POWER_SUPPLIER.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.STORAGE_POWER_SUPPLIER.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt index 79496afe2..03c2186ef 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt @@ -107,9 +107,9 @@ class BatteryBankBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.BATTERY_BANK.rotate(Direction.NORTH).computeShape(), - BlockShapes.BATTERY_BANK.rotate(Direction.WEST).computeShape(), - BlockShapes.BATTERY_BANK.rotate(Direction.EAST).computeShape() + BlockShapes.BATTERY_BANK.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.BATTERY_BANK.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.BATTERY_BANK.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt index 473d0c605..c80a29b8a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt @@ -111,9 +111,9 @@ class ChemicalGeneratorBlock : RotatableMatteryBlock(), EntityBlock { def, def, def, - BlockShapes.CHEMICAL_GENERATOR.rotate(Direction.NORTH).computeShape(), - BlockShapes.CHEMICAL_GENERATOR.rotate(Direction.WEST).computeShape(), - BlockShapes.CHEMICAL_GENERATOR.rotate(Direction.EAST).computeShape() + BlockShapes.CHEMICAL_GENERATOR.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.CHEMICAL_GENERATOR.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.CHEMICAL_GENERATOR.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt index 1cebd30df..cb617b551 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt @@ -97,7 +97,7 @@ class EnergyCounterBlock : MatteryBlock(), EntityBlock { } if (input === Direction.UP || input === Direction.DOWN) { - shape = shape.rotateInv(iface) + shape = shape.rotateFromNorth(iface) } else if (input === Direction.EAST || input === Direction.WEST) { when (iface) { Direction.DOWN -> shape = shape.rotateAroundX(Math.PI / 2) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt index ecb5e7ecc..fbce75b0d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt @@ -52,12 +52,12 @@ class EnergyServoBlock : RotatableMatteryBlock(Properties.of(Material.METAL, Mat val def = BlockShapes.ENERGY_SERVO.computeShape() SHAPES = arrayOf( - def, - def, - def, - BlockShapes.ENERGY_SERVO.rotate(Direction.NORTH).computeShape(), - BlockShapes.ENERGY_SERVO.rotate(Direction.WEST).computeShape(), - BlockShapes.ENERGY_SERVO.rotate(Direction.EAST).computeShape() + def, + def, + def, + BlockShapes.ENERGY_SERVO.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.ENERGY_SERVO.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.ENERGY_SERVO.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/GravitationStabilizerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/GravitationStabilizerBlock.kt index b178aba8b..1bfd53e17 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/GravitationStabilizerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/GravitationStabilizerBlock.kt @@ -149,9 +149,9 @@ class BlockGravitationStabilizer : RotatableMatteryBlock(props), EntityBlock { BlockShapes.GRAVITATION_STABILIZER.rotateAroundX(PI / 2).computeShape(), BlockShapes.GRAVITATION_STABILIZER.rotateAroundX(-PI / 2).computeShape(), BlockShapes.GRAVITATION_STABILIZER.computeShape(), - BlockShapes.GRAVITATION_STABILIZER.rotate(Direction.NORTH).computeShape(), - BlockShapes.GRAVITATION_STABILIZER.rotate(Direction.WEST).computeShape(), - BlockShapes.GRAVITATION_STABILIZER.rotate(Direction.EAST).computeShape() + BlockShapes.GRAVITATION_STABILIZER.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.GRAVITATION_STABILIZER.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.GRAVITATION_STABILIZER.rotateFromSouth(Direction.EAST).computeShape() ) fun getBoundingBlock(level: Level, blockState: BlockState, blockPos: BlockPos): BlockState { @@ -220,9 +220,9 @@ class BlockGravitationStabilizerLens : RotatableMatteryBlock(props) { BlockShapes.GRAVITATION_STABILIZER_LENS.rotateAroundX(PI / 2).computeShape(), BlockShapes.GRAVITATION_STABILIZER_LENS.rotateAroundX(-PI / 2).computeShape(), BlockShapes.GRAVITATION_STABILIZER_LENS.computeShape(), - BlockShapes.GRAVITATION_STABILIZER_LENS.rotate(Direction.NORTH).computeShape(), - BlockShapes.GRAVITATION_STABILIZER_LENS.rotate(Direction.WEST).computeShape(), - BlockShapes.GRAVITATION_STABILIZER_LENS.rotate(Direction.EAST).computeShape() + BlockShapes.GRAVITATION_STABILIZER_LENS.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.GRAVITATION_STABILIZER_LENS.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.GRAVITATION_STABILIZER_LENS.rotateFromSouth(Direction.EAST).computeShape() ) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt index b50ce41d4..5dfbb2667 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt @@ -93,7 +93,7 @@ class PhantomAttractorBlock : RotatableMatteryBlock(Properties.of(Material.METAL DoubleBlockHalf.LOWER -> BlockShapes.PHANTOM_ATTRACTOR_BOTTOM } - shape.rotate(it.facingOne).computeShape() + shape.rotateFromSouth(it.facingOne).computeShape() } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt index 4c788677a..8ae695002 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt @@ -74,9 +74,9 @@ class PlatePressBlock(properties: Properties = DEFAULT_PROPERTIES) : RotatableMa def, def, def, - BlockShapes.PLATE_PRESS_IDLE.rotate(Direction.NORTH).computeShape(), - BlockShapes.PLATE_PRESS_IDLE.rotate(Direction.WEST).computeShape(), - BlockShapes.PLATE_PRESS_IDLE.rotate(Direction.EAST).computeShape() + BlockShapes.PLATE_PRESS_IDLE.rotateFromSouth(Direction.NORTH).computeShape(), + BlockShapes.PLATE_PRESS_IDLE.rotateFromSouth(Direction.WEST).computeShape(), + BlockShapes.PLATE_PRESS_IDLE.rotateFromSouth(Direction.EAST).computeShape() ) } }