diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt index e33850f7a..690a40a49 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -17,10 +17,10 @@ import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.registry.Registry import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.MItems -import ru.dbotthepony.mc.otm.block.BlockDriveViewer -import ru.dbotthepony.mc.otm.block.BlockEnergyCounter +import ru.dbotthepony.mc.otm.block.DriveViewerBlock +import ru.dbotthepony.mc.otm.block.EnergyCounterBlock import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable -import ru.dbotthepony.mc.otm.block.BlockPatternStorage +import ru.dbotthepony.mc.otm.block.PatternStorageBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.datagen.blocks.BatteryBankProvider import ru.dbotthepony.mc.otm.datagen.blocks.MatterBankProvider @@ -248,7 +248,7 @@ object DataGen { .rotationY(facing.toYRotBlockstate()) .addModel() .condition(BlockMatteryRotatable.FACING, facing) - .condition(BlockDriveViewer.DRIVE_PRESENT, true) + .condition(DriveViewerBlock.DRIVE_PRESENT, true) for (workState in WorkerState.SEMI_WORKER_STATE.possibleValues) { part() @@ -269,7 +269,7 @@ object DataGen { .rotationY(facing.toYRotBlockstate()) .addModel() .condition(BlockMatteryRotatable.FACING, facing) - .condition(BlockPatternStorage.PATTERN_STORAGE_DISKS_PROPS[i], true) + .condition(PatternStorageBlock.PATTERN_STORAGE_DISKS_PROPS[i], true) } part() @@ -298,28 +298,28 @@ object DataGen { val south_west = provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/energy_counter_south_west")) for (dir in arrayOf(Direction.EAST, Direction.WEST, Direction.SOUTH, Direction.NORTH)) { - part().modelFile(down).rotationY(dir.toYRotBlockstate()).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.UP).condition(BlockEnergyCounter.IF_DIRECTION, dir) - part().modelFile(up).rotationY(dir.toYRotBlockstate()).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.DOWN).condition(BlockEnergyCounter.IF_DIRECTION, dir) + part().modelFile(down).rotationY(dir.toYRotBlockstate()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.UP).condition(EnergyCounterBlock.IF_DIRECTION, dir) + part().modelFile(up).rotationY(dir.toYRotBlockstate()).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.DOWN).condition(EnergyCounterBlock.IF_DIRECTION, dir) } // низкий поклон за полностью рабочий поворот вокруг оси Z - part().modelFile(north).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.UP) - part().modelFile(north_down).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.DOWN) - part().modelFile(north_east).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.EAST) - part().modelFile(north_west).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.NORTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.WEST) + part().modelFile(north).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP) + part().modelFile(north_down).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN) + part().modelFile(north_east).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST) + part().modelFile(north_west).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.NORTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST) - part().modelFile(south).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.UP) - part().modelFile(south_down).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.DOWN) - part().modelFile(south_east).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.EAST) - part().modelFile(south_west).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, Direction.SOUTH).condition(BlockEnergyCounter.IF_DIRECTION, Direction.WEST) + part().modelFile(south).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP) + part().modelFile(south_down).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN) + part().modelFile(south_east).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.EAST) + part().modelFile(south_west).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, Direction.SOUTH).condition(EnergyCounterBlock.IF_DIRECTION, Direction.WEST) for (dir in arrayOf(Direction.WEST, Direction.EAST)) { val mdl = if (dir === Direction.WEST) west else east - part().modelFile(mdl).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.NORTH) - part().modelFile(mdl).rotationX(-90).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.UP) - part().modelFile(mdl).rotationX(180).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.SOUTH) - part().modelFile(mdl).rotationX(90).addModel().condition(BlockEnergyCounter.INPUT_DIRECTION, dir).condition(BlockEnergyCounter.IF_DIRECTION, Direction.DOWN) + part().modelFile(mdl).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.NORTH) + part().modelFile(mdl).rotationX(-90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.UP) + part().modelFile(mdl).rotationX(180).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.SOUTH) + part().modelFile(mdl).rotationX(90).addModel().condition(EnergyCounterBlock.INPUT_DIRECTION, dir).condition(EnergyCounterBlock.IF_DIRECTION, Direction.DOWN) } } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt index 146eb84f5..a327b20a5 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt @@ -4,7 +4,7 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.world.level.block.Block import net.minecraftforge.client.model.generators.BlockStateProvider import net.minecraftforge.forge.event.lifecycle.GatherDataEvent -import ru.dbotthepony.mc.otm.block.BlockBatteryBank +import ru.dbotthepony.mc.otm.block.BatteryBankBlock import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.toYRotBlockstate @@ -35,7 +35,7 @@ open class BatteryBankProvider(event: GatherDataEvent) : BlockStateProvider(even models().getExistingFile(ResourceLocation("overdrive_that_matters:$batteryPath$i")) ).rotationY(it.toYRotBlockstate()).addModel() .condition(BlockMatteryRotatable.FACING, it) - .condition(BlockBatteryBank.BATTERY_SLOTS_PROPS[i], true) + .condition(BatteryBankBlock.BATTERY_SLOTS_PROPS[i], true) } } } diff --git a/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java b/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java index cc0cf4e2b..e328f03c6 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java +++ b/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java @@ -3,14 +3,7 @@ package ru.dbotthepony.mc.otm; import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.event.server.ServerAboutToStartEvent; -import net.minecraftforge.event.server.ServerStoppingEvent; -import net.minecraftforge.eventbus.api.EventPriority; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.LogicalSide; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; @@ -27,7 +20,7 @@ import ru.dbotthepony.mc.otm.client.EventHandler; import ru.dbotthepony.mc.otm.client.model.GravitationStabilizerModel; import ru.dbotthepony.mc.otm.client.model.TritaniumArmorModel; import ru.dbotthepony.mc.otm.core.ImpreciseFraction; -import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive; +import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem; import ru.dbotthepony.mc.otm.matter.MatterDataKt; import ru.dbotthepony.mc.otm.matter.MatterRegistryKt; import ru.dbotthepony.mc.otm.network.MatteryNetworking; @@ -37,10 +30,6 @@ import ru.dbotthepony.mc.otm.storage.StorageObjectRegistry; import ru.dbotthepony.mc.otm.storage.StorageObjectTuple; import javax.annotation.ParametersAreNonnullByDefault; -import java.util.ArrayList; -import java.util.WeakHashMap; -import java.util.function.Consumer; -import java.util.function.Supplier; // The value here should match an entry in the META-INF/mods.toml file @Mod(OverdriveThatMatters.MOD_ID) @@ -90,7 +79,7 @@ public final class OverdriveThatMatters { FMLJavaModLoadingContext.get().getModEventBus().register(MRecipes.class); MinecraftForge.EVENT_BUS.register(DrivePool.INSTANCE); - MinecraftForge.EVENT_BUS.register(ItemPortableCondensationDrive.Companion); + MinecraftForge.EVENT_BUS.register(PortableCondensationDriveItem.Companion); FMLJavaModLoadingContext.get().getModEventBus().addListener(AndroidCapability::registerEffects); diff --git a/src/main/java/ru/dbotthepony/mc/otm/block/BlockMatterCable.java b/src/main/java/ru/dbotthepony/mc/otm/block/BlockMatterCable.java index bdc12da85..e9083d77a 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/block/BlockMatterCable.java +++ b/src/main/java/ru/dbotthepony/mc/otm/block/BlockMatterCable.java @@ -3,9 +3,7 @@ package ru.dbotthepony.mc.otm.block; import com.google.common.collect.ImmutableMap; import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; import net.minecraft.world.level.BlockGetter; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.entity.BlockEntity; @@ -19,7 +17,7 @@ import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterCable; +import ru.dbotthepony.mc.otm.block.entity.MatterCableBlockEntity; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; @@ -31,7 +29,7 @@ public class BlockMatterCable extends Block implements EntityBlock { @Nullable @Override public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { - return new BlockEntityMatterCable(blockPos, blockState); + return new MatterCableBlockEntity(blockPos, blockState); } public static final BooleanProperty CONNECTION_SOUTH = BooleanProperty.create("connect_south"); diff --git a/src/main/java/ru/dbotthepony/mc/otm/client/screen/MatterPanelScreen.java b/src/main/java/ru/dbotthepony/mc/otm/client/screen/MatterPanelScreen.java index 24756d9cd..7c9b18e46 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/client/screen/MatterPanelScreen.java +++ b/src/main/java/ru/dbotthepony/mc/otm/client/screen/MatterPanelScreen.java @@ -9,7 +9,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; import ru.dbotthepony.mc.otm.capability.matter.MatterTask; import ru.dbotthepony.mc.otm.capability.matter.PatternState; -import ru.dbotthepony.mc.otm.menu.MenuMatterPanel; +import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import ru.dbotthepony.mc.otm.network.MatteryNetworking; import ru.dbotthepony.mc.otm.network.PatternReplicationRequestPacket; import ru.dbotthepony.mc.otm.client.screen.panels.*; @@ -19,11 +19,11 @@ import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -public class MatterPanelScreen extends MatteryScreen { +public class MatterPanelScreen extends MatteryScreen { private static final int MODAL_WIDTH = 213; private static final int MODAL_HEIGHT = 110; - public MatterPanelScreen(MenuMatterPanel p_97741_, Inventory p_97742_, Component p_97743_) { + public MatterPanelScreen(MatterPanelMenu p_97741_, Inventory p_97742_, Component p_97743_) { super(p_97741_, p_97742_, p_97743_); imageWidth = 176; diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/CancelMatterTaskPacket.java b/src/main/java/ru/dbotthepony/mc/otm/network/CancelMatterTaskPacket.java index 2f08853c9..633cdee20 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/CancelMatterTaskPacket.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/CancelMatterTaskPacket.java @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network; import net.minecraft.network.FriendlyByteBuf; import net.minecraftforge.network.NetworkEvent; import ru.dbotthepony.mc.otm.capability.matter.MatterTask; -import ru.dbotthepony.mc.otm.menu.MenuMatterPanel; +import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import java.util.UUID; import java.util.function.Supplier; @@ -28,7 +28,7 @@ public record CancelMatterTaskPacket(UUID id) { context.get().enqueueWork(() -> { var player = context.get().getSender(); - if (player.containerMenu instanceof MenuMatterPanel menu) { + if (player.containerMenu instanceof MatterPanelMenu menu) { menu.receiveTaskCancel(player, id); } }); diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/MatterTaskPacket.java b/src/main/java/ru/dbotthepony/mc/otm/network/MatterTaskPacket.java index e0b15cea9..c3843879f 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/MatterTaskPacket.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/MatterTaskPacket.java @@ -7,7 +7,7 @@ import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.network.NetworkEvent; import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.capability.matter.MatterTask; -import ru.dbotthepony.mc.otm.menu.MenuMatterPanel; +import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import javax.annotation.ParametersAreNonnullByDefault; import java.util.ArrayList; @@ -31,7 +31,7 @@ public record MatterTaskPacket(boolean action, Collection state) { } private void playClient() { - if (Minecraft.getInstance().player.containerMenu instanceof MenuMatterPanel menu) { + if (Minecraft.getInstance().player.containerMenu instanceof MatterPanelMenu menu) { if (action) menu.networkTasksUpdated(state); else diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/MatteryNetworking.java b/src/main/java/ru/dbotthepony/mc/otm/network/MatteryNetworking.java index f933ef041..cadeb6353 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/MatteryNetworking.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/MatteryNetworking.java @@ -12,7 +12,7 @@ import ru.dbotthepony.mc.otm.matter.RegistryPacketClear; import ru.dbotthepony.mc.otm.matter.RegistryPacketFullUpdate; import ru.dbotthepony.mc.otm.matter.RegistryPacketRemove; import ru.dbotthepony.mc.otm.matter.RegistryPacketUpdate; -import ru.dbotthepony.mc.otm.menu.MenuDriveViewer; +import ru.dbotthepony.mc.otm.menu.DriveViewerMenu; import ru.dbotthepony.mc.otm.menu.data.*; import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputPacket; import ru.dbotthepony.mc.otm.menu.widget.NumberPlayerInputPacket; @@ -232,19 +232,19 @@ public class MatteryNetworking { CHANNEL.registerMessage( next_network_id++, - MenuDriveViewer.FilterSwitchPacket.class, - MenuDriveViewer.FilterSwitchPacket::write, - MenuDriveViewer.FilterSwitchPacket::read, - MenuDriveViewer.FilterSwitchPacket::play, + DriveViewerMenu.FilterSwitchPacket.class, + DriveViewerMenu.FilterSwitchPacket::write, + DriveViewerMenu.FilterSwitchPacket::read, + DriveViewerMenu.FilterSwitchPacket::play, Optional.of(NetworkDirection.PLAY_TO_SERVER) ); CHANNEL.registerMessage( next_network_id++, - MenuDriveViewer.FilterSetPacket.class, - MenuDriveViewer.FilterSetPacket::write, - MenuDriveViewer.FilterSetPacket::read, - MenuDriveViewer.FilterSetPacket::play, + DriveViewerMenu.FilterSetPacket.class, + DriveViewerMenu.FilterSetPacket::write, + DriveViewerMenu.FilterSetPacket::read, + DriveViewerMenu.FilterSetPacket::play, Optional.of(NetworkDirection.PLAY_TO_SERVER) ); diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/PatternGridPacket.java b/src/main/java/ru/dbotthepony/mc/otm/network/PatternGridPacket.java index b30e29c65..e9c668a9e 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/PatternGridPacket.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/PatternGridPacket.java @@ -7,7 +7,7 @@ import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.network.NetworkEvent; import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.capability.matter.PatternState; -import ru.dbotthepony.mc.otm.menu.MenuMatterPanel; +import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import javax.annotation.ParametersAreNonnullByDefault; import java.util.ArrayList; @@ -31,7 +31,7 @@ public record PatternGridPacket(boolean action, Collection state) } private void playClient() { - if (Minecraft.getInstance().player.containerMenu instanceof MenuMatterPanel menu) { + if (Minecraft.getInstance().player.containerMenu instanceof MatterPanelMenu menu) { if (action) menu.networkPatternsUpdated(state); else diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/PatternReplicationRequestPacket.java b/src/main/java/ru/dbotthepony/mc/otm/network/PatternReplicationRequestPacket.java index f6d037790..c69179d1b 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/PatternReplicationRequestPacket.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/PatternReplicationRequestPacket.java @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network; import net.minecraft.network.FriendlyByteBuf; import net.minecraftforge.network.NetworkEvent; import ru.dbotthepony.mc.otm.capability.matter.PatternState; -import ru.dbotthepony.mc.otm.menu.MenuMatterPanel; +import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import java.util.function.Supplier; @@ -27,7 +27,7 @@ public record PatternReplicationRequestPacket(PatternState state, int how_much) var ply = context.get().getSender(); - if (ply.containerMenu instanceof MenuMatterPanel menu) + if (ply.containerMenu instanceof MatterPanelMenu menu) menu.requestReplication(ply, state, how_much); }); } diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java index 865ce4927..935b567f2 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java @@ -6,7 +6,7 @@ import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import ru.dbotthepony.mc.otm.block.entity.*; -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole; +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity; import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityExplosionDebugger; import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger; import ru.dbotthepony.mc.otm.client.render.BlackHoleRenderer; @@ -14,26 +14,26 @@ import ru.dbotthepony.mc.otm.client.render.EnergyCounterRenderer; import ru.dbotthepony.mc.otm.client.render.GravitationStabilizerRenderer; public class MBlockEntities { - public static final BlockEntityType ANDROID_STATION = BlockEntityType.Builder.of(BlockEntityAndroidStation::new, MBlocks.ANDROID_STATION).build(null); - public static final BlockEntityType BATTERY_BANK = BlockEntityType.Builder.of(BlockEntityBatteryBank::new, MBlocks.BATTERY_BANK).build(null); - public static final BlockEntityType MATTER_DECOMPOSER = BlockEntityType.Builder.of(BlockEntityMatterDecomposer::new, MBlocks.MATTER_DECOMPOSER).build(null); - public static final BlockEntityType MATTER_CAPACITOR_BANK = BlockEntityType.Builder.of(BlockEntityMatterCapacitorBank::new, MBlocks.MATTER_CAPACITOR_BANK).build(null); - public static final BlockEntityType MATTER_CABLE = BlockEntityType.Builder.of(BlockEntityMatterCable::new, MBlocks.MATTER_CABLE).build(null); - public static final BlockEntityType PATTERN_STORAGE = BlockEntityType.Builder.of(BlockEntityPatternStorage::new, MBlocks.PATTERN_STORAGE).build(null); - public static final BlockEntityType MATTER_SCANNER = BlockEntityType.Builder.of(BlockEntityMatterScanner::new, MBlocks.MATTER_SCANNER).build(null); - public static final BlockEntityType MATTER_PANEL = BlockEntityType.Builder.of(BlockEntityMatterPanel::new, MBlocks.MATTER_PANEL).build(null); - public static final BlockEntityType MATTER_REPLICATOR = BlockEntityType.Builder.of(BlockEntityMatterReplicator::new, MBlocks.MATTER_REPLICATOR).build(null); - public static final BlockEntityType MATTER_BOTTLER = BlockEntityType.Builder.of(BlockEntityMatterBottler::new, MBlocks.MATTER_BOTTLER).build(null); - public static final BlockEntityType DRIVE_VIEWER = BlockEntityType.Builder.of(BlockEntityDriveViewer::new, MBlocks.DRIVE_VIEWER).build(null); - public static final BlockEntityType BLACK_HOLE = BlockEntityType.Builder.of(BlockEntityBlackHole::new, MBlocks.BLACK_HOLE).build(null); - public static final BlockEntityType CARGO_CRATE = BlockEntityType.Builder.of(BlockEntityCargoCrate::new, MBlocks.CARGO_CRATE).build(null); - public static final BlockEntityType DRIVE_RACK = BlockEntityType.Builder.of(BlockEntityDriveRack::new, MBlocks.DRIVE_RACK).build(null); - public static final BlockEntityType ITEM_MONITOR = BlockEntityType.Builder.of(BlockEntityItemMonitor::new, MBlocks.ITEM_MONITOR).build(null); + public static final BlockEntityType ANDROID_STATION = BlockEntityType.Builder.of(AndroidStationBlockEntity::new, MBlocks.ANDROID_STATION).build(null); + public static final BlockEntityType BATTERY_BANK = BlockEntityType.Builder.of(BatteryBankBlockEntity::new, MBlocks.BATTERY_BANK).build(null); + public static final BlockEntityType MATTER_DECOMPOSER = BlockEntityType.Builder.of(MatterDecomposerBlockEntity::new, MBlocks.MATTER_DECOMPOSER).build(null); + public static final BlockEntityType MATTER_CAPACITOR_BANK = BlockEntityType.Builder.of(MatterCapacitorBankBlockEntity::new, MBlocks.MATTER_CAPACITOR_BANK).build(null); + public static final BlockEntityType MATTER_CABLE = BlockEntityType.Builder.of(MatterCableBlockEntity::new, MBlocks.MATTER_CABLE).build(null); + public static final BlockEntityType PATTERN_STORAGE = BlockEntityType.Builder.of(PatternStorageBlockEntity::new, MBlocks.PATTERN_STORAGE).build(null); + public static final BlockEntityType MATTER_SCANNER = BlockEntityType.Builder.of(MatterScannerBlockEntity::new, MBlocks.MATTER_SCANNER).build(null); + public static final BlockEntityType MATTER_PANEL = BlockEntityType.Builder.of(MatterPanelBlockEntity::new, MBlocks.MATTER_PANEL).build(null); + public static final BlockEntityType MATTER_REPLICATOR = BlockEntityType.Builder.of(MatterReplicatorBlockEntity::new, MBlocks.MATTER_REPLICATOR).build(null); + public static final BlockEntityType MATTER_BOTTLER = BlockEntityType.Builder.of(MatterBottlerBlockEntity::new, MBlocks.MATTER_BOTTLER).build(null); + public static final BlockEntityType DRIVE_VIEWER = BlockEntityType.Builder.of(DriveViewerBlockEntity::new, MBlocks.DRIVE_VIEWER).build(null); + public static final BlockEntityType BLACK_HOLE = BlockEntityType.Builder.of(BlackHoleBlockEntity::new, MBlocks.BLACK_HOLE).build(null); + public static final BlockEntityType CARGO_CRATE = BlockEntityType.Builder.of(CargoCrateBlockEntity::new, MBlocks.CARGO_CRATE).build(null); + public static final BlockEntityType DRIVE_RACK = BlockEntityType.Builder.of(DriveRackBlockEntity::new, MBlocks.DRIVE_RACK).build(null); + public static final BlockEntityType ITEM_MONITOR = BlockEntityType.Builder.of(ItemMonitorBlockEntity::new, MBlocks.ITEM_MONITOR).build(null); public static final BlockEntityType ENERGY_COUNTER = BlockEntityType.Builder.of(BlockEntityEnergyCounter::new, MBlocks.ENERGY_COUNTER).build(null); - public static final BlockEntityType CHEMICAL_GENERATOR = BlockEntityType.Builder.of(BlockEntityChemicalGenerator::new, MBlocks.CHEMICAL_GENERATOR).build(null); - public static final BlockEntityType PLATE_PRESS = BlockEntityType.Builder.of(BlockEntityPlatePress::new, MBlocks.PLATE_PRESS).build(null); - public static final BlockEntityType GRAVITATION_STABILIZER = BlockEntityType.Builder.of(BlockEntityGravitationStabilizer::new, MBlocks.GRAVITATION_STABILIZER).build(null); - public static final BlockEntityType MATTER_RECYCLER = BlockEntityType.Builder.of(BlockEntityMatterRecycler::new, MBlocks.MATTER_RECYCLER).build(null); + public static final BlockEntityType CHEMICAL_GENERATOR = BlockEntityType.Builder.of(ChemicalGeneratorBlockEntity::new, MBlocks.CHEMICAL_GENERATOR).build(null); + public static final BlockEntityType PLATE_PRESS = BlockEntityType.Builder.of(PlatePressBlockEntity::new, MBlocks.PLATE_PRESS).build(null); + public static final BlockEntityType GRAVITATION_STABILIZER = BlockEntityType.Builder.of(GravitationStabilizerBlockEntity::new, MBlocks.GRAVITATION_STABILIZER).build(null); + public static final BlockEntityType MATTER_RECYCLER = BlockEntityType.Builder.of(MatterRecyclerBlockEntity::new, MBlocks.MATTER_RECYCLER).build(null); public static final BlockEntityType DEBUG_EXPLOSION_SMALL = BlockEntityType.Builder.of(BlockEntityExplosionDebugger::new, MBlocks.DEBUG_EXPLOSION_SMALL).build(null); public static final BlockEntityType DEBUG_SPHERE_POINTS = BlockEntityType.Builder.of(BlockEntitySphereDebugger::new, MBlocks.DEBUG_SPHERE_POINTS).build(null); diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java index b4b0cf57e..b8676f664 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java @@ -15,29 +15,29 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import ru.dbotthepony.mc.otm.block.*; public class MBlocks { - public static final BlockAndroidStation ANDROID_STATION = new BlockAndroidStation(); - public static final BlockBatteryBank BATTERY_BANK = new BlockBatteryBank(); - public static final BlockMatterDecomposer MATTER_DECOMPOSER = new BlockMatterDecomposer(); - public static final BlockMatterCapacitorBank MATTER_CAPACITOR_BANK = new BlockMatterCapacitorBank(); + public static final AndroidStationBlock ANDROID_STATION = new AndroidStationBlock(); + public static final BatteryBankBlock BATTERY_BANK = new BatteryBankBlock(); + public static final MatterDecomposerBlock MATTER_DECOMPOSER = new MatterDecomposerBlock(); + public static final MatterCapacitorBankBlock MATTER_CAPACITOR_BANK = new MatterCapacitorBankBlock(); public static final BlockMatterCable MATTER_CABLE = new BlockMatterCable(); - public static final BlockPatternStorage PATTERN_STORAGE = new BlockPatternStorage(); - public static final BlockMatterScanner MATTER_SCANNER = new BlockMatterScanner(); - public static final BlockMatterPanel MATTER_PANEL = new BlockMatterPanel(); - public static final BlockMatterReplicator MATTER_REPLICATOR = new BlockMatterReplicator(); - public static final BlockMatterBottler MATTER_BOTTLER = new BlockMatterBottler(); - public static final BlockDriveViewer DRIVE_VIEWER = new BlockDriveViewer(); - public static final BlockCargoCrate CARGO_CRATE = new BlockCargoCrate(); - public static final BlockDriveRack DRIVE_RACK = new BlockDriveRack(); - public static final BlockItemMonitor ITEM_MONITOR = new BlockItemMonitor(); - public static final BlockEnergyCounter ENERGY_COUNTER = new BlockEnergyCounter(); - public static final BlockChemicalGenerator CHEMICAL_GENERATOR = new BlockChemicalGenerator(); - public static final BlockPlatePress PLATE_PRESS = new BlockPlatePress(); - public static final BlockMatterRecycler MATTER_RECYCLER = new BlockMatterRecycler(); + public static final PatternStorageBlock PATTERN_STORAGE = new PatternStorageBlock(); + public static final MatterScannerBlock MATTER_SCANNER = new MatterScannerBlock(); + public static final MatterPanelBlock MATTER_PANEL = new MatterPanelBlock(); + public static final MatterReplicatorBlock MATTER_REPLICATOR = new MatterReplicatorBlock(); + public static final MatterBottlerBlock MATTER_BOTTLER = new MatterBottlerBlock(); + public static final DriveViewerBlock DRIVE_VIEWER = new DriveViewerBlock(); + public static final CargoCrateBlock CARGO_CRATE = new CargoCrateBlock(); + public static final DriveRackBlock DRIVE_RACK = new DriveRackBlock(); + public static final ItemMonitorBlock ITEM_MONITOR = new ItemMonitorBlock(); + public static final EnergyCounterBlock ENERGY_COUNTER = new EnergyCounterBlock(); + public static final ChemicalGeneratorBlock CHEMICAL_GENERATOR = new ChemicalGeneratorBlock(); + public static final PlatePressBlock PLATE_PRESS = new PlatePressBlock(); + public static final MatterRecyclerBlock MATTER_RECYCLER = new MatterRecyclerBlock(); public static final BlockExplosionDebugger DEBUG_EXPLOSION_SMALL = new BlockExplosionDebugger(); public static final BlockSphereDebugger DEBUG_SPHERE_POINTS = new BlockSphereDebugger(); - public static final BlockBlackHole BLACK_HOLE = new BlockBlackHole(); + public static final BlackHoleBlock BLACK_HOLE = new BlackHoleBlock(); public static final BlockGravitationStabilizer GRAVITATION_STABILIZER = new BlockGravitationStabilizer(); public static final BlockGravitationStabilizerLens GRAVITATION_STABILIZER_LENS = new BlockGravitationStabilizerLens(); diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java index 1991fceed..5492b018a 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java @@ -66,7 +66,7 @@ public class MItems { public static final BlockItem DEBUG_EXPLOSION_SMALL = new BlockItem(MBlocks.DEBUG_EXPLOSION_SMALL, DEFAULT_PROPERTIES); public static final BlockItem DEBUG_SPHERE_POINTS = new BlockItem(MBlocks.DEBUG_SPHERE_POINTS, DEFAULT_PROPERTIES); - public static final ItemMatterDust MATTER_DUST = new ItemMatterDust(); + public static final MatterDustItem MATTER_DUST = new MatterDustItem(); public static final Item TRITANIUM_ORE_CLUMP = new Item(DEFAULT_PROPERTIES); public static final Item TRITANIUM_INGOT = new Item(DEFAULT_PROPERTIES); @@ -144,21 +144,21 @@ public class MItems { public static final BlockItem BLACK_HOLE = new BlockItem(MBlocks.BLACK_HOLE, DEFAULT_PROPERTIES); - public static final ItemGravitationalDisruptor GRAVITATIONAL_DISRUPTOR = new ItemGravitationalDisruptor(); + public static final GravitationalDisruptorItem GRAVITATIONAL_DISRUPTOR = new GravitationalDisruptorItem(); - public static final ItemPill PILL_ANDROID = new ItemPill(PillType.BECOME_ANDROID); - public static final ItemPill PILL_HUMANE = new ItemPill(PillType.BECOME_HUMANE); - public static final ItemPill PILL_OBLIVION = new ItemPill(PillType.OBLIVION); - public static final ItemPillHeal PILL_HEAL = new ItemPillHeal(); + public static final PillItem PILL_ANDROID = new PillItem(PillType.BECOME_ANDROID); + public static final PillItem PILL_HUMANE = new PillItem(PillType.BECOME_HUMANE); + public static final PillItem PILL_OBLIVION = new PillItem(PillType.OBLIVION); + public static final HealPillItem PILL_HEAL = new HealPillItem(); - public static final ItemBattery BATTERY_CRUDE = new ItemBattery(new ImpreciseFraction(30_000), new ImpreciseFraction(150), new ImpreciseFraction(150)); - public static final ItemBattery BATTERY_BASIC = new ItemBattery(new ImpreciseFraction(60_000), new ImpreciseFraction(300), new ImpreciseFraction(300)); - public static final ItemBattery BATTERY_NORMAL = new ItemBattery(new ImpreciseFraction(250_000), new ImpreciseFraction(1000), new ImpreciseFraction(1000)); - public static final ItemBattery BATTERY_DENSE = new ItemBattery(new ImpreciseFraction(1_000_000), new ImpreciseFraction(2000), new ImpreciseFraction(2000)); - public static final ItemBattery BATTERY_CAPACITOR = new ItemBattery(new ImpreciseFraction(150_000), new ImpreciseFraction(15000), new ImpreciseFraction(15000)); - public static final ItemBattery BATTERY_CREATIVE = new ItemBattery(); + public static final BatteryItem BATTERY_CRUDE = new BatteryItem(new ImpreciseFraction(30_000), new ImpreciseFraction(150), new ImpreciseFraction(150)); + public static final BatteryItem BATTERY_BASIC = new BatteryItem(new ImpreciseFraction(60_000), new ImpreciseFraction(300), new ImpreciseFraction(300)); + public static final BatteryItem BATTERY_NORMAL = new BatteryItem(new ImpreciseFraction(250_000), new ImpreciseFraction(1000), new ImpreciseFraction(1000)); + public static final BatteryItem BATTERY_DENSE = new BatteryItem(new ImpreciseFraction(1_000_000), new ImpreciseFraction(2000), new ImpreciseFraction(2000)); + public static final BatteryItem BATTERY_CAPACITOR = new BatteryItem(new ImpreciseFraction(150_000), new ImpreciseFraction(15000), new ImpreciseFraction(15000)); + public static final BatteryItem BATTERY_CREATIVE = new BatteryItem(); - public static final ItemBattery[] BATTERIES = { + public static final BatteryItem[] BATTERIES = { BATTERY_CRUDE, BATTERY_BASIC, BATTERY_NORMAL, @@ -183,16 +183,16 @@ public class MItems { MATTER_TRANSFORM_MATRIX, }; - public static final ItemMatterCapacitor MATTER_CAPACITOR_BASIC = new ItemMatterCapacitor(new ImpreciseFraction("4")); - public static final ItemMatterCapacitor MATTER_CAPACITOR_NORMAL = new ItemMatterCapacitor(new ImpreciseFraction("10")); - public static final ItemMatterCapacitor MATTER_CAPACITOR_DENSE = new ItemMatterCapacitor(new ImpreciseFraction("40")); - public static final ItemMatterCapacitor MATTER_CAPACITOR_CREATIVE = new ItemMatterCapacitor(); + public static final MatterCapacitorItem MATTER_CAPACITOR_BASIC = new MatterCapacitorItem(new ImpreciseFraction("4")); + public static final MatterCapacitorItem MATTER_CAPACITOR_NORMAL = new MatterCapacitorItem(new ImpreciseFraction("10")); + public static final MatterCapacitorItem MATTER_CAPACITOR_DENSE = new MatterCapacitorItem(new ImpreciseFraction("40")); + public static final MatterCapacitorItem MATTER_CAPACITOR_CREATIVE = new MatterCapacitorItem(); - public static final ItemPatternStorage PATTERN_DRIVE_NORMAL = new ItemPatternStorage(4); - public static final ItemPatternStorage PATTERN_DRIVE_CREATIVE = new ItemPatternStorage(); + public static final PatternStorageItem PATTERN_DRIVE_NORMAL = new PatternStorageItem(4); + public static final PatternStorageItem PATTERN_DRIVE_CREATIVE = new PatternStorageItem(); - public static final ItemPortableCondensationDrive PORTABLE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(4000); - public static final ItemPortableCondensationDrive PORTABLE_DENSE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(25000); + public static final PortableCondensationDriveItem PORTABLE_CONDENSATION_DRIVE = new PortableCondensationDriveItem(4000); + public static final PortableCondensationDriveItem PORTABLE_DENSE_CONDENSATION_DRIVE = new PortableCondensationDriveItem(25000); public static final Item NUTRIENT_PASTE = new Item(new Item.Properties().stacksTo(64).food(new FoodProperties.Builder().meat().nutrition(8).saturationMod(0.9F).build()).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)); diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java index 4894ff41d..70b078a4d 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java @@ -10,22 +10,22 @@ import ru.dbotthepony.mc.otm.menu.*; public class MMenus { public static final MenuType ANDROID_STATION = new MenuType<>(AndroidStationMenu::new); - public static final MenuType BATTERY_BANK = new MenuType<>(MenuBatteryBank::new); - public static final MenuType MATTER_DECOMPOSER = new MenuType<>(MenuMatterDecomposer::new); - public static final MenuType MATTER_CAPACITOR_BANK = new MenuType<>(MenuMatterCapacitor::new); - public static final MenuType PATTERN_STORAGE = new MenuType<>(MenuPatternStorage::new); - public static final MenuType MATTER_SCANNER = new MenuType<>(MenuMatterScanner::new); - public static final MenuType MATTER_PANEL = new MenuType<>(MenuMatterPanel::new); - public static final MenuType MATTER_REPLICATOR = new MenuType<>(MenuMatterReplicator::new); - public static final MenuType MATTER_BOTTLER = new MenuType<>(MenuMatterBottler::new); - public static final MenuType DRIVE_VIEWER = new MenuType<>(MenuDriveViewer::new); - public static final MenuType CARGO_CRATE = new MenuType<>(MenuCargoCrate::new); - public static final MenuType DRIVE_RACK = new MenuType<>(MenuDriveRack::new); - public static final MenuType ITEM_MONITOR = new MenuType<>(MenuItemMonitor::new); - public static final MenuType ENERGY_COUNTER = new MenuType<>(MenuEnergyCounter::new); - public static final MenuType CHEMICAL_GENERATOR = new MenuType<>(MenuChemicalGenerator::new); + public static final MenuType BATTERY_BANK = new MenuType<>(BatteryBankMenu::new); + public static final MenuType MATTER_DECOMPOSER = new MenuType<>(MatterDecomposerMenu::new); + public static final MenuType MATTER_CAPACITOR_BANK = new MenuType<>(MatterCapacitorMenu::new); + public static final MenuType PATTERN_STORAGE = new MenuType<>(PatternStorageMenu::new); + public static final MenuType MATTER_SCANNER = new MenuType<>(MatterScannerMenu::new); + public static final MenuType MATTER_PANEL = new MenuType<>(MatterPanelMenu::new); + public static final MenuType MATTER_REPLICATOR = new MenuType<>(MatterReplicatorMenu::new); + public static final MenuType MATTER_BOTTLER = new MenuType<>(MatterBottlerMenu::new); + public static final MenuType DRIVE_VIEWER = new MenuType<>(DriveViewerMenu::new); + public static final MenuType CARGO_CRATE = new MenuType<>(CargoCrateMenu::new); + public static final MenuType DRIVE_RACK = new MenuType<>(DriveRackMenu::new); + public static final MenuType ITEM_MONITOR = new MenuType<>(ItemMonitorMenu::new); + public static final MenuType ENERGY_COUNTER = new MenuType<>(EnergyCounterMenu::new); + public static final MenuType CHEMICAL_GENERATOR = new MenuType<>(ChemicalGeneratorMenu::new); public static final MenuType PLATE_PRESS = new MenuType<>(MenuPlatePress::new); - public static final MenuType MATTER_RECYCLER = new MenuType<>(MenuMatterRecycler::new); + public static final MenuType MATTER_RECYCLER = new MenuType<>(MatterRecyclerMenu::new); static { ANDROID_STATION.setRegistryName(MNames.ANDROID_STATION); @@ -74,23 +74,23 @@ public class MMenus { @SubscribeEvent @SuppressWarnings("unused") public static void registerScreens(final FMLClientSetupEvent event) { - MenuScreens.register(ANDROID_STATION, ScreenAndroidStation::new); - MenuScreens.register(BATTERY_BANK, ScreenBatteryBank::new); - MenuScreens.register(MATTER_DECOMPOSER, ScreenMatterDecomposer::new); - MenuScreens.register(MATTER_CAPACITOR_BANK, ScreenMatterCapacitorBank::new); - MenuScreens.register(PATTERN_STORAGE, ScreenPatternStorage::new); - MenuScreens.register(MATTER_SCANNER, ScreenMatterScanner::new); + MenuScreens.register(ANDROID_STATION, AndroidStationScreen::new); + MenuScreens.register(BATTERY_BANK, BatteryBankScreen::new); + MenuScreens.register(MATTER_DECOMPOSER, MatterDecomposerScreen::new); + MenuScreens.register(MATTER_CAPACITOR_BANK, MatterCapacitorBankScreen::new); + MenuScreens.register(PATTERN_STORAGE, PatternStorageScreen::new); + MenuScreens.register(MATTER_SCANNER, MatterScannerScreen::new); MenuScreens.register(MATTER_PANEL, MatterPanelScreen::new); - MenuScreens.register(MATTER_REPLICATOR, ScreenMatterReplicator::new); - MenuScreens.register(MATTER_BOTTLER, ScreenMatterBottler::new); - MenuScreens.register(DRIVE_VIEWER, ScreenDriveViewer::new); - MenuScreens.register(CARGO_CRATE, ScreenCargoCrate::new); - MenuScreens.register(DRIVE_RACK, ScreenDriveRack::new); - MenuScreens.register(ITEM_MONITOR, ScreenItemMonitor::new); - MenuScreens.register(ENERGY_COUNTER, ScreenEnergyCounter::new); - MenuScreens.register(CHEMICAL_GENERATOR, ScreenChemicalGenerator::new); - MenuScreens.register(PLATE_PRESS, ScreenPlatePress::new); - MenuScreens.register(MATTER_RECYCLER, ScreenMatterRecycler::new); + MenuScreens.register(MATTER_REPLICATOR, MatterReplicatorScreen::new); + MenuScreens.register(MATTER_BOTTLER, MatterBottlerScreen::new); + MenuScreens.register(DRIVE_VIEWER, DriveViewerScreen::new); + MenuScreens.register(CARGO_CRATE, CargoCrateScreen::new); + MenuScreens.register(DRIVE_RACK, DriveRackScreen::new); + MenuScreens.register(ITEM_MONITOR, ItemMonitorScreen::new); + MenuScreens.register(ENERGY_COUNTER, EnergyCounterScreen::new); + MenuScreens.register(CHEMICAL_GENERATOR, ChemicalGeneratorScreen::new); + MenuScreens.register(PLATE_PRESS, PlatePressScreen::new); + MenuScreens.register(MATTER_RECYCLER, MatterRecyclerScreen::new); // OverdriveThatMatters.LOGGER.info("Registered screens"); } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/AndroidStationBlock.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockAndroidStation.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/AndroidStationBlock.kt index a0674713c..894b0eecd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/AndroidStationBlock.kt @@ -14,13 +14,13 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.BlockHitResult import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityAndroidStation +import ru.dbotthepony.mc.otm.block.entity.AndroidStationBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.orNull import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockAndroidStation : BlockMattery(), EntityBlock { +class AndroidStationBlock : BlockMattery(), EntityBlock { override fun use( blockState: BlockState, level: Level, @@ -47,7 +47,7 @@ class BlockAndroidStation : BlockMattery(), EntityBlock { } override fun newBlockEntity(pos: BlockPos, state: BlockState): BlockEntity { - return BlockEntityAndroidStation(pos, state) + return AndroidStationBlockEntity(pos, state) } override fun getTicker( @@ -58,7 +58,7 @@ class BlockAndroidStation : BlockMattery(), EntityBlock { if (level.isClientSide || type !== MBlockEntities.ANDROID_STATION) return null - return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityAndroidStation) t.tick() } + return BlockEntityTicker { _, _, _, t -> if (t is AndroidStationBlockEntity) t.tick() } } companion object { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBatteryBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BatteryBankBlock.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBatteryBank.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/BatteryBankBlock.kt index d4c809785..9765ec9fd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBatteryBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BatteryBankBlock.kt @@ -12,7 +12,7 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.core.BlockPos import net.minecraft.core.Direction -import ru.dbotthepony.mc.otm.block.entity.BlockEntityBatteryBank +import ru.dbotthepony.mc.otm.block.entity.BatteryBankBlockEntity import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block @@ -23,7 +23,7 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockBatteryBank : BlockMatteryRotatable(), EntityBlock { +class BatteryBankBlock : BlockMatteryRotatable(), EntityBlock { override fun getStateForPlacement(context: BlockPlaceContext): BlockState { var state = super.getStateForPlacement(context)!! @@ -41,7 +41,7 @@ class BlockBatteryBank : BlockMatteryRotatable(), EntityBlock { if (level.isClientSide || type !== MBlockEntities.BATTERY_BANK) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityBatteryBank) tile.tick() } + return BlockEntityTicker { _, _, _, tile -> if (tile is BatteryBankBlockEntity) tile.tick() } } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { @@ -50,7 +50,7 @@ class BlockBatteryBank : BlockMatteryRotatable(), EntityBlock { } override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? { - return BlockEntityBatteryBank(blockPos, blockState) + return BatteryBankBlockEntity(blockPos, blockState) } override fun getShape( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBlackHole.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlackHoleBlock.kt similarity index 81% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBlackHole.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/BlackHoleBlock.kt index a35ef8727..41f64a70a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBlackHole.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlackHoleBlock.kt @@ -12,11 +12,11 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.material.Material import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockBlackHole : +class BlackHoleBlock : Block(Properties.of(Material.STONE).strength(-1f, 7200000.0f)), EntityBlock { override fun getShape( p_60555_: BlockState, @@ -28,7 +28,7 @@ class BlockBlackHole : } override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityBlackHole(blockPos, blockState) + return BlackHoleBlockEntity(blockPos, blockState) } override fun getTicker( @@ -39,10 +39,10 @@ class BlockBlackHole : if (p_153214_ !== MBlockEntities.BLACK_HOLE) return null if (p_153212_.isClientSide) { - return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityBlackHole) t.clientTick() } + return BlockEntityTicker { _, _, _, t -> if (t is BlackHoleBlockEntity) t.clientTick() } } - return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityBlackHole) t.tick() } + return BlockEntityTicker { _, _, _, t -> if (t is BlackHoleBlockEntity) t.tick() } } companion object { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockCargoCrate.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/CargoCrateBlock.kt similarity index 85% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockCargoCrate.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/CargoCrateBlock.kt index 54fdbdc00..5044772db 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockCargoCrate.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/CargoCrateBlock.kt @@ -11,11 +11,11 @@ import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty -import ru.dbotthepony.mc.otm.block.entity.BlockEntityCargoCrate +import ru.dbotthepony.mc.otm.block.entity.CargoCrateBlockEntity -class BlockCargoCrate : BlockMatteryRotatable(), EntityBlock { +class CargoCrateBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityCargoCrate(blockPos, blockState) + return CargoCrateBlockEntity(blockPos, blockState) } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { @@ -37,7 +37,7 @@ class BlockCargoCrate : BlockMatteryRotatable(), EntityBlock { if (!old_block_state.`is`(new_block_state.block)) { val blockentity = level.getBlockEntity(block_pos) - if (blockentity is BlockEntityCargoCrate) { + if (blockentity is CargoCrateBlockEntity) { Containers.dropContents(level, block_pos, blockentity.container); level.updateNeighbourForOutputSignal(block_pos, this); } @@ -51,7 +51,7 @@ class BlockCargoCrate : BlockMatteryRotatable(), EntityBlock { } override fun getAnalogOutputSignal(p_60487_: BlockState, level: Level, p_60489_: BlockPos): Int { - val tile = level.getBlockEntity(p_60489_) as? BlockEntityCargoCrate ?: return 0 + val tile = level.getBlockEntity(p_60489_) as? CargoCrateBlockEntity ?: return 0 return AbstractContainerMenu.getRedstoneSignalFromContainer(tile.container) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ChemicalGeneratorBlock.kt similarity index 84% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockChemicalGenerator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/ChemicalGeneratorBlock.kt index eae0aa67a..ec03eef59 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ChemicalGeneratorBlock.kt @@ -14,17 +14,15 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.block.entity.BlockEntityChemicalGenerator +import ru.dbotthepony.mc.otm.block.entity.ChemicalGeneratorBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -import ru.dbotthepony.mc.otm.tickOnce import ru.dbotthepony.mc.otm.tickOnceServer -class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock { +class ChemicalGeneratorBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { - return BlockEntityChemicalGenerator(p_153215_, p_153216_) + return ChemicalGeneratorBlockEntity(p_153215_, p_153216_) } override fun getTicker( @@ -35,7 +33,7 @@ class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock { if (level.isClientSide || type != MBlockEntities.CHEMICAL_GENERATOR) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityChemicalGenerator) tile.tick() } + return BlockEntityTicker { _, _, _, tile -> if (tile is ChemicalGeneratorBlockEntity) tile.tick() } } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { @@ -56,7 +54,7 @@ class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock { if (!level.isClientSide && level is ServerLevel) { val tile = level.getBlockEntity(pos) - if (tile is BlockEntityChemicalGenerator) { + if (tile is ChemicalGeneratorBlockEntity) { tickOnceServer(level) { tile.checkSurroundings() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveRack.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt similarity index 85% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveRack.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt index d881f251d..af23218f2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveRack.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt @@ -11,13 +11,13 @@ import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack +import ru.dbotthepony.mc.otm.block.entity.DriveRackBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockDriveRack : BlockMatteryRotatable(), EntityBlock { +class DriveRackBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityDriveRack(blockPos, blockState) + return DriveRackBlockEntity(blockPos, blockState) } override fun getTicker( @@ -28,7 +28,7 @@ class BlockDriveRack : BlockMatteryRotatable(), EntityBlock { if (p_153214_ != MBlockEntities.DRIVE_RACK || p_153212_.isClientSide) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityDriveRack) tile.tick() } + return BlockEntityTicker { _, _, _, tile -> if (tile is DriveRackBlockEntity) tile.tick() } } override fun getShape( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveViewer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt similarity index 84% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveViewer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt index 84b04f807..2d2aa1f81 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveViewer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt @@ -11,13 +11,13 @@ import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty -import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveViewer +import ru.dbotthepony.mc.otm.block.entity.DriveViewerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockDriveViewer : BlockMatteryRotatable(), EntityBlock { +class DriveViewerBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityDriveViewer(blockPos, blockState) + return DriveViewerBlockEntity(blockPos, blockState) } override fun getTicker( @@ -28,7 +28,7 @@ class BlockDriveViewer : BlockMatteryRotatable(), EntityBlock { if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.DRIVE_VIEWER) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityDriveViewer) tile.tick() } + return BlockEntityTicker { _, _, _, tile -> if (tile is DriveViewerBlockEntity) tile.tick() } } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/EnergyCounterBlock.kt similarity index 98% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/EnergyCounterBlock.kt index 5c3511360..62c97a2cc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/EnergyCounterBlock.kt @@ -19,7 +19,7 @@ import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockEnergyCounter : BlockMattery(), EntityBlock { +class EnergyCounterBlock : BlockMattery(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return BlockEntityEnergyCounter(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockExplosionDebugger.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ExplosionDebuggerBlock.kt similarity index 100% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockExplosionDebugger.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/ExplosionDebuggerBlock.kt diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockGravitationStabilizer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/GravitationStabilizerBlock.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockGravitationStabilizer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/GravitationStabilizerBlock.kt index abad258bf..4d67e50e4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockGravitationStabilizer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/GravitationStabilizerBlock.kt @@ -22,9 +22,8 @@ import net.minecraft.world.level.material.MaterialColor import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole +import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.core.times @@ -38,7 +37,7 @@ private val props = BlockBehaviour.Properties.of(Material.STONE, MaterialColor.C class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { - return BlockEntityGravitationStabilizer(p_153215_, p_153216_) + return GravitationStabilizerBlockEntity(p_153215_, p_153216_) } override fun getTicker( @@ -49,7 +48,7 @@ class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock { if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.GRAVITATION_STABILIZER) return null - return BlockEntityTicker { level, _, _, tile -> if (tile is BlockEntityGravitationStabilizer) tile.tick(level) } + return BlockEntityTicker { level, _, _, tile -> if (tile is GravitationStabilizerBlockEntity) tile.tick(level) } } override val hasFreeRotation: Boolean get() = true @@ -67,13 +66,13 @@ class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock { for (face in FACING_FULL.possibleValues) { val dir = face.normal - for (i in 1 ..BlockEntityGravitationStabilizer.RANGE) { + for (i in 1 ..GravitationStabilizerBlockEntity.RANGE) { val pos = blockPos + dir * i val chunk = level.chunkSource.getChunkNow(SectionPos.blockToSectionCoord(pos.x), SectionPos.blockToSectionCoord(pos.z)) ?: continue val getState = chunk.getBlockState(pos) if (!getState.isAir) { - if (chunk.getBlockEntity(pos) is BlockEntityBlackHole) { + if (chunk.getBlockEntity(pos) is BlackHoleBlockEntity) { state = state.setValue(FACING_FULL, face) break } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockItemMonitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt similarity index 85% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockItemMonitor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt index 8951ca07c..dd22a7564 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockItemMonitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt @@ -11,13 +11,13 @@ import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor +import ru.dbotthepony.mc.otm.block.entity.ItemMonitorBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockItemMonitor : BlockMatteryRotatable(), EntityBlock { +class ItemMonitorBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityItemMonitor(blockPos, blockState) + return ItemMonitorBlockEntity(blockPos, blockState) } override fun getTicker( @@ -28,7 +28,7 @@ class BlockItemMonitor : BlockMatteryRotatable(), EntityBlock { if (p_153214_ != MBlockEntities.ITEM_MONITOR || p_153212_.isClientSide) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityItemMonitor) tile.tick() } + return BlockEntityTicker { _, _, _, tile -> if (tile is ItemMonitorBlockEntity) tile.tick() } } override fun getShape( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterBottler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt similarity index 90% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterBottler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt index aad15ca86..b8cb60e0f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterBottler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt @@ -11,7 +11,7 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.entity.BlockEntity -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterBottler +import ru.dbotthepony.mc.otm.block.entity.MatterBottlerBlockEntity import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.state.StateDefinition @@ -24,9 +24,9 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockMatterBottler : BlockMatteryRotatable(), EntityBlock { +class MatterBottlerBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? { - return BlockEntityMatterBottler(blockPos, blockState) + return MatterBottlerBlockEntity(blockPos, blockState) } override fun getTicker( @@ -37,7 +37,7 @@ class BlockMatterBottler : BlockMatteryRotatable(), EntityBlock { if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_BOTTLER) return null - return BlockEntityTicker {_, _, _, tile -> if (tile is BlockEntityMatterBottler) tile.tick()} + return BlockEntityTicker {_, _, _, tile -> if (tile is MatterBottlerBlockEntity) tile.tick()} } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterCapacitorBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt similarity index 84% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterCapacitorBank.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt index 573ab34dd..e0b939c12 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterCapacitorBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt @@ -11,25 +11,25 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterCapacitorBank +import ru.dbotthepony.mc.otm.block.entity.MatterCapacitorBankBlockEntity import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockMatterCapacitorBank : BlockMatteryRotatable(), EntityBlock { +class MatterCapacitorBankBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityMatterCapacitorBank(blockPos, blockState) + return MatterCapacitorBankBlockEntity(blockPos, blockState) } override fun getStateForPlacement(context: BlockPlaceContext): BlockState? { var state = super.getStateForPlacement(context) ?: return null - for (prop in BlockBatteryBank.BATTERY_SLOTS_PROPS) + for (prop in BatteryBankBlock.BATTERY_SLOTS_PROPS) state = state.setValue(prop, false) return state } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { - builder.add(*BlockBatteryBank.BATTERY_SLOTS_PROPS) + builder.add(*BatteryBankBlock.BATTERY_SLOTS_PROPS) super.createBlockStateDefinition(builder) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterDecomposer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterDecomposer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt index b1b6384bb..4ffdce684 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterDecomposer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt @@ -7,7 +7,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.entity.BlockEntity -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterDecomposer +import ru.dbotthepony.mc.otm.block.entity.MatterDecomposerBlockEntity import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.state.StateDefinition @@ -22,9 +22,9 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockMatterDecomposer : BlockMatteryRotatable(), EntityBlock { +class MatterDecomposerBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityMatterDecomposer(blockPos, blockState) + return MatterDecomposerBlockEntity(blockPos, blockState) } override fun getTicker( @@ -35,7 +35,7 @@ class BlockMatterDecomposer : BlockMatteryRotatable(), EntityBlock { if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_DECOMPOSER) return null - return BlockEntityTicker {_, _, _, t -> if (t is BlockEntityMatterDecomposer) t.tick()} + return BlockEntityTicker {_, _, _, t -> if (t is MatterDecomposerBlockEntity) t.tick()} } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterPanel.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt index d83a21cb4..acd1dc11e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt @@ -6,7 +6,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.entity.BlockEntity -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterPanel +import ru.dbotthepony.mc.otm.block.entity.MatterPanelBlockEntity import net.minecraft.world.phys.shapes.VoxelShape import net.minecraft.world.phys.shapes.Shapes import net.minecraft.world.level.BlockGetter @@ -16,9 +16,9 @@ import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.properties.EnumProperty -class BlockMatterPanel : BlockMattery(), EntityBlock { +class MatterPanelBlock : BlockMattery(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityMatterPanel(blockPos, blockState) + return MatterPanelBlockEntity(blockPos, blockState) } private val shapes: ImmutableMap diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterRecycler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt similarity index 79% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterRecycler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt index 4b205529f..77c7f3f6d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterRecycler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt @@ -9,13 +9,13 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterRecycler +import ru.dbotthepony.mc.otm.block.entity.MatterRecyclerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockMatterRecycler : BlockMatteryRotatable(), EntityBlock { +class MatterRecyclerBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { - return BlockEntityMatterRecycler(p_153215_, p_153216_) + return MatterRecyclerBlockEntity(p_153215_, p_153216_) } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { @@ -31,6 +31,6 @@ class BlockMatterRecycler : BlockMatteryRotatable(), EntityBlock { if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_RECYCLER) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterRecycler) tile.tick() } + return BlockEntityTicker { _, _, _, tile -> if (tile is MatterRecyclerBlockEntity) tile.tick() } } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterReplicator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt similarity index 86% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterReplicator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt index cc65162f5..1e6e99538 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterReplicator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt @@ -13,14 +13,14 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterReplicator +import ru.dbotthepony.mc.otm.block.entity.MatterReplicatorBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockMatterReplicator : BlockMatteryRotatable(), EntityBlock { +class MatterReplicatorBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityMatterReplicator(blockPos, blockState) + return MatterReplicatorBlockEntity(blockPos, blockState) } override fun getTicker( @@ -31,7 +31,7 @@ class BlockMatterReplicator : BlockMatteryRotatable(), EntityBlock { if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_REPLICATOR) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterReplicator) tile.basicTicker() } + return BlockEntityTicker { _, _, _, tile -> if (tile is MatterReplicatorBlockEntity) tile.basicTicker() } } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterScanner.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterScanner.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt index cfc852156..8dfa29933 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterScanner.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt @@ -13,14 +13,14 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterScanner +import ru.dbotthepony.mc.otm.block.entity.MatterScannerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockMatterScanner : BlockMatteryRotatable(), EntityBlock { +class MatterScannerBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { - return BlockEntityMatterScanner(blockPos, blockState) + return MatterScannerBlockEntity(blockPos, blockState) } override fun getTicker( @@ -31,7 +31,7 @@ class BlockMatterScanner : BlockMatteryRotatable(), EntityBlock { if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_SCANNER) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterScanner) tile.basicTicker() } + return BlockEntityTicker { _, _, _, tile -> if (tile is MatterScannerBlockEntity) tile.basicTicker() } } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMattery.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMattery.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt index a418aaa18..007f332fb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMattery.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt @@ -18,7 +18,7 @@ import net.minecraft.world.level.block.state.properties.EnumProperty import net.minecraft.world.level.material.Material import net.minecraft.world.level.material.MaterialColor import net.minecraft.world.phys.BlockHitResult -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMattery +import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity abstract class BlockMattery @JvmOverloads constructor( properties: Properties = DEFAULT_PROPERTIES @@ -33,7 +33,7 @@ abstract class BlockMattery @JvmOverloads constructor( if (this is EntityBlock && itemStack.hasCustomHoverName() && !level.isClientSide) { val tile = level.getBlockEntity(blockPos) - if (tile is BlockEntityMattery) + if (tile is MatteryBlockEntity) tile.customDisplayName = itemStack.displayName } @@ -76,7 +76,7 @@ abstract class BlockMattery @JvmOverloads constructor( if (this is EntityBlock && !level.isClientSide) { val tile = level.getBlockEntity(pos) - if (tile is BlockEntityMattery) + if (tile is MatteryBlockEntity) tile.redstoneSignal = level.getBestNeighborSignal(pos) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPatternStorage.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPatternStorage.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt index e91aae7b7..d4ed8e878 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPatternStorage.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt @@ -12,12 +12,12 @@ import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityPatternStorage +import ru.dbotthepony.mc.otm.block.entity.PatternStorageBlockEntity import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockPatternStorage : BlockMatteryRotatable(), EntityBlock { +class PatternStorageBlock : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? { - return BlockEntityPatternStorage(blockPos, blockState) + return PatternStorageBlockEntity(blockPos, blockState) } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PlatePressBlock.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPlatePress.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/PlatePressBlock.kt index f033eebb1..48c1841cb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PlatePressBlock.kt @@ -13,14 +13,14 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress +import ru.dbotthepony.mc.otm.block.entity.PlatePressBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class BlockPlatePress(properties: Properties = DEFAULT_PROPERTIES) : BlockMatteryRotatable(properties), EntityBlock { +class PlatePressBlock(properties: Properties = DEFAULT_PROPERTIES) : BlockMatteryRotatable(properties), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { - return BlockEntityPlatePress(p_153215_, p_153216_) + return PlatePressBlockEntity(p_153215_, p_153216_) } override fun getTicker( @@ -31,7 +31,7 @@ class BlockPlatePress(properties: Properties = DEFAULT_PROPERTIES) : BlockMatter if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.PLATE_PRESS) return null - return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityPlatePress) tile.basicTicker() } + return BlockEntityTicker { _, _, _, tile -> if (tile is PlatePressBlockEntity) tile.basicTicker() } } override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/AndroidStationBlockEntity.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityAndroidStation.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/AndroidStationBlockEntity.kt index 19d6677ba..1b3dd6e29 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/AndroidStationBlockEntity.kt @@ -16,8 +16,8 @@ import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.menu.AndroidStationMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockEntityAndroidStation(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(MBlockEntities.ANDROID_STATION, p_155229_, p_155230_), MenuProvider { +class AndroidStationBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryPoweredBlockEntity(MBlockEntities.ANDROID_STATION, p_155229_, p_155230_), MenuProvider { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return AndroidStationMenu(containerID, inventory, this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityBatteryBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityBatteryBank.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt index cd9861638..df21e24d6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityBatteryBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt @@ -19,7 +19,7 @@ import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.energy.CapabilityEnergy import net.minecraftforge.energy.IEnergyStorage import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.BlockBatteryBank +import ru.dbotthepony.mc.otm.block.BatteryBankBlock import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage import ru.dbotthepony.mc.otm.capability.MatteryCapability @@ -27,7 +27,7 @@ import ru.dbotthepony.mc.otm.capability.extractEnergy import ru.dbotthepony.mc.otm.capability.receiveEnergy import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.core.ImpreciseFraction -import ru.dbotthepony.mc.otm.menu.MenuBatteryBank +import ru.dbotthepony.mc.otm.menu.BatteryBankMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.unaryMinus @@ -35,7 +35,7 @@ import javax.annotation.ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(MBlockEntities.BATTERY_BANK, p_155229_, p_155230_) { +class BatteryBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(MBlockEntities.BATTERY_BANK, p_155229_, p_155230_) { // 6 на 2 val container: MatteryContainer = object : MatteryContainer(this::setChanged, CAPACITY) { override fun setChanged(slot: Int, new: ItemStack, old: ItemStack) { @@ -45,8 +45,8 @@ class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : Block if (level != null) { var state = blockState - for (i in BlockBatteryBank.BATTERY_SLOTS_PROPS.indices) { - state = state.setValue(BlockBatteryBank.BATTERY_SLOTS_PROPS[i], getItem(i).getCapability(CapabilityEnergy.ENERGY).isPresent) + for (i in BatteryBankBlock.BATTERY_SLOTS_PROPS.indices) { + state = state.setValue(BatteryBankBlock.BATTERY_SLOTS_PROPS[i], getItem(i).getCapability(CapabilityEnergy.ENERGY).isPresent) } if (state !== blockState) { @@ -252,7 +252,7 @@ class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : Block } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuBatteryBank(containerID, inventory, this) + return BatteryBankMenu(containerID, inventory, this) } override fun invalidateCaps() { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityCargoCrate.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/CargoCrateBlockEntity.kt similarity index 85% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityCargoCrate.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/CargoCrateBlockEntity.kt index 4a9f044d2..d492104c0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityCargoCrate.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/CargoCrateBlockEntity.kt @@ -13,30 +13,30 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.BlockCargoCrate +import ru.dbotthepony.mc.otm.block.CargoCrateBlock import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.ifHas -import ru.dbotthepony.mc.otm.menu.MenuCargoCrate +import ru.dbotthepony.mc.otm.menu.CargoCrateMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set -class BlockEntityCargoCrate( +class CargoCrateBlockEntity( p_155229_: BlockPos, p_155230_: BlockState -) : BlockEntityMattery(MBlockEntities.CARGO_CRATE, p_155229_, p_155230_) { +) : MatteryBlockEntity(MBlockEntities.CARGO_CRATE, p_155229_, p_155230_) { val container = MatteryContainer(this::setChanged, CAPACITY) private var interactingPlayers = 0 val handler = container.handler() fun onPlayerOpen() { if (interactingPlayers++ == 0) { - level?.setBlock(blockPos, blockState.setValue(BlockCargoCrate.IS_OPEN, true), Block.UPDATE_CLIENTS) + level?.setBlock(blockPos, blockState.setValue(CargoCrateBlock.IS_OPEN, true), Block.UPDATE_CLIENTS) } } fun onPlayerClose() { if (--interactingPlayers == 0) { - level?.setBlock(blockPos, blockState.setValue(BlockCargoCrate.IS_OPEN, false), Block.UPDATE_CLIENTS) + level?.setBlock(blockPos, blockState.setValue(CargoCrateBlock.IS_OPEN, false), Block.UPDATE_CLIENTS) } } @@ -72,7 +72,7 @@ class BlockEntityCargoCrate( } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuCargoCrate(containerID, inventory, this) + return CargoCrateMenu(containerID, inventory, this) } companion object { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ChemicalGeneratorBlockEntity.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ChemicalGeneratorBlockEntity.kt index 9cdbd35de..6b3cbfb90 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ChemicalGeneratorBlockEntity.kt @@ -6,7 +6,6 @@ import net.minecraft.nbt.CompoundTag import net.minecraft.nbt.IntTag import net.minecraft.network.chat.Component import net.minecraft.network.chat.TranslatableComponent -import net.minecraft.server.level.ServerLevel import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu @@ -27,17 +26,17 @@ import ru.dbotthepony.mc.otm.capability.* import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.core.plus -import ru.dbotthepony.mc.otm.menu.MenuChemicalGenerator +import ru.dbotthepony.mc.otm.menu.ChemicalGeneratorMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.lang.ref.WeakReference -class BlockEntityChemicalGenerator(pos: BlockPos, state: BlockState) : BlockEntityMattery(MBlockEntities.CHEMICAL_GENERATOR, pos, state) { +class ChemicalGeneratorBlockEntity(pos: BlockPos, state: BlockState) : MatteryBlockEntity(MBlockEntities.CHEMICAL_GENERATOR, pos, state) { override fun getDefaultDisplayName(): Component { return NAME } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuChemicalGenerator(containerID, inventory, this) + return ChemicalGeneratorMenu(containerID, inventory, this) } private var valid = true diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveRack.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveRack.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt index 8dedb4600..68e0392ae 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveRack.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt @@ -20,14 +20,14 @@ import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.ifHas -import ru.dbotthepony.mc.otm.menu.MenuDriveRack +import ru.dbotthepony.mc.otm.menu.DriveRackMenu import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent -class BlockEntityDriveRack(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(MBlockEntities.DRIVE_RACK, p_155229_, p_155230_) { +class DriveRackBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryPoweredBlockEntity(MBlockEntities.DRIVE_RACK, p_155229_, p_155230_) { override val energy = WorkerEnergyStorage(this, STORAGE) @JvmField @@ -76,7 +76,7 @@ class BlockEntityDriveRack(p_155229_: BlockPos, p_155230_: BlockState) : } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { - return MenuDriveRack(containerID, inventory, this) + return DriveRackMenu(containerID, inventory, this) } override fun getCapability(cap: Capability, side: Direction?): LazyOptional { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveViewer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt similarity index 86% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveViewer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt index 5260e6ab4..e3c18b193 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveViewer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt @@ -12,19 +12,19 @@ import net.minecraft.world.item.ItemStack import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.block.BlockDriveViewer +import ru.dbotthepony.mc.otm.block.DriveViewerBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.container.MatteryContainer -import ru.dbotthepony.mc.otm.menu.MenuDriveViewer +import ru.dbotthepony.mc.otm.menu.DriveViewerMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import javax.annotation.ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryPowered(MBlockEntities.DRIVE_VIEWER, p_155229_, p_155230_) { +class DriveViewerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryPoweredBlockEntity(MBlockEntities.DRIVE_VIEWER, p_155229_, p_155230_) { override fun setChanged() { super.setChanged() @@ -55,9 +55,9 @@ class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : Block var state = blockState if (new.getCapability(MatteryCapability.DRIVE).isPresent) { - state = state.setValue(BlockDriveViewer.DRIVE_PRESENT, true) + state = state.setValue(DriveViewerBlock.DRIVE_PRESENT, true) } else { - state = state.setValue(BlockDriveViewer.DRIVE_PRESENT, false) + state = state.setValue(DriveViewerBlock.DRIVE_PRESENT, false) } if (state !== blockState) { @@ -73,7 +73,7 @@ class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : Block } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { - return MenuDriveViewer(containerID, inventory, this) + return DriveViewerMenu(containerID, inventory, this) } override fun saveAdditional(nbt: CompoundTag) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/EnergyCounterBlockEntity.kt similarity index 95% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityEnergyCounter.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/EnergyCounterBlockEntity.kt index f7a3084fd..e257d6eeb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/EnergyCounterBlockEntity.kt @@ -23,13 +23,13 @@ import net.minecraftforge.energy.IEnergyStorage import net.minecraftforge.network.NetworkEvent import net.minecraftforge.network.PacketDistributor import ru.dbotthepony.mc.otm.* -import ru.dbotthepony.mc.otm.block.BlockEnergyCounter +import ru.dbotthepony.mc.otm.block.EnergyCounterBlock import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.extractEnergy import ru.dbotthepony.mc.otm.capability.receiveEnergy import ru.dbotthepony.mc.otm.core.ImpreciseFraction -import ru.dbotthepony.mc.otm.menu.MenuEnergyCounter +import ru.dbotthepony.mc.otm.menu.EnergyCounterMenu import ru.dbotthepony.mc.otm.network.MatteryNetworking import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.lang.ref.WeakReference @@ -72,7 +72,7 @@ data class EnergyCounterPacket(val pos: BlockPos, val thisTick: ImpreciseFractio } } -class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(MBlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) { +class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(MBlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) { var passed = ImpreciseFraction.ZERO private val history = Array(10 * 20) { ImpreciseFraction.ZERO } @@ -164,7 +164,7 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuEnergyCounter(containerID, inventory, this) + return EnergyCounterMenu(containerID, inventory, this) } private val energyInput = EnergyCounterCap(true) @@ -367,7 +367,7 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo val old = blockState super.setBlockState(new) - if (new !== old && new.getValue(BlockEnergyCounter.INPUT_DIRECTION) != old.getValue(BlockEnergyCounter.INPUT_DIRECTION)) { + if (new !== old && new.getValue(EnergyCounterBlock.INPUT_DIRECTION) != old.getValue(EnergyCounterBlock.INPUT_DIRECTION)) { resolverInput.invalidate() resolverOutput.invalidate() resolverInput = LazyOptional.of { energyInput } @@ -409,13 +409,13 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo inputCapability = getAndBind( level, inputCapability, - blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION) + blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION) ) outputCapability = getAndBind( level, outputCapability, - -blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION) + -blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION) ) } @@ -424,11 +424,11 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo return super.getCapability(cap, side) if (valid) { - if (side == blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION)) { + if (side == blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION)) { if (cap === MatteryCapability.ENERGY || cap === CapabilityEnergy.ENERGY) { return resolverInput.cast() } - } else if (side == blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION).opposite) { + } else if (side == blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION).opposite) { if (cap === MatteryCapability.ENERGY || cap === CapabilityEnergy.ENERGY) { return resolverOutput.cast() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/GravitationStabilizerBlockEntity.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/GravitationStabilizerBlockEntity.kt index 6f798ece2..57095b172 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/GravitationStabilizerBlockEntity.kt @@ -12,21 +12,21 @@ import net.minecraft.world.phys.AABB import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizer import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizerLens import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.core.times import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockEntityGravitationStabilizer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery( +class GravitationStabilizerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity( MBlockEntities.GRAVITATION_STABILIZER, p_155229_, p_155230_) { override fun getDefaultDisplayName() = NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player) = null - private var blackHole: BlockEntityBlackHole? = null + private var blackHole: BlackHoleBlockEntity? = null fun tick(level: Level) { - var findBlackHole: BlockEntityBlackHole? = null + var findBlackHole: BlackHoleBlockEntity? = null val dir = blockState.getValue(BlockMatteryRotatable.FACING_FULL).normal for (i in 2 .. RANGE) { @@ -38,7 +38,7 @@ class BlockEntityGravitationStabilizer(p_155229_: BlockPos, p_155230_: BlockStat val tile = chunk.getBlockEntity(pos) if (tile != null) { - if (tile is BlockEntityBlackHole) { + if (tile is BlackHoleBlockEntity) { findBlackHole = tile } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityItemMonitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityItemMonitor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt index 182416c0c..4e496e021 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityItemMonitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt @@ -16,11 +16,11 @@ import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph -import ru.dbotthepony.mc.otm.menu.MenuItemMonitor +import ru.dbotthepony.mc.otm.menu.ItemMonitorMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(MBlockEntities.ITEM_MONITOR, p_155229_, p_155230_) { +class ItemMonitorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryPoweredBlockEntity(MBlockEntities.ITEM_MONITOR, p_155229_, p_155230_) { @JvmField val cell = BasicStorageGraphNode() @@ -35,7 +35,7 @@ class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) : } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuItemMonitor(containerID, inventory, this) + return ItemMonitorMenu(containerID, inventory, this) } override fun setLevel(p_155231_: Level) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterBottler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt similarity index 95% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterBottler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt index a9f7694c5..5256bcbac 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterBottler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt @@ -16,7 +16,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.BlockMatterBottler +import ru.dbotthepony.mc.otm.block.MatterBottlerBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage @@ -29,13 +29,13 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.ifHas -import ru.dbotthepony.mc.otm.menu.MenuMatterBottler +import ru.dbotthepony.mc.otm.menu.MatterBottlerMenu import ru.dbotthepony.mc.otm.orNull import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set -class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(MBlockEntities.MATTER_BOTTLER, p_155229_, p_155230_), IMatterGraphNode { +class MatterBottlerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryPoweredBlockEntity(MBlockEntities.MATTER_BOTTLER, p_155229_, p_155230_), IMatterGraphNode { private val node = Graph6Node(this) private val resolverNode = LazyOptional.of { this } @@ -67,8 +67,8 @@ class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) : for (i in initial .. initial + 2) { val desired = !container.getItem(i).isEmpty && container.getItem(i).getCapability(MatteryCapability.MATTER).isPresent - if (state.getValue(BlockMatterBottler.SLOT_PROPERTIES[i - initial]) != desired) { - state = state.setValue(BlockMatterBottler.SLOT_PROPERTIES[i - initial], desired) + if (state.getValue(MatterBottlerBlock.SLOT_PROPERTIES[i - initial]) != desired) { + state = state.setValue(MatterBottlerBlock.SLOT_PROPERTIES[i - initial], desired) } } @@ -110,7 +110,7 @@ class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) : val matter: MatterHandlerImpl = object : MatterHandlerImpl(this::setChangedLight, MatterDirection.BIDIRECTIONAL, CAPACITY) { override val direction: MatterDirection get() { - return if (this@BlockEntityMatterBottler.workFlow) MatterDirection.RECEIVE else MatterDirection.EXTRACT + return if (this@MatterBottlerBlockEntity.workFlow) MatterDirection.RECEIVE else MatterDirection.EXTRACT } } @@ -167,7 +167,7 @@ class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) : } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuMatterBottler(containerID, inventory, this) + return MatterBottlerMenu(containerID, inventory, this) } override fun saveAdditional(nbt: CompoundTag) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCable.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCableBlockEntity.kt similarity index 97% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCable.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCableBlockEntity.kt index b181f1f7f..533783b08 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCable.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCableBlockEntity.kt @@ -17,7 +17,7 @@ import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockEntityMatterCable(p_155229_: BlockPos, p_155230_: BlockState) : +class MatterCableBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.MATTER_CABLE, p_155229_, p_155230_), IMatterGraphNode, GraphNodeListener { private var valid = true diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt index 4c445e31f..ca45156e3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt @@ -16,7 +16,7 @@ import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional -import ru.dbotthepony.mc.otm.block.BlockBatteryBank +import ru.dbotthepony.mc.otm.block.BatteryBankBlock import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler import ru.dbotthepony.mc.otm.capability.matter.MatterDirection @@ -25,15 +25,15 @@ import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph -import ru.dbotthepony.mc.otm.menu.MenuMatterCapacitor +import ru.dbotthepony.mc.otm.menu.MatterCapacitorMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import javax.annotation.ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMattery(MBlockEntities.MATTER_CAPACITOR_BANK, p_155229_, p_155230_), IMatterGraphNode, IMatterHandler { +class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryBlockEntity(MBlockEntities.MATTER_CAPACITOR_BANK, p_155229_, p_155230_), IMatterGraphNode, IMatterHandler { private val node = Graph6Node(this) private val resolverNode = LazyOptional.of { this } @@ -130,9 +130,9 @@ class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState) if (level != null) { var state = blockState - for (i in BlockBatteryBank.BATTERY_SLOTS_PROPS.indices) { + for (i in BatteryBankBlock.BATTERY_SLOTS_PROPS.indices) { state = state.setValue( - BlockBatteryBank.BATTERY_SLOTS_PROPS[i], + BatteryBankBlock.BATTERY_SLOTS_PROPS[i], getItem(i).getCapability(MatteryCapability.MATTER).isPresent ) } @@ -163,7 +163,7 @@ class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState) } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuMatterCapacitor(containerID, inventory, this) + return MatterCapacitorMenu(containerID, inventory, this) } private var valid = true diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterDecomposer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterDecomposer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt index b737fc87c..7036a8b7a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterDecomposer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt @@ -16,7 +16,7 @@ import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler import net.minecraftforge.items.IItemHandler -import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker +import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus import ru.dbotthepony.mc.otm.capability.MatteryCapability @@ -33,7 +33,7 @@ import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.matter.baselineComplexityDecomposeTicks import ru.dbotthepony.mc.otm.matter.canDecompose import ru.dbotthepony.mc.otm.matter.getMatterValue -import ru.dbotthepony.mc.otm.menu.MenuMatterDecomposer +import ru.dbotthepony.mc.otm.menu.MatterDecomposerMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.set @@ -91,8 +91,8 @@ fun moveMatterAsDustIntoContainer(_matterValue: ImpreciseFraction, container: Ma return ImpreciseFraction.ZERO } -class BlockEntityMatterDecomposer(pos: BlockPos, state: BlockState) - : BlockEntityMatteryWorker(MBlockEntities.MATTER_DECOMPOSER, pos, state), IMatterGraphNode { +class MatterDecomposerBlockEntity(pos: BlockPos, state: BlockState) + : MatteryWorkerBlockEntity(MBlockEntities.MATTER_DECOMPOSER, pos, state), IMatterGraphNode { override val energy = WorkerEnergyStorage(this, ENERGY_STORAGE, MAX_IO) private var valid = true @@ -127,7 +127,7 @@ class BlockEntityMatterDecomposer(pos: BlockPos, state: BlockState) } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuMatterDecomposer(containerID, inventory, this) + return MatterDecomposerMenu(containerID, inventory, this) } override fun saveAdditional(nbt: CompoundTag) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterPanel.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt index f132565ac..33ba140f9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt @@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.world.level.block.state.BlockState import ru.dbotthepony.mc.otm.capability.matter.IMatterTaskProvider -import ru.dbotthepony.mc.otm.menu.MenuMatterPanel +import ru.dbotthepony.mc.otm.menu.MatterPanelMenu import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu @@ -31,21 +31,21 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.util.ArrayList import java.util.List -class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMattery(MBlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider { +class MatterPanelBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryBlockEntity(MBlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider { - private val listeners = ArrayList() + private val listeners = ArrayList() private val node = Graph6Node(this) override fun getAsMatterNode(): Graph6Node { return node } - fun attachMenu(menu: MenuMatterPanel) { + fun attachMenu(menu: MatterPanelMenu) { listeners.add(menu) } - fun deatachMenu(menu: MenuMatterPanel) { + fun deatachMenu(menu: MatterPanelMenu) { listeners.remove(menu) } @@ -54,7 +54,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuMatterPanel(containerID, inventory, this) + return MatterPanelMenu(containerID, inventory, this) } private var valid = true @@ -117,7 +117,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : if (!simulate) { val new = task.shrinkRequired(1) _tasks[key] = new - listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(new) } + listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(new) } graph.onMatterTaskUpdated(new, task) setChanged() } @@ -141,12 +141,12 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : if (localTask.required <= 0 && localTask.in_progress <= 0) { _tasks.remove(task.id) graph?.onMatterTaskCreated(task) - listeners.forEach { menu: MenuMatterPanel -> menu.taskRemoved(localTask) } + listeners.forEach { menu: MatterPanelMenu -> menu.taskRemoved(localTask) } } else { // Задача обновлена _tasks[task.id()] = localTask graph?.onMatterTaskUpdated(localTask, oldTask) - listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(localTask) } + listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(localTask) } } setChanged() @@ -189,7 +189,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : (node.graph as MatterNetworkGraph?)?.onMatterTaskRemoved(task) - listeners.forEach { menu: MenuMatterPanel -> menu.taskRemoved(task) } + listeners.forEach { menu: MatterPanelMenu -> menu.taskRemoved(task) } setChanged() } @@ -201,7 +201,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : (node.graph as MatterNetworkGraph?)?.onMatterTaskCreated(task) - listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(task) } + listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(task) } setChanged() return task @@ -212,7 +212,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : for (task in _tasks.values) { graph?.onMatterTaskRemoved(task) - listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(task) } + listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(task) } } _tasks.clear() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterRecycler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt similarity index 91% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterRecycler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt index 25bdd9e0a..9ddec003c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterRecycler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt @@ -14,7 +14,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker +import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus import ru.dbotthepony.mc.otm.block.entity.worker.WorkerTickContext @@ -30,13 +30,13 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.ifHas -import ru.dbotthepony.mc.otm.item.ItemMatterDust -import ru.dbotthepony.mc.otm.menu.MenuMatterRecycler +import ru.dbotthepony.mc.otm.item.MatterDustItem +import ru.dbotthepony.mc.otm.menu.MatterRecyclerMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set -class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState) - : BlockEntityMatteryWorker(MBlockEntities.MATTER_RECYCLER, blockPos, blockState), IMatterGraphNode { +class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState) + : MatteryWorkerBlockEntity(MBlockEntities.MATTER_RECYCLER, blockPos, blockState), IMatterGraphNode { val matter = MatterHandlerImpl( this::setChangedLight, MatterDirection.EXTRACT, @@ -58,7 +58,7 @@ class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState) private val itemHandler = container.handler(object : MatteryContainerFilter { override fun canInsert(slot: Int, stack: ItemStack): Boolean { - return stack.item is ItemMatterDust + return stack.item is MatterDustItem } override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean { @@ -122,7 +122,7 @@ class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState) override fun getDefaultDisplayName() = NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuMatterRecycler(containerID, inventory, this) + return MatterRecyclerMenu(containerID, inventory, this) } override fun onJobFinish(job: WorkerJob): WorkerJobStatus { @@ -136,14 +136,14 @@ class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState) val stack = container[0] - if (stack.isEmpty || stack.item !is ItemMatterDust) { + if (stack.isEmpty || stack.item !is MatterDustItem) { return null } val copy = stack.copy() copy.count = 1 - val dustMatter = (stack.item as ItemMatterDust).getMatterValue(copy) ?: return null + val dustMatter = (stack.item as MatterDustItem).getMatterValue(copy) ?: return null stack.shrink(1) return WorkerJob(copy, dustMatter.value.toDouble() * MATTER_TICKS, POWER_CONSUMPTION) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterReplicator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterReplicator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt index 9a2bd3bb7..6d4f05c73 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterReplicator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt @@ -14,7 +14,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker +import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus import ru.dbotthepony.mc.otm.block.entity.worker.WorkerTickContext @@ -30,12 +30,12 @@ import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.matter.baselineComplexityReplicateTicks import ru.dbotthepony.mc.otm.matter.getMatterValue -import ru.dbotthepony.mc.otm.menu.MenuMatterReplicator +import ru.dbotthepony.mc.otm.menu.MatterReplicatorMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set -class BlockEntityMatterReplicator(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryWorker(MBlockEntities.MATTER_REPLICATOR, p_155229_, p_155230_), IMatterGraphNode { +class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryWorkerBlockEntity(MBlockEntities.MATTER_REPLICATOR, p_155229_, p_155230_), IMatterGraphNode { override val energy = WorkerEnergyStorage(this, STORAGE, MAX_IO) private val node = Graph6Node(this) @@ -62,7 +62,7 @@ class BlockEntityMatterReplicator(p_155229_: BlockPos, p_155230_: BlockState) : } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuMatterReplicator(containerID, inventory, this) + return MatterReplicatorMenu(containerID, inventory, this) } override fun onJobFinish(job: WorkerJob): WorkerJobStatus { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterScanner.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterScanner.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt index 244fd4b75..5a405a023 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterScanner.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt @@ -15,7 +15,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker +import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus import ru.dbotthepony.mc.otm.capability.MatteryCapability @@ -27,12 +27,12 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.matter.* -import ru.dbotthepony.mc.otm.menu.MenuMatterScanner +import ru.dbotthepony.mc.otm.menu.MatterScannerMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.util.* -class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryWorker(MBlockEntities.MATTER_SCANNER, p_155229_, p_155230_), IMatterGraphNode { +class MatterScannerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryWorkerBlockEntity(MBlockEntities.MATTER_SCANNER, p_155229_, p_155230_), IMatterGraphNode { val container = MatteryContainer(this::setChanged, 1) override val energy = WorkerEnergyStorage(this, STORAGE, MAX_IO) @@ -97,7 +97,7 @@ class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) : } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuMatterScanner(containerID, inventory, this) + return MatterScannerMenu(containerID, inventory, this) } override fun saveAdditional(nbt: CompoundTag) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMattery.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt similarity index 95% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMattery.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt index ed14ee063..c383ecdf2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMattery.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt @@ -6,7 +6,6 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.MenuProvider import java.lang.Runnable -import ru.dbotthepony.mc.otm.OverdriveThatMatters import net.minecraft.server.level.ServerLevel import net.minecraft.client.multiplayer.ClientLevel import net.minecraft.core.Direction @@ -22,13 +21,11 @@ import net.minecraft.nbt.StringTag import net.minecraft.nbt.ByteTag import net.minecraft.network.chat.Component import net.minecraft.world.level.Level -import net.minecraft.world.level.chunk.ChunkStatus import net.minecraftforge.common.capabilities.Capability import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.set -import java.util.function.Consumer -abstract class BlockEntityMattery(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(p_155228_, p_155229_, p_155230_), MenuProvider { +abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(p_155228_, p_155229_, p_155230_), MenuProvider { var customDisplayName: Component? = null var redstoneSignal = 0 set(level) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatteryPowered.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt similarity index 91% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatteryPowered.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt index 8d37f3777..92f9070ea 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatteryPowered.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt @@ -10,12 +10,11 @@ import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.energy.CapabilityEnergy import ru.dbotthepony.mc.otm.capability.* import ru.dbotthepony.mc.otm.container.MatteryContainer -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.set -abstract class BlockEntityMatteryPowered(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(p_155228_, p_155229_, p_155230_) { +abstract class MatteryPoweredBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(p_155228_, p_155229_, p_155230_) { abstract val energy: EnergyStorageImpl private var valid = true val batteryContainer = MatteryContainer(this::setChangedLight, 1) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPatternStorage.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPatternStorage.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt index 88a79eb1b..e4d86cb50 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPatternStorage.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt @@ -6,14 +6,14 @@ import net.minecraft.world.level.block.state.BlockState import ru.dbotthepony.mc.otm.container.MatteryContainer import net.minecraft.world.item.ItemStack import ru.dbotthepony.mc.otm.capability.MatteryCapability -import ru.dbotthepony.mc.otm.block.BlockPatternStorage +import ru.dbotthepony.mc.otm.block.PatternStorageBlock import net.minecraft.nbt.CompoundTag import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu -import ru.dbotthepony.mc.otm.menu.MenuPatternStorage +import ru.dbotthepony.mc.otm.menu.PatternStorageMenu import net.minecraft.MethodsReturnNonnullByDefault import net.minecraft.core.Direction import net.minecraft.network.chat.Component @@ -33,8 +33,8 @@ import java.util.ArrayList @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMattery(MBlockEntities.PATTERN_STORAGE, p_155229_, p_155230_), IMatterGraphNode, IPatternStorage { +class PatternStorageBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : + MatteryBlockEntity(MBlockEntities.PATTERN_STORAGE, p_155229_, p_155230_), IMatterGraphNode, IPatternStorage { private val node = Graph6Node(this) private val resolverPatterns = LazyOptional.of { this } @@ -76,7 +76,7 @@ class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) : for (i in 0..7) { state = state.setValue( - BlockPatternStorage.PATTERN_STORAGE_DISKS_PROPS[i], + PatternStorageBlock.PATTERN_STORAGE_DISKS_PROPS[i], patterns.getItem(i).getCapability(MatteryCapability.PATTERN).isPresent ) } @@ -147,7 +147,7 @@ class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) : } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return MenuPatternStorage(containerID, inventory, this) + return PatternStorageMenu(containerID, inventory, this) } override val storedPatterns: Collection get() { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PlatePressBlockEntity.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PlatePressBlockEntity.kt index efe7e4ab5..ee31ceff1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PlatePressBlockEntity.kt @@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker +import ru.dbotthepony.mc.otm.block.entity.worker.MatteryWorkerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage @@ -24,7 +24,7 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.registry.MRecipes import ru.dbotthepony.mc.otm.set -class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryWorker(MBlockEntities.PLATE_PRESS, p_155229_, p_155230_) { +class PlatePressBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryWorkerBlockEntity(MBlockEntities.PLATE_PRESS, p_155229_, p_155230_) { val container = MatteryContainer(this::setChangedLight, 2) override val energy = WorkerEnergyStorage(this::setChangedLight) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt index 5e989c341..30ad8de6f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt @@ -22,8 +22,8 @@ import net.minecraft.world.level.levelgen.structure.BoundingBox import net.minecraft.world.phys.AABB import net.minecraft.world.phys.Vec3 import ru.dbotthepony.mc.otm.registry.Registry -import ru.dbotthepony.mc.otm.block.BlockBlackHole -import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer +import ru.dbotthepony.mc.otm.block.BlackHoleBlock +import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity import ru.dbotthepony.mc.otm.block.entity.blackhole.ExplosionQueue.Companion.queueForLevel import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.core.plus @@ -34,7 +34,7 @@ import ru.dbotthepony.mc.otm.set import kotlin.math.roundToInt import kotlin.math.sqrt -class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.BLACK_HOLE, p_155229_, p_155230_) { +class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.BLACK_HOLE, p_155229_, p_155230_) { var mass = BASELINE_MASS set(mass) { if (mass <= ImpreciseFraction.ZERO) { @@ -79,7 +79,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn } override fun getRenderBoundingBox(): AABB { - return AABB(blockPos.offset(-BlockEntityGravitationStabilizer.RANGE, -BlockEntityGravitationStabilizer.RANGE, -BlockEntityGravitationStabilizer.RANGE), blockPos.offset(BlockEntityGravitationStabilizer.RANGE, BlockEntityGravitationStabilizer.RANGE, BlockEntityGravitationStabilizer.RANGE)) + return AABB(blockPos.offset(-GravitationStabilizerBlockEntity.RANGE, -GravitationStabilizerBlockEntity.RANGE, -GravitationStabilizerBlockEntity.RANGE), blockPos.offset(GravitationStabilizerBlockEntity.RANGE, GravitationStabilizerBlockEntity.RANGE, GravitationStabilizerBlockEntity.RANGE)) } var gravitationStrength = 1.0 @@ -95,10 +95,10 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn sleepTicks = 4 } - private val stabilizers = ArrayList() + private val stabilizers = ArrayList() private var stabilizerClientCount = 0 - fun stabilizerAttached(stabilizer: BlockEntityGravitationStabilizer) { + fun stabilizerAttached(stabilizer: GravitationStabilizerBlockEntity) { if (stabilizers.contains(stabilizer)) return @@ -106,7 +106,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn mass = mass } - fun stabilizerDetached(stabilizer: BlockEntityGravitationStabilizer) { + fun stabilizerDetached(stabilizer: GravitationStabilizerBlockEntity) { if (stabilizers.remove(stabilizer)) { mass = mass } @@ -315,7 +315,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn val getBlock = level.getBlockState(pos) - if (!getBlock.isAir && getBlock.block !is BlockBlackHole) { + if (!getBlock.isAir && getBlock.block !is BlackHoleBlock) { val speed = getBlock.getDestroySpeed(level, pos) val eResist = try { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityExplosionDebugger.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/ExplosionDebuggerBlockEntity.kt similarity index 100% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityExplosionDebugger.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/ExplosionDebuggerBlockEntity.kt diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/worker/BlockEntityMatteryWorker.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/worker/MatteryWorkerBlockEntity.kt similarity index 97% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/worker/BlockEntityMatteryWorker.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/worker/MatteryWorkerBlockEntity.kt index e87979e81..bb3991c28 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/worker/BlockEntityMatteryWorker.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/worker/MatteryWorkerBlockEntity.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.block.entity.worker import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.core.BlockPos import net.minecraft.world.level.block.state.BlockState -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatteryPowered +import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity import net.minecraft.nbt.CompoundTag import net.minecraft.nbt.DoubleTag import net.minecraft.world.level.block.Block @@ -13,8 +13,8 @@ import ru.dbotthepony.mc.otm.core.weakLessThan import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.set -abstract class BlockEntityMatteryWorker(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(p_155228_, p_155229_, p_155230_) { +abstract class MatteryWorkerBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : + MatteryPoweredBlockEntity(p_155228_, p_155229_, p_155230_) { var workTicks = 0.0 protected set diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt index f259fef76..547f33357 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt @@ -12,8 +12,8 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider import net.minecraft.network.chat.TranslatableComponent import net.minecraft.world.phys.Vec3 import org.lwjgl.opengl.GL30 -import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole +import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.core.* import ru.dbotthepony.mc.otm.menu.FormattingHelper @@ -68,8 +68,8 @@ private fun beam(matrix4f: Matrix4f, builder: BufferBuilder, fwdRotation: Double private fun quadY(z: Double): Array { return arrayOf( Vector(0.0, -BEAM_WIDTH, z), - Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), -BEAM_WIDTH, z), - Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), BEAM_WIDTH, z), + Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), -BEAM_WIDTH, z), + Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), BEAM_WIDTH, z), Vector(0.0, BEAM_WIDTH, z) ) } @@ -77,15 +77,15 @@ private fun quadY(z: Double): Array { private fun quadZ(y: Double): Array { return arrayOf( Vector(0.0, y, -BEAM_WIDTH), - Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), y, -BEAM_WIDTH), - Vector(BlockEntityGravitationStabilizer.RANGE.toDouble(), y, BEAM_WIDTH), + Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), y, -BEAM_WIDTH), + Vector(GravitationStabilizerBlockEntity.RANGE.toDouble(), y, BEAM_WIDTH), Vector(0.0, y, BEAM_WIDTH) ) } -class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer { +class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer { override fun render( - tile: BlockEntityBlackHole, + tile: BlackHoleBlockEntity, v: Float, poseStack: PoseStack, multiBufferSource: MultiBufferSource, @@ -182,11 +182,11 @@ class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context } } - override fun shouldRenderOffScreen(p_112306_: BlockEntityBlackHole): Boolean { + override fun shouldRenderOffScreen(p_112306_: BlackHoleBlockEntity): Boolean { return true } - override fun shouldRender(p_173568_: BlockEntityBlackHole, p_173569_: Vec3): Boolean { + override fun shouldRender(p_173568_: BlackHoleBlockEntity, p_173569_: Vec3): Boolean { return true } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/EnergyCounterRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/EnergyCounterRenderer.kt index b105c657b..021127513 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/EnergyCounterRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/EnergyCounterRenderer.kt @@ -7,7 +7,7 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderer import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider import net.minecraft.core.Direction import net.minecraft.network.chat.TranslatableComponent -import ru.dbotthepony.mc.otm.block.BlockEnergyCounter +import ru.dbotthepony.mc.otm.block.EnergyCounterBlock import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter import ru.dbotthepony.mc.otm.core.RGBAColor import ru.dbotthepony.mc.otm.core.asAngle @@ -24,8 +24,8 @@ class EnergyCounterRenderer(private val context: BlockEntityRendererProvider.Con p_112311_: Int, p_112312_: Int ) { - val screenDir: Direction = tile.blockState.getValue(BlockEnergyCounter.IF_DIRECTION) - val inputDir: Direction = tile.blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION) + val screenDir: Direction = tile.blockState.getValue(EnergyCounterBlock.IF_DIRECTION) + val inputDir: Direction = tile.blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION) poseStack.pushPose() poseStack.translate(0.5, 0.5, 0.5) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt index 120f12793..a9d66cbe2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt @@ -11,10 +11,10 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider import net.minecraft.client.renderer.texture.OverlayTexture import net.minecraft.core.Direction import net.minecraft.network.chat.TranslatableComponent -import ru.dbotthepony.mc.otm.block.BlockBlackHole +import ru.dbotthepony.mc.otm.block.BlackHoleBlock import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable -import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole +import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.core.* import ru.dbotthepony.mc.otm.menu.FormattingHelper @@ -23,9 +23,9 @@ import kotlin.math.PI private val BEAM_RENDER_TYPE_INNER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, false) private val BEAM_RENDER_TYPE_OUTER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, true) -class GravitationStabilizerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer { +class GravitationStabilizerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer { override fun render( - tile: BlockEntityGravitationStabilizer, + tile: GravitationStabilizerBlockEntity, p_112308_: Float, poseStack: PoseStack, p_112310_: MultiBufferSource, @@ -39,14 +39,14 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv var lenI = 64 val normal = tile.blockState.getValue(BlockMatteryRotatable.FACING_FULL).normal val level = tile.level - var bhTile: BlockEntityBlackHole? = null + var bhTile: BlackHoleBlockEntity? = null if (level != null) { - for (i in 1 .. BlockEntityGravitationStabilizer.RANGE) { + for (i in 1 .. GravitationStabilizerBlockEntity.RANGE) { val pos = tile.blockPos + normal * i - val getTile = level.getBlockEntity(pos) as? BlockEntityBlackHole + val getTile = level.getBlockEntity(pos) as? BlackHoleBlockEntity - if (getTile != null || level.getBlockState(pos).block is BlockBlackHole) { + if (getTile != null || level.getBlockState(pos).block is BlackHoleBlock) { len = i.toDouble() lenI = i bhTile = getTile @@ -151,7 +151,7 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv } } - override fun shouldRenderOffScreen(p_112306_: BlockEntityGravitationStabilizer) = true + override fun shouldRenderOffScreen(p_112306_: GravitationStabilizerBlockEntity) = true override fun getViewDistance() = 96 companion object { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/AndroidStationScreen.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenAndroidStation.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/AndroidStationScreen.kt index b34fba199..4d9fe34a0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/AndroidStationScreen.kt @@ -19,12 +19,12 @@ import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.menu.AndroidStationMenu import java.util.* -class ScreenAndroidStation constructor(p_97741_: AndroidStationMenu, p_97742_: Inventory, p_97743_: Component) : +class AndroidStationScreen constructor(p_97741_: AndroidStationMenu, p_97742_: Inventory, p_97743_: Component) : MatteryScreen(p_97741_, p_97742_, p_97743_) { internal inner class AndroidResearchButton(parent: EditablePanel?, private val node: AndroidResearch) : EditablePanel( - this@ScreenAndroidStation, + this@AndroidStationScreen, parent, 0f, 0f, @@ -103,7 +103,7 @@ class ScreenAndroidStation constructor(p_97741_: AndroidStationMenu, p_97742_: I seen.add(research) if (rows[level] == null) { - rows[level] = object : EditablePanel(this@ScreenAndroidStation, canvas, 0f, (level * 22).toFloat(), 10000f, 22f) { + rows[level] = object : EditablePanel(this@AndroidStationScreen, canvas, 0f, (level * 22).toFloat(), 10000f, 22f) { override fun mouseClickedInner(mouse_x: Double, mouse_y: Double, flag: Int) = false override fun mouseReleasedInner(mouse_x: Double, mouse_y: Double, flag: Int) = false override fun mouseDraggedInner(mouse_x: Double, mouse_y: Double, flag: Int, drag_x: Double, drag_y: Double) = false @@ -138,7 +138,7 @@ class ScreenAndroidStation constructor(p_97741_: AndroidStationMenu, p_97742_: I research = FramePanel(this, null, 0f, 0f, window.guiScaledWidth * 0.8f, window.guiScaledHeight * 0.8f, TranslatableComponent("otm.gui.android_research")) - canvas = object : DraggableCanvasPanel(this@ScreenAndroidStation, research, width = (GRID_WIDTH * 22).toFloat(), height = 0f) { + canvas = object : DraggableCanvasPanel(this@AndroidStationScreen, research, width = (GRID_WIDTH * 22).toFloat(), height = 0f) { override fun innerRender(stack: PoseStack, mouse_x: Float, mouse_y: Float, flag: Float) { RenderHelper.setDrawColor(RGBAColor.BLACK) RenderHelper.drawRect(stack, 0f, 0f, width, height) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenBatteryBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/BatteryBankScreen.kt similarity index 80% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenBatteryBank.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/BatteryBankScreen.kt index b7ffc1a67..933d14722 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenBatteryBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/BatteryBankScreen.kt @@ -1,14 +1,14 @@ package ru.dbotthepony.mc.otm.client.screen import net.minecraft.network.chat.Component -import ru.dbotthepony.mc.otm.menu.MenuBatteryBank +import ru.dbotthepony.mc.otm.menu.BatteryBankMenu import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel -class ScreenBatteryBank(menu: MenuBatteryBank, p_97742_: Inventory, p_97743_: Component) : - MatteryScreen(menu, p_97742_, p_97743_) { +class BatteryBankScreen(menu: BatteryBankMenu, p_97742_: Inventory, p_97743_: Component) : + MatteryScreen(menu, p_97742_, p_97743_) { override fun makeMainFrame(): FramePanel{ val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenCargoCrate.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/CargoCrateScreen.kt similarity index 78% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenCargoCrate.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/CargoCrateScreen.kt index 4e2f6e403..fb13a2196 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenCargoCrate.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/CargoCrateScreen.kt @@ -5,9 +5,9 @@ import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.GridPanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel -import ru.dbotthepony.mc.otm.menu.MenuCargoCrate +import ru.dbotthepony.mc.otm.menu.CargoCrateMenu -class ScreenCargoCrate(menu: MenuCargoCrate, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { +class CargoCrateScreen(menu: CargoCrateMenu, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = FramePanel(this, null, 0f, 0f, INVENTORY_FRAME_WIDTH, 22f + 4f + 6f * 18f, getTitle()) val grid = GridPanel(this, frame, 8f, 18f, 9f * 18f, 6f * 18f, 9, 6) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ChemicalGeneratorScreen.kt similarity index 83% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenChemicalGenerator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ChemicalGeneratorScreen.kt index d21db809c..676fcd11f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ChemicalGeneratorScreen.kt @@ -6,9 +6,9 @@ import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.* import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel -import ru.dbotthepony.mc.otm.menu.MenuChemicalGenerator +import ru.dbotthepony.mc.otm.menu.ChemicalGeneratorMenu -class ScreenChemicalGenerator(menu: MenuChemicalGenerator, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { +class ChemicalGeneratorScreen(menu: ChemicalGeneratorMenu, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenDriveRack.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/DriveRackScreen.kt similarity index 83% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenDriveRack.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/DriveRackScreen.kt index 9362bd30c..007069519 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenDriveRack.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/DriveRackScreen.kt @@ -1,14 +1,14 @@ package ru.dbotthepony.mc.otm.client.screen import net.minecraft.network.chat.Component -import ru.dbotthepony.mc.otm.menu.MenuDriveRack +import ru.dbotthepony.mc.otm.menu.DriveRackMenu import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel -class ScreenDriveRack(menu: MenuDriveRack, inventory: Inventory, title: Component) : - MatteryScreen(menu, inventory, title) { +class DriveRackScreen(menu: DriveRackMenu, inventory: Inventory, title: Component) : + MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenDriveViewer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/DriveViewerScreen.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenDriveViewer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/DriveViewerScreen.kt index 6826bb363..b3498dea6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenDriveViewer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/DriveViewerScreen.kt @@ -6,14 +6,14 @@ import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack import ru.dbotthepony.mc.otm.client.screen.panels.* import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel -import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive.FilterSettings -import ru.dbotthepony.mc.otm.menu.MenuDriveViewer -import ru.dbotthepony.mc.otm.menu.MenuDriveViewer.FilterSetPacket -import ru.dbotthepony.mc.otm.menu.MenuDriveViewer.FilterSwitchPacket +import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem.FilterSettings +import ru.dbotthepony.mc.otm.menu.DriveViewerMenu +import ru.dbotthepony.mc.otm.menu.DriveViewerMenu.FilterSetPacket +import ru.dbotthepony.mc.otm.menu.DriveViewerMenu.FilterSwitchPacket import ru.dbotthepony.mc.otm.network.MatteryNetworking -class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Component) : - MatteryScreen(menu, inventory, title) { +class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Component) : + MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle()) @@ -59,7 +59,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp views.add(scroll_bar) for (i in 0 until GRID_WIDTH * GRID_HEIGHT) { - object : AbstractSlotPanel(this@ScreenDriveViewer, grid, 0f, 0f) { + object : AbstractSlotPanel(this@DriveViewerScreen, grid, 0f, 0f) { override fun getItemStack(): ItemStack { val index = i + scroll_bar.getScroll(menu.view.getItems().size / GRID_WIDTH) val list = menu.view.getItems() @@ -91,7 +91,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp settings.add(grid_filter) for (i in 0 until FilterSettings.MAX_FILTERS) { - object : AbstractSlotPanel(this@ScreenDriveViewer, grid_filter, 0f, 0f) { + object : AbstractSlotPanel(this@DriveViewerScreen, grid_filter, 0f, 0f) { override fun getItemStack(): ItemStack { val filter = menu.getFilter() ?: return ItemStack.EMPTY return filter.items[i] @@ -118,7 +118,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp val yes = TranslatableComponent("otm.filter.yes") val matchNbt = - object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_nbt", no)) { + object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_nbt", no)) { override fun tick() { super.tick() @@ -140,7 +140,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp null, FilterSwitchPacket( menu.containerId, - MenuDriveViewer.FilterSwitch.MATCH_NBT, + DriveViewerMenu.FilterSwitch.MATCH_NBT, !filter.matchNbt ) ) @@ -151,7 +151,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp } val matchTag = - object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_tag", no)) { + object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_tag", no)) { override fun tick() { super.tick() @@ -173,7 +173,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp null, FilterSwitchPacket( menu.containerId, - MenuDriveViewer.FilterSwitch.MATCH_TAG, + DriveViewerMenu.FilterSwitch.MATCH_TAG, !filter.matchTag ) ) @@ -184,7 +184,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp } val blacklist = - object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.blacklist", no)) { + object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.blacklist", no)) { override fun tick() { super.tick() @@ -205,7 +205,7 @@ class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Comp null, FilterSwitchPacket( menu.containerId, - MenuDriveViewer.FilterSwitch.BLACKLIST, + DriveViewerMenu.FilterSwitch.BLACKLIST, !filter.isBlacklist ) ) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/EnergyCounterScreen.kt similarity index 84% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenEnergyCounter.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/EnergyCounterScreen.kt index 3801429ec..4fea71f4c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/EnergyCounterScreen.kt @@ -4,14 +4,14 @@ import net.minecraft.network.chat.Component import net.minecraft.network.chat.TranslatableComponent import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.* -import ru.dbotthepony.mc.otm.menu.MenuEnergyCounter +import ru.dbotthepony.mc.otm.menu.EnergyCounterMenu import ru.dbotthepony.mc.otm.menu.FormattingHelper -class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { +class EnergyCounterScreen(menu: EnergyCounterMenu, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! - var label: Label = object : Label(this@ScreenEnergyCounter, frame) { + var label: Label = object : Label(this@EnergyCounterScreen, frame) { override fun tick() { super.tick() text = TranslatableComponent( @@ -24,7 +24,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title: label.dock = Dock.TOP label.setDockMargin(4f, 0f, 0f, 0f) - label = object : Label(this@ScreenEnergyCounter, frame) { + label = object : Label(this@EnergyCounterScreen, frame) { override fun tick() { super.tick() text = TranslatableComponent( @@ -37,7 +37,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title: label.dock = Dock.TOP label.setDockMargin(4f, 0f, 0f, 0f) - label = object : Label(this@ScreenEnergyCounter, frame) { + label = object : Label(this@EnergyCounterScreen, frame) { override fun tick() { super.tick() text = TranslatableComponent( @@ -50,7 +50,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title: label.dock = Dock.TOP label.setDockMargin(4f, 0f, 0f, 0f) - label = object : Label(this@ScreenEnergyCounter, frame) { + label = object : Label(this@EnergyCounterScreen, frame) { override fun tick() { super.tick() text = TranslatableComponent( @@ -63,7 +63,7 @@ class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title: label.dock = Dock.TOP label.setDockMargin(4f, 0f, 0f, 0f) - label = object : Label(this@ScreenEnergyCounter, frame) { + label = object : Label(this@EnergyCounterScreen, frame) { override fun tick() { super.tick() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenItemMonitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ItemMonitorScreen.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenItemMonitor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ItemMonitorScreen.kt index ac63afa99..2a489877c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenItemMonitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ItemMonitorScreen.kt @@ -5,10 +5,10 @@ import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack import ru.dbotthepony.mc.otm.client.screen.panels.* import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel -import ru.dbotthepony.mc.otm.menu.MenuItemMonitor +import ru.dbotthepony.mc.otm.menu.ItemMonitorMenu -class ScreenItemMonitor(menu: MenuItemMonitor, inventory: Inventory, title: Component) : - MatteryScreen(menu, inventory, title) { +class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Component) : + MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle()) @@ -22,7 +22,7 @@ class ScreenItemMonitor(menu: MenuItemMonitor, inventory: Inventory, title: Comp val gridPanel = GridPanel(this, frame, 28f, 16f, GRID_WIDTH * 18f, GRID_HEIGHT * 18f, GRID_WIDTH, GRID_HEIGHT) for (i in 0 until GRID_WIDTH * GRID_HEIGHT) { - object : AbstractSlotPanel(this@ScreenItemMonitor, gridPanel) { + object : AbstractSlotPanel(this@ItemMonitorScreen, gridPanel) { override fun getItemStack(): ItemStack { val index = i + scrollBar.getScroll(menu.view.getItemCount() / GRID_WIDTH) val list = menu.view.getItems() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterBottler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterBottlerScreen.kt similarity index 90% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterBottler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterBottlerScreen.kt index d9cb1b05b..66027cf90 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterBottler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterBottlerScreen.kt @@ -9,10 +9,10 @@ import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel -import ru.dbotthepony.mc.otm.menu.MenuMatterBottler +import ru.dbotthepony.mc.otm.menu.MatterBottlerMenu -class ScreenMatterBottler(menu: MenuMatterBottler, inventory: Inventory, title: Component) : - MatteryScreen(menu, inventory, title) { +class MatterBottlerScreen(menu: MatterBottlerMenu, inventory: Inventory, title: Component) : + MatteryScreen(menu, inventory, title) { private var progress: ProgressGaugePanel? = null diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterCapacitorBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterCapacitorBankScreen.kt similarity index 82% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterCapacitorBank.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterCapacitorBankScreen.kt index 2353fef21..05d8a8df9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterCapacitorBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterCapacitorBankScreen.kt @@ -1,14 +1,14 @@ package ru.dbotthepony.mc.otm.client.screen import net.minecraft.network.chat.Component -import ru.dbotthepony.mc.otm.menu.MenuMatterCapacitor +import ru.dbotthepony.mc.otm.menu.MatterCapacitorMenu import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel -class ScreenMatterCapacitorBank(p_97741_: MenuMatterCapacitor, p_97742_: Inventory, p_97743_: Component) : - MatteryScreen(p_97741_, p_97742_, p_97743_) { +class MatterCapacitorBankScreen(p_97741_: MatterCapacitorMenu, p_97742_: Inventory, p_97743_: Component) : + MatteryScreen(p_97741_, p_97742_, p_97743_) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterDecomposer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterDecomposerScreen.kt similarity index 86% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterDecomposer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterDecomposerScreen.kt index 7b927c8e1..04fd54225 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterDecomposer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterDecomposerScreen.kt @@ -1,7 +1,7 @@ package ru.dbotthepony.mc.otm.client.screen import net.minecraft.network.chat.Component -import ru.dbotthepony.mc.otm.menu.MenuMatterDecomposer +import ru.dbotthepony.mc.otm.menu.MatterDecomposerMenu import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel @@ -9,8 +9,8 @@ import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel -class ScreenMatterDecomposer(p_97741_: MenuMatterDecomposer, p_97742_: Inventory, p_97743_: Component) : - MatteryScreen(p_97741_, p_97742_, p_97743_) { +class MatterDecomposerScreen(p_97741_: MatterDecomposerMenu, p_97742_: Inventory, p_97743_: Component) : + MatteryScreen(p_97741_, p_97742_, p_97743_) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterRecycler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterRecyclerScreen.kt similarity index 84% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterRecycler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterRecyclerScreen.kt index 4703d210b..cd9956e7c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterRecycler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterRecyclerScreen.kt @@ -7,9 +7,9 @@ import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel -import ru.dbotthepony.mc.otm.menu.MenuMatterRecycler +import ru.dbotthepony.mc.otm.menu.MatterRecyclerMenu -class ScreenMatterRecycler(menu: MenuMatterRecycler, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { +class MatterRecyclerScreen(menu: MatterRecyclerMenu, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterReplicator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterReplicatorScreen.kt similarity index 86% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterReplicator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterReplicatorScreen.kt index 43c934843..df404a3b6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterReplicator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterReplicatorScreen.kt @@ -1,7 +1,7 @@ package ru.dbotthepony.mc.otm.client.screen import net.minecraft.network.chat.Component -import ru.dbotthepony.mc.otm.menu.MenuMatterReplicator +import ru.dbotthepony.mc.otm.menu.MatterReplicatorMenu import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel @@ -9,8 +9,8 @@ import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel -class ScreenMatterReplicator(p_97741_: MenuMatterReplicator, p_97742_: Inventory, p_97743_: Component) : - MatteryScreen(p_97741_, p_97742_, p_97743_) { +class MatterReplicatorScreen(p_97741_: MatterReplicatorMenu, p_97742_: Inventory, p_97743_: Component) : + MatteryScreen(p_97741_, p_97742_, p_97743_) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterScanner.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterScannerScreen.kt similarity index 84% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterScanner.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterScannerScreen.kt index 96582c69e..82d3097a4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenMatterScanner.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/MatterScannerScreen.kt @@ -1,7 +1,7 @@ package ru.dbotthepony.mc.otm.client.screen import net.minecraft.network.chat.Component -import ru.dbotthepony.mc.otm.menu.MenuMatterScanner +import ru.dbotthepony.mc.otm.menu.MatterScannerMenu import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel @@ -9,8 +9,8 @@ import ru.dbotthepony.mc.otm.client.screen.widget.PatternGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel -class ScreenMatterScanner(p_97741_: MenuMatterScanner, p_97742_: Inventory, p_97743_: Component) : - MatteryScreen(p_97741_, p_97742_, p_97743_) { +class MatterScannerScreen(p_97741_: MatterScannerMenu, p_97742_: Inventory, p_97743_: Component) : + MatteryScreen(p_97741_, p_97742_, p_97743_) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenPatternStorage.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/PatternStorageScreen.kt similarity index 82% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenPatternStorage.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/PatternStorageScreen.kt index f6f6577ec..24de9ebb6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenPatternStorage.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/PatternStorageScreen.kt @@ -1,14 +1,14 @@ package ru.dbotthepony.mc.otm.client.screen import net.minecraft.network.chat.Component -import ru.dbotthepony.mc.otm.menu.MenuPatternStorage +import ru.dbotthepony.mc.otm.menu.PatternStorageMenu import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel import ru.dbotthepony.mc.otm.client.screen.widget.PatternGaugePanel -class ScreenPatternStorage(p_97741_: MenuPatternStorage, p_97742_: Inventory, p_97743_: Component) : - MatteryScreen(p_97741_, p_97742_, p_97743_) { +class PatternStorageScreen(p_97741_: PatternStorageMenu, p_97742_: Inventory, p_97743_: Component) : + MatteryScreen(p_97741_, p_97742_, p_97743_) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/PlatePressScreen.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenPlatePress.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/PlatePressScreen.kt index f4e3d072a..eaf3caada 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/PlatePressScreen.kt @@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.menu.MenuPlatePress -class ScreenPlatePress(menu: MenuPlatePress, inventory: Inventory, title: Component) : +class PlatePressScreen(menu: MenuPlatePress, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { override fun makeMainFrame(): FramePanel { val frame = super.makeMainFrame()!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemBattery.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/BatteryItem.kt similarity index 97% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemBattery.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/BatteryItem.kt index 960212ea7..7fff782dd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemBattery.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/BatteryItem.kt @@ -1,6 +1,5 @@ package ru.dbotthepony.mc.otm.item -import ru.dbotthepony.mc.otm.core.Fraction.Companion.deserializeNBT import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage import net.minecraftforge.common.capabilities.ICapabilityProvider import net.minecraft.world.item.ItemStack @@ -19,10 +18,9 @@ import net.minecraft.world.item.Rarity import net.minecraft.world.item.TooltipFlag import net.minecraft.world.level.Level import net.minecraftforge.common.capabilities.Capability -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction -class ItemBattery : Item { +class BatteryItem : Item { private inner class BatteryMatteryCapability(private val stack: ItemStack) : IMatteryEnergyStorage, ICapabilityProvider { private fun energy(): ImpreciseFraction { val tag = stack.orCreateTag diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemGravitationalDisruptor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/GravitationalDisruptorItem.kt similarity index 95% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemGravitationalDisruptor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/GravitationalDisruptorItem.kt index 1dffe90f0..8e2d644ec 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemGravitationalDisruptor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/GravitationalDisruptorItem.kt @@ -3,7 +3,6 @@ package ru.dbotthepony.mc.otm.item import ru.dbotthepony.mc.otm.OverdriveThatMatters import net.minecraft.world.item.ItemStack import net.minecraft.world.item.TooltipFlag -import ru.dbotthepony.mc.otm.item.ItemGravitationalDisruptor import net.minecraft.network.chat.TranslatableComponent import net.minecraft.ChatFormatting import net.minecraft.network.chat.Component @@ -11,7 +10,7 @@ import net.minecraft.world.item.Item import net.minecraft.world.item.Rarity import net.minecraft.world.level.Level -class ItemGravitationalDisruptor : +class GravitationalDisruptorItem : Item(Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(1).rarity(Rarity.EPIC)) { override fun appendHoverText( p_41421_: ItemStack, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemMatterCapacitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterCapacitorItem.kt similarity index 99% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemMatterCapacitor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterCapacitorItem.kt index a2c5dd90a..8d97406c6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemMatterCapacitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterCapacitorItem.kt @@ -24,7 +24,7 @@ import javax.annotation.ParametersAreNonnullByDefault @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -class ItemMatterCapacitor : Item { +class MatterCapacitorItem : Item { private inner class ItemMatterCapacitorCapability(private val stack: ItemStack) : ICapabilityProvider, IMatterHandler { private val resolver = LazyOptional.of { this } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemMatterDust.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterDustItem.kt similarity index 97% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemMatterDust.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterDustItem.kt index 426616f6e..b0038ce7e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemMatterDust.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatterDustItem.kt @@ -13,7 +13,7 @@ import ru.dbotthepony.mc.otm.matter.IMatterItem import ru.dbotthepony.mc.otm.matter.MatterTuple import ru.dbotthepony.mc.otm.set -class ItemMatterDust : Item(Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)), IMatterItem { +class MatterDustItem : Item(Properties().tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB).stacksTo(64)), IMatterItem { private fun matter(stack: ItemStack): ImpreciseFraction { return stack.tag?.get("matter")?.let { return@let ImpreciseFraction.deserializeNBT(it) } ?: return ImpreciseFraction.ZERO } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPatternStorage.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PatternStorageItem.kt similarity index 98% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPatternStorage.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/PatternStorageItem.kt index 1189bdef3..987ac14bf 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPatternStorage.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PatternStorageItem.kt @@ -19,7 +19,7 @@ import ru.dbotthepony.mc.otm.capability.matter.* import ru.dbotthepony.mc.otm.ifHas import java.util.* -class ItemPatternStorage : Item { +class PatternStorageItem : Item { val capacity: Int var isCreative: Boolean @@ -67,7 +67,7 @@ class ItemPatternStorage : Item { private val resolver = LazyOptional.of { this } override val capacity: Int get() { - return this@ItemPatternStorage.capacity + return this@PatternStorageItem.capacity } override val stored: Int get() { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPill.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PillItem.kt similarity index 98% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPill.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/PillItem.kt index c82881f2c..796352649 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPill.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PillItem.kt @@ -21,7 +21,7 @@ enum class PillType { BECOME_ANDROID, BECOME_HUMANE, OBLIVION } -class ItemPillHeal : Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) { +class HealPillItem : Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) { override fun getUseDuration(p_41454_: ItemStack): Int { return 24 } @@ -65,7 +65,7 @@ class ItemPillHeal : Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab( override fun getUseAnimation(p_41452_: ItemStack): UseAnim = UseAnim.EAT } -class ItemPill(val pillType: PillType) : +class PillItem(val pillType: PillType) : Item(Properties().stacksTo(64).rarity(Rarity.UNCOMMON).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) { override fun getUseDuration(p_41454_: ItemStack): Int { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPortableCondensationDrive.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PortableCondensationDriveItem.kt similarity index 97% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPortableCondensationDrive.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/PortableCondensationDriveItem.kt index ae3b3a31a..9b595dc18 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPortableCondensationDrive.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PortableCondensationDriveItem.kt @@ -24,12 +24,11 @@ import net.minecraftforge.event.ForgeEventFactory import net.minecraftforge.eventbus.api.SubscribeEvent import net.minecraftforge.event.entity.player.EntityItemPickupEvent import ru.dbotthepony.mc.otm.capability.drive.DrivePool -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.set import java.util.* -class ItemPortableCondensationDrive(capacity: Int) : +class PortableCondensationDriveItem(capacity: Int) : Item(Properties().stacksTo(1).tab(OverdriveThatMatters.INSTANCE.CREATIVE_TAB)) { val capacity: ImpreciseFraction @@ -216,7 +215,7 @@ class ItemPortableCondensationDrive(capacity: Int) : for (stack in event.player.inventory.items) { val drive = stack.item - if (drive is ItemPortableCondensationDrive) { + if (drive is PortableCondensationDriveItem) { var doBreak = false stack.getCapability(MatteryCapability.DRIVE).ifPresent { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPortableGravitationStabilizer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PortableGravitationStabilizerItem.kt similarity index 95% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPortableGravitationStabilizer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/PortableGravitationStabilizerItem.kt index 3f52673dd..3d9775798 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemPortableGravitationStabilizer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/PortableGravitationStabilizerItem.kt @@ -2,13 +2,11 @@ package ru.dbotthepony.mc.otm.item import net.minecraft.client.model.HumanoidModel import net.minecraft.sounds.SoundEvent -import net.minecraft.world.entity.Entity import net.minecraft.world.entity.EquipmentSlot import net.minecraft.world.entity.LivingEntity import net.minecraft.world.item.* import net.minecraft.world.item.crafting.Ingredient import net.minecraftforge.client.IItemRenderProperties -import net.minecraftforge.common.ForgeTier import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.client.model.GravitationStabilizerModel import java.util.function.Consumer diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemTritaniumArmor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/TritaniumArmorItem.kt similarity index 100% rename from src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemTritaniumArmor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/item/TritaniumArmorItem.kt diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/AndroidStationMenu.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuAndroidStation.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/AndroidStationMenu.kt index 7949586a6..92278826d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/AndroidStationMenu.kt @@ -4,7 +4,7 @@ import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.block.entity.BlockEntityAndroidStation +import ru.dbotthepony.mc.otm.block.entity.AndroidStationBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability import ru.dbotthepony.mc.otm.registry.MMenus @@ -32,8 +32,8 @@ private class AndroidBatterySlot(container: AndroidStationContainer, index: Int) class AndroidStationMenu @JvmOverloads constructor( containerID: Int, inventory: Inventory, - tile: BlockEntityAndroidStation? = null -) : MenuMatteryPowered(MMenus.ANDROID_STATION, containerID, inventory, tile) { + tile: AndroidStationBlockEntity? = null +) : MatteryPoweredMenu(MMenus.ANDROID_STATION, containerID, inventory, tile) { val androidBattery: MatterySlot = AndroidBatterySlot(AndroidStationContainer(inventory.player), 0) init { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuBatteryBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/BatteryBankMenu.kt similarity index 77% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuBatteryBank.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/BatteryBankMenu.kt index 634ce0a2b..dee60ea8e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuBatteryBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/BatteryBankMenu.kt @@ -3,25 +3,25 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.Container import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityBatteryBank +import ru.dbotthepony.mc.otm.block.entity.BatteryBankBlockEntity import net.minecraft.world.SimpleContainer import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.orNull import ru.dbotthepony.mc.otm.registry.MMenus -class MenuBatteryBank @JvmOverloads constructor( +class BatteryBankMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityBatteryBank? = null, + tile: BatteryBankBlockEntity? = null, ) : MatteryMenu(MMenus.BATTERY_BANK, p_38852_, inventory, tile) { val powerLevel: LevelGaugeWidget val containerSlots: Array init { - val container: Container = tile?.container ?: SimpleContainer(BlockEntityBatteryBank.CAPACITY) + val container: Container = tile?.container ?: SimpleContainer(BatteryBankBlockEntity.CAPACITY) powerLevel = LevelGaugeWidget(this, tile?.getCapability(MatteryCapability.ENERGY)?.orNull()) - containerSlots = Array(BlockEntityBatteryBank.CAPACITY) { + containerSlots = Array(BatteryBankBlockEntity.CAPACITY) { val slot = BatterySlot(container, it) addSlot(slot) return@Array slot @@ -35,6 +35,6 @@ class MenuBatteryBank @JvmOverloads constructor( } override fun getWorkingSlotEnd(): Int { - return BlockEntityBatteryBank.CAPACITY + return BatteryBankBlockEntity.CAPACITY } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuCargoCrate.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/CargoCrateMenu.kt similarity index 64% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuCargoCrate.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/CargoCrateMenu.kt index 1584f70f7..4a951716c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuCargoCrate.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/CargoCrateMenu.kt @@ -3,20 +3,20 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player -import ru.dbotthepony.mc.otm.block.entity.BlockEntityCargoCrate +import ru.dbotthepony.mc.otm.block.entity.CargoCrateBlockEntity import ru.dbotthepony.mc.otm.registry.MMenus -class MenuCargoCrate @JvmOverloads constructor( +class CargoCrateMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityCargoCrate? = null + tile: CargoCrateBlockEntity? = null ) : MatteryMenu(MMenus.CARGO_CRATE, p_38852_, inventory, tile) { val crateSlots: Array init { - val container = tile?.container ?: SimpleContainer(BlockEntityCargoCrate.CAPACITY) + val container = tile?.container ?: SimpleContainer(CargoCrateBlockEntity.CAPACITY) - crateSlots = Array(BlockEntityCargoCrate.CAPACITY) { + crateSlots = Array(CargoCrateBlockEntity.CAPACITY) { val slot = MatterySlot(container, it) addSlot(slot) return@Array slot @@ -28,7 +28,7 @@ class MenuCargoCrate @JvmOverloads constructor( override fun removed(p_38940_: Player) { super.removed(p_38940_) - (tile as? BlockEntityCargoCrate)?.onPlayerClose() + (tile as? CargoCrateBlockEntity)?.onPlayerClose() } override fun getWorkingSlotStart(): Int { @@ -36,6 +36,6 @@ class MenuCargoCrate @JvmOverloads constructor( } override fun getWorkingSlotEnd(): Int { - return BlockEntityCargoCrate.CAPACITY + return CargoCrateBlockEntity.CAPACITY } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ChemicalGeneratorMenu.kt similarity index 73% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuChemicalGenerator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/ChemicalGeneratorMenu.kt index 661bef5bc..5002dfb09 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ChemicalGeneratorMenu.kt @@ -5,30 +5,30 @@ import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack import net.minecraftforge.common.ForgeHooks import net.minecraftforge.energy.CapabilityEnergy -import ru.dbotthepony.mc.otm.block.entity.BlockEntityChemicalGenerator +import ru.dbotthepony.mc.otm.block.entity.ChemicalGeneratorBlockEntity import ru.dbotthepony.mc.otm.menu.data.IntDataContainer import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.registry.MMenus -class MenuChemicalGenerator @JvmOverloads constructor(id: Int, inv: Inventory, tile: BlockEntityChemicalGenerator? = null) +class ChemicalGeneratorMenu @JvmOverloads constructor(id: Int, inv: Inventory, tile: ChemicalGeneratorBlockEntity? = null) : MatteryMenu(MMenus.CHEMICAL_GENERATOR, id, inv, tile) { val container = tile?.container ?: SimpleContainer(3) - val fuelSlot = object : MatterySlot(container, BlockEntityChemicalGenerator.SLOT_INPUT) { + val fuelSlot = object : MatterySlot(container, ChemicalGeneratorBlockEntity.SLOT_INPUT) { override fun mayPlace(p_40231_: ItemStack): Boolean { return ForgeHooks.getBurnTime(p_40231_, null) > 0 } } - val residueSlot = object : MatterySlot(container, BlockEntityChemicalGenerator.SLOT_RESIDUE) { + val residueSlot = object : MatterySlot(container, ChemicalGeneratorBlockEntity.SLOT_RESIDUE) { override fun mayPlace(p_40231_: ItemStack): Boolean { return false } } - val batterySlot = object : MatterySlot(container, BlockEntityChemicalGenerator.SLOT_BATTERY) { + val batterySlot = object : MatterySlot(container, ChemicalGeneratorBlockEntity.SLOT_BATTERY) { override fun mayPlace(p_40231_: ItemStack): Boolean { return p_40231_.getCapability(CapabilityEnergy.ENERGY).isPresent } @@ -49,7 +49,7 @@ class MenuChemicalGenerator @JvmOverloads constructor(id: Int, inv: Inventory, t override fun broadcastChanges() { super.broadcastChanges() progress.updateServer() - burnTime.value = (tile as BlockEntityChemicalGenerator).workingTicks + burnTime.value = (tile as ChemicalGeneratorBlockEntity).workingTicks } override fun getWorkingSlotStart(): Int { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveRack.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveRackMenu.kt similarity index 73% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveRack.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveRackMenu.kt index b435ae1ef..1fe552b3c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveRack.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveRackMenu.kt @@ -2,14 +2,14 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack +import ru.dbotthepony.mc.otm.block.entity.DriveRackBlockEntity import ru.dbotthepony.mc.otm.registry.MMenus -class MenuDriveRack @JvmOverloads constructor( +class DriveRackMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityDriveRack? = null -) : MenuMatteryPowered(MMenus.DRIVE_RACK, p_38852_, inventory, tile) { + tile: DriveRackBlockEntity? = null +) : MatteryPoweredMenu(MMenus.DRIVE_RACK, p_38852_, inventory, tile) { val drives = arrayOfNulls(4) init { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveViewer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveViewerMenu.kt similarity index 90% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveViewer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveViewerMenu.kt index 2586f5721..5d2dfea7f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveViewer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveViewerMenu.kt @@ -7,11 +7,11 @@ import net.minecraft.world.entity.player.Player import net.minecraft.world.item.ItemStack import net.minecraftforge.energy.CapabilityEnergy import net.minecraftforge.network.NetworkEvent -import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveViewer +import ru.dbotthepony.mc.otm.block.entity.DriveViewerBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive -import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive -import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive.FilterSettings +import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem +import ru.dbotthepony.mc.otm.item.PortableCondensationDriveItem.FilterSettings import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView import ru.dbotthepony.mc.otm.registry.MMenus @@ -19,11 +19,11 @@ import ru.dbotthepony.mc.otm.storage.ItemStackWrapper import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent import java.util.function.Supplier -class MenuDriveViewer @JvmOverloads constructor( +class DriveViewerMenu @JvmOverloads constructor( containerID: Int, inventory: Inventory, - tile: BlockEntityDriveViewer? = null -) : MenuMatteryPowered( + tile: DriveViewerBlockEntity? = null +) : MatteryPoweredMenu( MMenus.DRIVE_VIEWER, containerID, inventory, tile ), INetworkedItemViewSupplier { @JvmField val view: NetworkedItemView @@ -63,7 +63,7 @@ class MenuDriveViewer @JvmOverloads constructor( super.broadcastChanges() if (tile != null) { - val itemStack = (tile as BlockEntityDriveViewer).container.getItem(0) + val itemStack = (tile as DriveViewerBlockEntity).container.getItem(0) val prev = lastDrive lastDrive = null @@ -144,7 +144,7 @@ class MenuDriveViewer @JvmOverloads constructor( return null val item = driveSlot.item.item - return if (item is ItemPortableCondensationDrive) item.getFilterSettings(driveSlot.item) else null + return if (item is PortableCondensationDriveItem) item.getFilterSettings(driveSlot.item) else null } class FilterSetPacket(val id: Int, val slot: Int, val value: ItemStack) { @@ -167,14 +167,14 @@ class MenuDriveViewer @JvmOverloads constructor( val ply = context.get().sender!! val menu = ply.containerMenu - if (menu is MenuDriveViewer && menu.containerId == id) { + if (menu is DriveViewerMenu && menu.containerId == id) { if (menu.driveSlot.item.isEmpty) return@enqueueWork val itemStack = menu.driveSlot.item val item = itemStack.item - if (item is ItemPortableCondensationDrive) { + if (item is PortableCondensationDriveItem) { val filter = item.getFilterSettings(itemStack) filter.items[slot] = value filter.serializeNBT(itemStack) @@ -204,7 +204,7 @@ class MenuDriveViewer @JvmOverloads constructor( val ply = context.get().sender!! val menu = ply.containerMenu - if (menu is MenuDriveViewer && menu.containerId == id) { + if (menu is DriveViewerMenu && menu.containerId == id) { val settings = menu.getFilter() ?: return@enqueueWork when (type) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/EnergyCounterMenu.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuEnergyCounter.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/EnergyCounterMenu.kt index 9305b35ac..41d2f3050 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/EnergyCounterMenu.kt @@ -4,7 +4,7 @@ import net.minecraft.core.Direction import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory import net.minecraft.world.level.block.Block -import ru.dbotthepony.mc.otm.block.BlockEnergyCounter +import ru.dbotthepony.mc.otm.block.EnergyCounterBlock import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.menu.data.EnumDataContainer @@ -14,7 +14,7 @@ import ru.dbotthepony.mc.otm.menu.widget.OneWayPlayerInputWidget import ru.dbotthepony.mc.otm.registry.MMenus import java.math.BigDecimal -class MenuEnergyCounter @JvmOverloads constructor( +class EnergyCounterMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityEnergyCounter? = null @@ -38,7 +38,7 @@ class MenuEnergyCounter @JvmOverloads constructor( maxIO.asClient() } else { switchDirection = OneWayPlayerInputWidget(this) { - tile.level?.setBlock(tile.blockPos, tile.blockState.setValue(BlockEnergyCounter.INPUT_DIRECTION, tile.blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION).opposite), Block.UPDATE_ALL) + tile.level?.setBlock(tile.blockPos, tile.blockState.setValue(EnergyCounterBlock.INPUT_DIRECTION, tile.blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION).opposite), Block.UPDATE_ALL) } maxIO.withSupplier { @@ -70,7 +70,7 @@ class MenuEnergyCounter @JvmOverloads constructor( } ticksPassed = (ticksPassed + 1) % 20 - inputDirection.value = tile.blockState.getValue(BlockEnergyCounter.INPUT_DIRECTION) + inputDirection.value = tile.blockState.getValue(EnergyCounterBlock.INPUT_DIRECTION) } super.broadcastChanges() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuItemMonitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ItemMonitorMenu.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuItemMonitor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/ItemMonitorMenu.kt index 0efb943a0..0614b41bf 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuItemMonitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ItemMonitorMenu.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor +import ru.dbotthepony.mc.otm.block.entity.ItemMonitorBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView @@ -12,11 +12,11 @@ import ru.dbotthepony.mc.otm.storage.ItemStackWrapper import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent import ru.dbotthepony.mc.otm.storage.VirtualComponent -class MenuItemMonitor @JvmOverloads constructor( +class ItemMonitorMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityItemMonitor? = null -) : MenuMatteryPowered(MMenus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier { + tile: ItemMonitorBlockEntity? = null +) : MatteryPoweredMenu(MMenus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier { @JvmField val view = NetworkedItemView(inventory.player, this, tile == null) private val subscribed: VirtualComponent? diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterBottler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterBottlerMenu.kt similarity index 85% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterBottler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterBottlerMenu.kt index 31f0e8b08..63f565304 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterBottler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterBottlerMenu.kt @@ -3,20 +3,19 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterBottler +import ru.dbotthepony.mc.otm.block.entity.MatterBottlerBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability -import ru.dbotthepony.mc.otm.capability.matter.MatterDirection import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.orNull import ru.dbotthepony.mc.otm.registry.MMenus -class MenuMatterBottler @JvmOverloads constructor( +class MatterBottlerMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityMatterBottler? = null -) : MenuMatteryPowered( + tile: MatterBottlerBlockEntity? = null +) : MatteryPoweredMenu( MMenus.MATTER_BOTTLER, p_38852_, inventory, tile ) { val workFlow: BooleanPlayerInputWidget @@ -58,7 +57,7 @@ class MenuMatterBottler @JvmOverloads constructor( override fun broadcastChanges() { super.broadcastChanges() - workFlow.value = (tile as BlockEntityMatterBottler).workFlow + workFlow.value = (tile as MatterBottlerBlockEntity).workFlow } override fun getWorkingSlotStart(): Int { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterCapacitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterCapacitorMenu.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterCapacitor.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterCapacitorMenu.kt index 226499592..14aa21d98 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterCapacitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterCapacitorMenu.kt @@ -2,16 +2,16 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterCapacitorBank +import ru.dbotthepony.mc.otm.block.entity.MatterCapacitorBankBlockEntity import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.registry.MMenus -class MenuMatterCapacitor @JvmOverloads constructor( +class MatterCapacitorMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityMatterCapacitorBank? = null + tile: MatterCapacitorBankBlockEntity? = null ) : MatteryMenu( MMenus.MATTER_CAPACITOR_BANK, p_38852_, inventory, tile ) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterDecomposer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterDecomposerMenu.kt similarity index 86% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterDecomposer.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterDecomposerMenu.kt index 6e5e6ef38..3736f60d7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterDecomposer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterDecomposerMenu.kt @@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.menu import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterDecomposer +import ru.dbotthepony.mc.otm.block.entity.MatterDecomposerBlockEntity import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import net.minecraft.world.SimpleContainer @@ -12,11 +12,11 @@ import ru.dbotthepony.mc.otm.matter.canDecompose import ru.dbotthepony.mc.otm.orNull import ru.dbotthepony.mc.otm.registry.MMenus -class MenuMatterDecomposer @JvmOverloads constructor( +class MatterDecomposerMenu @JvmOverloads constructor( containerID: Int, inventory: Inventory, - tile: BlockEntityMatterDecomposer? = null -) : MenuMatteryPowered(MMenus.MATTER_DECOMPOSER, containerID, inventory, tile) { + tile: MatterDecomposerBlockEntity? = null +) : MatteryPoweredMenu(MMenus.MATTER_DECOMPOSER, containerID, inventory, tile) { val input: MatterySlot val outputMain: MachineOutputSlot val outputStacking: MachineOutputSlot diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterPanelMenu.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterPanel.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterPanelMenu.kt index 773eb4822..16a5ee1be 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterPanelMenu.kt @@ -5,7 +5,7 @@ import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraftforge.network.PacketDistributor import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterPanel +import ru.dbotthepony.mc.otm.block.entity.MatterPanelBlockEntity import ru.dbotthepony.mc.otm.capability.matter.MatterTask import ru.dbotthepony.mc.otm.capability.matter.PatternState import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphListener @@ -18,10 +18,10 @@ import ru.dbotthepony.mc.otm.registry.MMenus import java.util.* import java.util.function.Consumer -class MenuMatterPanel @JvmOverloads constructor( +class MatterPanelMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityMatterPanel? = null + tile: MatterPanelBlockEntity? = null ) : MatteryMenu(MMenus.MATTER_PANEL, p_38852_, inventory, tile), IMatterGraphListener { fun taskUpdated(task: MatterTask) { sendNetwork(MatterTaskPacket(true, listOf(task))) @@ -97,7 +97,7 @@ class MenuMatterPanel @JvmOverloads constructor( // server code fun requestReplication(ply: ServerPlayer, state: PatternState, how_much: Int) { - val tile = tile as BlockEntityMatterPanel? ?: return + val tile = tile as MatterPanelBlockEntity? ?: return val graph = tile.getAsMatterNode().graph as MatterNetworkGraph? ?: return @@ -110,7 +110,7 @@ class MenuMatterPanel @JvmOverloads constructor( } fun receiveTaskCancel(ply: ServerPlayer, id: UUID) { - (tile as BlockEntityMatterPanel?)?.removeTask(id) + (tile as MatterPanelBlockEntity?)?.removeTask(id) } fun requestTaskCancel(id: UUID) { @@ -143,7 +143,7 @@ class MenuMatterPanel @JvmOverloads constructor( override fun removed(p_38940_: Player) { super.removed(p_38940_) - (tile as BlockEntityMatterPanel?)?.deatachMenu(this) + (tile as MatterPanelBlockEntity?)?.deatachMenu(this) listeningGrid?.removeListener(this) } @@ -162,7 +162,7 @@ class MenuMatterPanel @JvmOverloads constructor( return } - val tile = tile as BlockEntityMatterPanel? + val tile = tile as MatterPanelBlockEntity? if (tile != null) { val grid = tile.getAsMatterNode().graph as MatterNetworkGraph? diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterRecycler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterRecyclerMenu.kt similarity index 72% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterRecycler.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterRecyclerMenu.kt index 6949cffbb..49694664a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterRecycler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterRecyclerMenu.kt @@ -3,17 +3,17 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterRecycler -import ru.dbotthepony.mc.otm.item.ItemMatterDust +import ru.dbotthepony.mc.otm.block.entity.MatterRecyclerBlockEntity +import ru.dbotthepony.mc.otm.item.MatterDustItem import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.registry.MMenus -class MenuMatterRecycler @JvmOverloads constructor( +class MatterRecyclerMenu @JvmOverloads constructor( containerID: Int, inventory: Inventory, - tile: BlockEntityMatterRecycler? = null -) : MenuMatteryPowered(MMenus.MATTER_RECYCLER, containerID, inventory, tile) { + tile: MatterRecyclerBlockEntity? = null +) : MatteryPoweredMenu(MMenus.MATTER_RECYCLER, containerID, inventory, tile) { val input: MatterySlot val progress: ProgressGaugeWidget val matter = LevelGaugeWidget(this, tile?.matter) @@ -23,7 +23,7 @@ class MenuMatterRecycler @JvmOverloads constructor( input = object : MatterySlot(container, 0) { override fun mayPlace(p_40231_: ItemStack): Boolean { - return p_40231_.item is ItemMatterDust && (p_40231_.item as ItemMatterDust).getMatterValue(p_40231_) != null + return p_40231_.item is MatterDustItem && (p_40231_.item as MatterDustItem).getMatterValue(p_40231_) != null } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterReplicator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterReplicatorMenu.kt similarity index 85% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterReplicator.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterReplicatorMenu.kt index 9250fcfa2..982b6bbe7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterReplicator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterReplicatorMenu.kt @@ -2,17 +2,17 @@ package ru.dbotthepony.mc.otm.menu import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterReplicator +import ru.dbotthepony.mc.otm.block.entity.MatterReplicatorBlockEntity import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import net.minecraft.world.SimpleContainer import ru.dbotthepony.mc.otm.registry.MMenus -class MenuMatterReplicator @JvmOverloads constructor( +class MatterReplicatorMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityMatterReplicator? = null -) : MenuMatteryPowered( + tile: MatterReplicatorBlockEntity? = null +) : MatteryPoweredMenu( MMenus.MATTER_REPLICATOR, p_38852_, inventory, tile ) { val matter: LevelGaugeWidget diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterScanner.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterScannerMenu.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterScanner.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterScannerMenu.kt index 059fe8d76..f783e82d3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterScanner.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterScannerMenu.kt @@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.menu import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterScanner +import ru.dbotthepony.mc.otm.block.entity.MatterScannerBlockEntity import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import net.minecraft.world.SimpleContainer @@ -12,11 +12,11 @@ import ru.dbotthepony.mc.otm.matter.canDecompose import ru.dbotthepony.mc.otm.registry.MMenus import java.math.BigInteger -class MenuMatterScanner @JvmOverloads constructor( +class MatterScannerMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, - tile: BlockEntityMatterScanner? = null -) : MenuMatteryPowered( + tile: MatterScannerBlockEntity? = null +) : MatteryPoweredMenu( MMenus.MATTER_SCANNER, p_38852_, inventory, tile ) { val input: MatterySlot diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMattery.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryMenu.kt similarity index 99% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMattery.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryMenu.kt index cfbe79566..e8c7989de 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMattery.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryMenu.kt @@ -10,7 +10,6 @@ import net.minecraftforge.network.PacketDistributor import ru.dbotthepony.mc.otm.menu.data.MultiByteDataContainer import ru.dbotthepony.mc.otm.menu.widget.AbstractWidget import ru.dbotthepony.mc.otm.network.MatteryNetworking -import java.util.function.Consumer @JvmRecord data class MoveResult(val mergeOccurred: Boolean, val remaining: ItemStack, val changed_slots: Set) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatteryPowered.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt similarity index 76% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatteryPowered.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt index fbb336e59..19d73d7e9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatteryPowered.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt @@ -2,16 +2,15 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.inventory.MenuType import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatteryPowered +import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget -import ru.dbotthepony.mc.otm.capability.MatteryCapability import net.minecraft.world.SimpleContainer -abstract class MenuMatteryPowered protected constructor( +abstract class MatteryPoweredMenu protected constructor( menuType: MenuType<*>, containerID: Int, inventory: Inventory, - tile: BlockEntityMatteryPowered? = null + tile: MatteryPoweredBlockEntity? = null ) : MatteryMenu(menuType, containerID, inventory, tile) { @JvmField val powerWidget: LevelGaugeWidget @JvmField val batterySlot: BatterySlot diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt index 41945c808..de79b0eaa 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt @@ -2,19 +2,19 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress +import ru.dbotthepony.mc.otm.block.entity.PlatePressBlockEntity import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.registry.MMenus class MenuPlatePress @JvmOverloads constructor( containerID: Int, inventory: Inventory, - tile: BlockEntityPlatePress? = null -) : MenuMatteryPowered(MMenus.PLATE_PRESS, containerID, inventory, tile) { + tile: PlatePressBlockEntity? = null +) : MatteryPoweredMenu(MMenus.PLATE_PRESS, containerID, inventory, tile) { val container = tile?.container ?: SimpleContainer(2) - val inputSlot = MatterySlot(container, BlockEntityPlatePress.SLOT_INPUT) - val outputSlot = MachineOutputSlot(container, BlockEntityPlatePress.SLOT_OUTPUT) + val inputSlot = MatterySlot(container, PlatePressBlockEntity.SLOT_INPUT) + val outputSlot = MachineOutputSlot(container, PlatePressBlockEntity.SLOT_OUTPUT) val progressGauge = if (tile != null) ProgressGaugeWidget(this, tile::workProgress, tile::isUnableToProcess) else ProgressGaugeWidget(this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPatternStorage.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/PatternStorageMenu.kt similarity index 89% rename from src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPatternStorage.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/menu/PatternStorageMenu.kt index 1b551a686..ec3c79164 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPatternStorage.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/PatternStorageMenu.kt @@ -2,16 +2,16 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.BlockEntityPatternStorage +import ru.dbotthepony.mc.otm.block.entity.PatternStorageBlockEntity import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.registry.MMenus -class MenuPatternStorage @JvmOverloads constructor( +class PatternStorageMenu @JvmOverloads constructor( p_38852_: Int, inventory: Inventory?, - tile: BlockEntityPatternStorage? = null + tile: PatternStorageBlockEntity? = null ) : MatteryMenu( MMenus.PATTERN_STORAGE, p_38852_, inventory!!, tile ) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt index 483df7f67..3c69f9fcc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt @@ -15,7 +15,7 @@ import net.minecraft.world.level.Level import net.minecraftforge.registries.ForgeRegistryEntry import org.apache.logging.log4j.LogManager import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress +import ru.dbotthepony.mc.otm.block.entity.PlatePressBlockEntity import ru.dbotthepony.mc.otm.get import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.registry.MRecipes @@ -31,7 +31,7 @@ class PlatePressRecipe( if (output.isEmpty || input.isEmpty) return false - return input.test(container[BlockEntityPlatePress.SLOT_INPUT]) + return input.test(container[PlatePressBlockEntity.SLOT_INPUT]) } private var outputStack: ItemStack? = null