Rename classes to match namings in other places

This commit is contained in:
DBotThePony 2022-01-14 18:54:26 +07:00
parent 68401b01c8
commit 04a2889311
Signed by: DBot
GPG Key ID: DCC23B5715498507
49 changed files with 148 additions and 153 deletions

View File

@ -1044,19 +1044,19 @@ public class Registry {
public static final MenuType<AndroidStationMenu> ANDROID_STATION = new MenuType<>(AndroidStationMenu::new); public static final MenuType<AndroidStationMenu> ANDROID_STATION = new MenuType<>(AndroidStationMenu::new);
public static final MenuType<BatteryBankMenu> BATTERY_BANK = new MenuType<>(BatteryBankMenu::new); public static final MenuType<BatteryBankMenu> BATTERY_BANK = new MenuType<>(BatteryBankMenu::new);
public static final MenuType<MatterDecomposerMenu> MATTER_DECOMPOSER = new MenuType<>(MatterDecomposerMenu::new); public static final MenuType<MatterDecomposerMenu> MATTER_DECOMPOSER = new MenuType<>(MatterDecomposerMenu::new);
public static final MenuType<MatterCapacitorBankMenu> MATTER_CAPACITOR_BANK = new MenuType<>(MatterCapacitorBankMenu::new); public static final MenuType<MenuMatterCapacitor> MATTER_CAPACITOR_BANK = new MenuType<>(MenuMatterCapacitor::new);
public static final MenuType<PatternStorageMenu> PATTERN_STORAGE = new MenuType<>(PatternStorageMenu::new); public static final MenuType<MenuPatternStorage> PATTERN_STORAGE = new MenuType<>(MenuPatternStorage::new);
public static final MenuType<MatterScannerMenu> MATTER_SCANNER = new MenuType<>(MatterScannerMenu::new); public static final MenuType<MenuMatterScanner> MATTER_SCANNER = new MenuType<>(MenuMatterScanner::new);
public static final MenuType<MatterPanelMenu> MATTER_PANEL = new MenuType<>(MatterPanelMenu::new); public static final MenuType<MenuMatterPanel> MATTER_PANEL = new MenuType<>(MenuMatterPanel::new);
public static final MenuType<MatterReplicatorMenu> MATTER_REPLICATOR = new MenuType<>(MatterReplicatorMenu::new); public static final MenuType<MatterReplicatorMenu> MATTER_REPLICATOR = new MenuType<>(MatterReplicatorMenu::new);
public static final MenuType<MatterBottlerMenu> MATTER_BOTTLER = new MenuType<>(MatterBottlerMenu::new); public static final MenuType<MenuMatterBottler> MATTER_BOTTLER = new MenuType<>(MenuMatterBottler::new);
public static final MenuType<DriveViewerMenu> DRIVE_VIEWER = new MenuType<>(DriveViewerMenu::new); public static final MenuType<MenuDriveViewer> DRIVE_VIEWER = new MenuType<>(MenuDriveViewer::new);
public static final MenuType<CargoCrateMenu> CARGO_CRATE = new MenuType<>(CargoCrateMenu::new); public static final MenuType<CargoCrateMenu> CARGO_CRATE = new MenuType<>(CargoCrateMenu::new);
public static final MenuType<DriveRackMenu> DRIVE_RACK = new MenuType<>(DriveRackMenu::new); public static final MenuType<MenuDriveRack> DRIVE_RACK = new MenuType<>(MenuDriveRack::new);
public static final MenuType<ItemMonitorMenu> ITEM_MONITOR = new MenuType<>(ItemMonitorMenu::new); public static final MenuType<MenuItemMonitor> ITEM_MONITOR = new MenuType<>(MenuItemMonitor::new);
public static final MenuType<EnergyCounterMenu> ENERGY_COUNTER = new MenuType<>(EnergyCounterMenu::new); public static final MenuType<MenuEnergyCounter> ENERGY_COUNTER = new MenuType<>(MenuEnergyCounter::new);
public static final MenuType<ChemicalGeneratorMenu> CHEMICAL_GENERATOR = new MenuType<>(ChemicalGeneratorMenu::new); public static final MenuType<MenuCHemicalGenerator> CHEMICAL_GENERATOR = new MenuType<>(MenuCHemicalGenerator::new);
public static final MenuType<PlatePressMenu> PLATE_PRESS = new MenuType<>(PlatePressMenu::new); public static final MenuType<MenuPlatePress> PLATE_PRESS = new MenuType<>(MenuPlatePress::new);
static { static {
ANDROID_STATION.setRegistryName(Names.ANDROID_STATION); ANDROID_STATION.setRegistryName(Names.ANDROID_STATION);
@ -1103,21 +1103,21 @@ public class Registry {
@SubscribeEvent @SubscribeEvent
@SuppressWarnings("unused") @SuppressWarnings("unused")
public static void registerScreens(final FMLClientSetupEvent event) { public static void registerScreens(final FMLClientSetupEvent event) {
MenuScreens.register(ANDROID_STATION, AndroidStationScreen::new); MenuScreens.register(ANDROID_STATION, ScreenAndroidStation::new);
MenuScreens.register(BATTERY_BANK, BatteryBankScreen::new); MenuScreens.register(BATTERY_BANK, ScreenBatteryBank::new);
MenuScreens.register(MATTER_DECOMPOSER, MatterDecomposerScreen::new); MenuScreens.register(MATTER_DECOMPOSER, ScreenMatterDecomposer::new);
MenuScreens.register(MATTER_CAPACITOR_BANK, MatterCapacitorBankScreen::new); MenuScreens.register(MATTER_CAPACITOR_BANK, ScreenMatterCapacitorBank::new);
MenuScreens.register(PATTERN_STORAGE, PatternStorageScreen::new); MenuScreens.register(PATTERN_STORAGE, PatternStorageScreen::new);
MenuScreens.register(MATTER_SCANNER, MatterScannerScreen::new); MenuScreens.register(MATTER_SCANNER, MatterScannerScreen::new);
MenuScreens.register(MATTER_PANEL, MatterPanelScreen::new); MenuScreens.register(MATTER_PANEL, MatterPanelScreen::new);
MenuScreens.register(MATTER_REPLICATOR, MatterReplicatorScreen::new); MenuScreens.register(MATTER_REPLICATOR, ScreenMatterReplicator::new);
MenuScreens.register(MATTER_BOTTLER, MatterBottlerScreen::new); MenuScreens.register(MATTER_BOTTLER, ScreenMatterBottler::new);
MenuScreens.register(DRIVE_VIEWER, DriveViewerScreen::new); MenuScreens.register(DRIVE_VIEWER, ScreenDriveViewer::new);
MenuScreens.register(CARGO_CRATE, CargoCrateScreen::new); MenuScreens.register(CARGO_CRATE, CargoCrateScreen::new);
MenuScreens.register(DRIVE_RACK, DriveRackScreen::new); MenuScreens.register(DRIVE_RACK, ScreenDriveRack::new);
MenuScreens.register(ITEM_MONITOR, ItemMonitorScreen::new); MenuScreens.register(ITEM_MONITOR, ScreenItemMonitor::new);
MenuScreens.register(ENERGY_COUNTER, EnergyCounterScreen::new); MenuScreens.register(ENERGY_COUNTER, ScreenEnergyCounter::new);
MenuScreens.register(CHEMICAL_GENERATOR, ChemicalGeneratorScreen::new); MenuScreens.register(CHEMICAL_GENERATOR, ScreenChemicalGenerator::new);
MenuScreens.register(PLATE_PRESS, PlatePressScreen::new); MenuScreens.register(PLATE_PRESS, PlatePressScreen::new);
// OverdriveThatMatters.LOGGER.info("Registered screens"); // OverdriveThatMatters.LOGGER.info("Registered screens");

View File

@ -11,7 +11,7 @@ import net.minecraft.world.item.ItemStack;
import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.capability.matter.MatterTask; import ru.dbotthepony.mc.otm.capability.matter.MatterTask;
import ru.dbotthepony.mc.otm.capability.matter.PatternState; import ru.dbotthepony.mc.otm.capability.matter.PatternState;
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
import ru.dbotthepony.mc.otm.network.MatteryNetworking; import ru.dbotthepony.mc.otm.network.MatteryNetworking;
import ru.dbotthepony.mc.otm.network.PatternReplicationRequestPacket; import ru.dbotthepony.mc.otm.network.PatternReplicationRequestPacket;
import ru.dbotthepony.mc.otm.client.screen.panels.*; import ru.dbotthepony.mc.otm.client.screen.panels.*;
@ -21,7 +21,7 @@ import javax.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class MatterPanelScreen extends MatteryScreen<MatterPanelMenu> { public class MatterPanelScreen extends MatteryScreen<MenuMatterPanel> {
private static final int MODAL_WIDTH = 213; private static final int MODAL_WIDTH = 213;
private static final int MODAL_HEIGHT = 110; private static final int MODAL_HEIGHT = 110;
@ -31,7 +31,7 @@ public class MatterPanelScreen extends MatteryScreen<MatterPanelMenu> {
return CONTAINER; return CONTAINER;
} }
public MatterPanelScreen(MatterPanelMenu p_97741_, Inventory p_97742_, Component p_97743_) { public MatterPanelScreen(MenuMatterPanel p_97741_, Inventory p_97742_, Component p_97743_) {
super(p_97741_, p_97742_, p_97743_); super(p_97741_, p_97742_, p_97743_);
imageWidth = 176; imageWidth = 176;

View File

@ -13,7 +13,7 @@ import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public class MatterDecomposerMenu extends PoweredMatteryMenu { public class MatterDecomposerMenu extends MenuMatteryPowered {
public MatterDecomposerMenu(int containerID, Inventory inventory) { public MatterDecomposerMenu(int containerID, Inventory inventory) {
this(containerID, inventory, null); this(containerID, inventory, null);
} }

View File

@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterReplicator;
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget; import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget;
import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget; import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget;
public class MatterReplicatorMenu extends PoweredMatteryMenu { public class MatterReplicatorMenu extends MenuMatteryPowered {
public MatterReplicatorMenu(int p_38852_, Inventory inventory) { public MatterReplicatorMenu(int p_38852_, Inventory inventory) {
this(p_38852_, inventory, null); this(p_38852_, inventory, null);
} }

View File

@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
import ru.dbotthepony.mc.otm.capability.matter.MatterTask; import ru.dbotthepony.mc.otm.capability.matter.MatterTask;
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
import java.util.UUID; import java.util.UUID;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -28,7 +28,7 @@ public record CancelMatterTaskPacket(UUID id) {
context.get().enqueueWork(() -> { context.get().enqueueWork(() -> {
var player = context.get().getSender(); var player = context.get().getSender();
if (player.containerMenu instanceof MatterPanelMenu menu) { if (player.containerMenu instanceof MenuMatterPanel menu) {
menu.receiveTaskCancel(player, id); menu.receiveTaskCancel(player, id);
} }
}); });

View File

@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
import ru.dbotthepony.mc.otm.menu.MatterBottlerMenu; import ru.dbotthepony.mc.otm.menu.MenuMatterBottler;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -17,7 +17,7 @@ public record MatterBottlerSwitchPacket() {
} }
public void playServer(ServerPlayer ply) { public void playServer(ServerPlayer ply) {
if (ply.containerMenu instanceof MatterBottlerMenu menu) { if (ply.containerMenu instanceof MenuMatterBottler menu) {
menu.switchBottlerMode(); menu.switchBottlerMode();
} }
} }

View File

@ -7,7 +7,7 @@ import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.capability.matter.MatterTask; import ru.dbotthepony.mc.otm.capability.matter.MatterTask;
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
import java.util.ArrayList; import java.util.ArrayList;
@ -31,7 +31,7 @@ public record MatterTaskPacket(boolean action, Collection<MatterTask> state) {
} }
private void playClient() { private void playClient() {
if (Minecraft.getInstance().player.containerMenu instanceof MatterPanelMenu menu) { if (Minecraft.getInstance().player.containerMenu instanceof MenuMatterPanel menu) {
if (action) if (action)
menu.networkTasksUpdated(state); menu.networkTasksUpdated(state);
else else

View File

@ -7,7 +7,7 @@ import net.minecraftforge.network.NetworkRegistry;
import net.minecraftforge.network.PacketDistributor; import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.simple.SimpleChannel;
import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu; import ru.dbotthepony.mc.otm.menu.MenuDriveViewer;
import ru.dbotthepony.mc.otm.menu.data.*; import ru.dbotthepony.mc.otm.menu.data.*;
import ru.dbotthepony.mc.otm.network.android.*; import ru.dbotthepony.mc.otm.network.android.*;
@ -206,19 +206,19 @@ public class MatteryNetworking {
CHANNEL.registerMessage( CHANNEL.registerMessage(
next_network_id++, next_network_id++,
DriveViewerMenu.FilterSwitchPacket.class, MenuDriveViewer.FilterSwitchPacket.class,
DriveViewerMenu.FilterSwitchPacket::write, MenuDriveViewer.FilterSwitchPacket::write,
DriveViewerMenu.FilterSwitchPacket::read, MenuDriveViewer.FilterSwitchPacket::read,
DriveViewerMenu.FilterSwitchPacket::play, MenuDriveViewer.FilterSwitchPacket::play,
Optional.of(NetworkDirection.PLAY_TO_SERVER) Optional.of(NetworkDirection.PLAY_TO_SERVER)
); );
CHANNEL.registerMessage( CHANNEL.registerMessage(
next_network_id++, next_network_id++,
DriveViewerMenu.FilterSetPacket.class, MenuDriveViewer.FilterSetPacket.class,
DriveViewerMenu.FilterSetPacket::write, MenuDriveViewer.FilterSetPacket::write,
DriveViewerMenu.FilterSetPacket::read, MenuDriveViewer.FilterSetPacket::read,
DriveViewerMenu.FilterSetPacket::play, MenuDriveViewer.FilterSetPacket::play,
Optional.of(NetworkDirection.PLAY_TO_SERVER) Optional.of(NetworkDirection.PLAY_TO_SERVER)
); );
} }

View File

@ -7,7 +7,7 @@ import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
import ru.dbotthepony.mc.otm.OverdriveThatMatters; import ru.dbotthepony.mc.otm.OverdriveThatMatters;
import ru.dbotthepony.mc.otm.capability.matter.PatternState; import ru.dbotthepony.mc.otm.capability.matter.PatternState;
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
import java.util.ArrayList; import java.util.ArrayList;
@ -31,7 +31,7 @@ public record PatternGridPacket(boolean action, Collection<PatternState> state)
} }
private void playClient() { private void playClient() {
if (Minecraft.getInstance().player.containerMenu instanceof MatterPanelMenu menu) { if (Minecraft.getInstance().player.containerMenu instanceof MenuMatterPanel menu) {
if (action) if (action)
menu.networkPatternsUpdated(state); menu.networkPatternsUpdated(state);
else else

View File

@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
import ru.dbotthepony.mc.otm.capability.matter.PatternState; import ru.dbotthepony.mc.otm.capability.matter.PatternState;
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu; import ru.dbotthepony.mc.otm.menu.MenuMatterPanel;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -27,7 +27,7 @@ public record PatternReplicationRequestPacket(PatternState state, int how_much)
var ply = context.get().getSender(); var ply = context.get().getSender();
if (ply.containerMenu instanceof MatterPanelMenu menu) if (ply.containerMenu instanceof MenuMatterPanel menu)
menu.requestReplication(ply, state, how_much); menu.requestReplication(ply, state, how_much);
}); });
} }

View File

@ -26,7 +26,7 @@ import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.container.MatteryContainer
import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.menu.ChemicalGeneratorMenu import ru.dbotthepony.mc.otm.menu.MenuCHemicalGenerator
import ru.dbotthepony.mc.otm.* import ru.dbotthepony.mc.otm.*
import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
@ -41,7 +41,7 @@ class BlockEntityChemicalGenerator(pos: BlockPos, state: BlockState) : BlockEnti
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return ChemicalGeneratorMenu(containerID, inventory, this) return MenuCHemicalGenerator(containerID, inventory, this)
} }
private var valid = true private var valid = true

View File

@ -21,7 +21,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryMachineEnergyStorage
import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.container.MatteryContainer
import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.ifHas
import ru.dbotthepony.mc.otm.menu.DriveRackMenu import ru.dbotthepony.mc.otm.menu.MenuDriveRack
import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.set
import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent
@ -79,7 +79,7 @@ class BlockEntityDriveRack(p_155229_: BlockPos, p_155230_: BlockState) :
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? {
return DriveRackMenu(containerID, inventory, this) return MenuDriveRack(containerID, inventory, this)
} }
override fun <T> getCapability(cap: Capability<T>, side: Direction?): LazyOptional<T> { override fun <T> getCapability(cap: Capability<T>, side: Direction?): LazyOptional<T> {

View File

@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryMachineEnergyStorage
import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.container.MatteryContainer
import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.ifHas
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu import ru.dbotthepony.mc.otm.menu.MenuDriveViewer
import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.set
import javax.annotation.ParametersAreNonnullByDefault import javax.annotation.ParametersAreNonnullByDefault
@ -86,7 +86,7 @@ class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : Block
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? {
return DriveViewerMenu(containerID, inventory, this) return MenuDriveViewer(containerID, inventory, this)
} }
override fun saveAdditional(nbt: CompoundTag) { override fun saveAdditional(nbt: CompoundTag) {

View File

@ -25,7 +25,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.capability.extractEnergy import ru.dbotthepony.mc.otm.capability.extractEnergy
import ru.dbotthepony.mc.otm.capability.receiveEnergy import ru.dbotthepony.mc.otm.capability.receiveEnergy
import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.menu.EnergyCounterMenu import ru.dbotthepony.mc.otm.menu.MenuEnergyCounter
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(Registry.BlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) { class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(Registry.BlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) {
@ -108,7 +108,7 @@ class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : Blo
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return EnergyCounterMenu(containerID, inventory, this) return MenuEnergyCounter(containerID, inventory, this)
} }
private val energyInput = EnergyCounterCap(true) private val energyInput = EnergyCounterCap(true)

View File

@ -17,7 +17,7 @@ import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode
import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.capability.MatteryMachineEnergyStorage import ru.dbotthepony.mc.otm.capability.MatteryMachineEnergyStorage
import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.menu.ItemMonitorMenu import ru.dbotthepony.mc.otm.menu.MenuItemMonitor
import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) : class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) :
@ -39,7 +39,7 @@ class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) :
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return ItemMonitorMenu(containerID, inventory, this) return MenuItemMonitor(containerID, inventory, this)
} }
override fun setLevel(p_155231_: Level) { override fun setLevel(p_155231_: Level) {

View File

@ -25,13 +25,12 @@ import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler
import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler.MatterDirection import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler.MatterDirection
import ru.dbotthepony.mc.otm.capability.matter.MatterHandlerCapability import ru.dbotthepony.mc.otm.capability.matter.MatterHandlerCapability
import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.container.MatteryContainer
import ru.dbotthepony.mc.otm.container.MatteryContainerHandler
import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.Graph6Node
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.ifHas
import ru.dbotthepony.mc.otm.menu.MatterBottlerMenu import ru.dbotthepony.mc.otm.menu.MenuMatterBottler
import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.set
class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) : class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) :
@ -166,7 +165,7 @@ class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) :
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return MatterBottlerMenu(containerID, inventory, this) return MenuMatterBottler(containerID, inventory, this)
} }
override fun saveAdditional(nbt: CompoundTag) { override fun saveAdditional(nbt: CompoundTag) {

View File

@ -26,7 +26,7 @@ import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.Graph6Node
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
import ru.dbotthepony.mc.otm.menu.MatterCapacitorBankMenu import ru.dbotthepony.mc.otm.menu.MenuMatterCapacitor
import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.set
import javax.annotation.ParametersAreNonnullByDefault import javax.annotation.ParametersAreNonnullByDefault
@ -163,7 +163,7 @@ class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState)
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return MatterCapacitorBankMenu(containerID, inventory, this) return MenuMatterCapacitor(containerID, inventory, this)
} }
private var valid = true private var valid = true

View File

@ -6,7 +6,7 @@ import net.minecraft.core.BlockPos
import net.minecraft.core.Direction import net.minecraft.core.Direction
import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.BlockState
import ru.dbotthepony.mc.otm.capability.matter.IMatterTaskProvider import ru.dbotthepony.mc.otm.capability.matter.IMatterTaskProvider
import ru.dbotthepony.mc.otm.menu.MatterPanelMenu import ru.dbotthepony.mc.otm.menu.MenuMatterPanel
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.entity.player.Player import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu import net.minecraft.world.inventory.AbstractContainerMenu
@ -38,18 +38,18 @@ import java.util.List
class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
BlockEntityMattery(Registry.BlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider { BlockEntityMattery(Registry.BlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider {
private val listeners = ArrayList<MatterPanelMenu>() private val listeners = ArrayList<MenuMatterPanel>()
private val node = Graph6Node<IMatterGraphNode>(this) private val node = Graph6Node<IMatterGraphNode>(this)
override fun getAsMatterNode(): Graph6Node<IMatterGraphNode> { override fun getAsMatterNode(): Graph6Node<IMatterGraphNode> {
return node return node
} }
fun attachMenu(menu: MatterPanelMenu) { fun attachMenu(menu: MenuMatterPanel) {
listeners.add(menu) listeners.add(menu)
} }
fun deatachMenu(menu: MatterPanelMenu) { fun deatachMenu(menu: MenuMatterPanel) {
listeners.remove(menu) listeners.remove(menu)
} }
@ -58,7 +58,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return MatterPanelMenu(containerID, inventory, this) return MenuMatterPanel(containerID, inventory, this)
} }
private var valid = true private var valid = true
@ -121,7 +121,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
if (!simulate) { if (!simulate) {
val new = task.shrinkRequired(1) val new = task.shrinkRequired(1)
tasks[key] = new tasks[key] = new
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(new) } listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(new) }
graph.onMatterTaskUpdated(new, task) graph.onMatterTaskUpdated(new, task)
setChanged() setChanged()
} }
@ -145,12 +145,12 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
if (localTask.required <= 0 && localTask.in_progress <= 0) { if (localTask.required <= 0 && localTask.in_progress <= 0) {
tasks.remove(task.id) tasks.remove(task.id)
graph?.onMatterTaskCreated(task) graph?.onMatterTaskCreated(task)
listeners.forEach { menu: MatterPanelMenu -> menu.taskRemoved(localTask) } listeners.forEach { menu: MenuMatterPanel -> menu.taskRemoved(localTask) }
} else { } else {
// Задача обновлена // Задача обновлена
tasks[task.id()] = localTask tasks[task.id()] = localTask
graph?.onMatterTaskUpdated(localTask, oldTask) graph?.onMatterTaskUpdated(localTask, oldTask)
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(localTask) } listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(localTask) }
} }
setChanged() setChanged()
@ -193,7 +193,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
(node.graph as MatterNetworkGraph?)?.onMatterTaskRemoved(task) (node.graph as MatterNetworkGraph?)?.onMatterTaskRemoved(task)
listeners.forEach { menu: MatterPanelMenu -> menu.taskRemoved(task) } listeners.forEach { menu: MenuMatterPanel -> menu.taskRemoved(task) }
setChanged() setChanged()
} }
@ -205,7 +205,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
(node.graph as MatterNetworkGraph?)?.onMatterTaskCreated(task) (node.graph as MatterNetworkGraph?)?.onMatterTaskCreated(task)
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(task) } listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(task) }
setChanged() setChanged()
return task return task
@ -216,7 +216,7 @@ class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) :
for (task in tasks.values) { for (task in tasks.values) {
graph?.onMatterTaskRemoved(task!!) graph?.onMatterTaskRemoved(task!!)
listeners.forEach { menu: MatterPanelMenu -> menu.taskUpdated(task!!) } listeners.forEach { menu: MenuMatterPanel -> menu.taskUpdated(task!!) }
} }
tasks.clear() tasks.clear()

View File

@ -28,7 +28,7 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
import ru.dbotthepony.mc.otm.matter.MatterRegistry import ru.dbotthepony.mc.otm.matter.MatterRegistry
import ru.dbotthepony.mc.otm.menu.MatterScannerMenu import ru.dbotthepony.mc.otm.menu.MenuMatterScanner
import java.util.* import java.util.*
class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) : class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) :
@ -98,7 +98,7 @@ class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) :
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? {
return MatterScannerMenu(containerID, inventory, this) return MenuMatterScanner(containerID, inventory, this)
} }
override fun saveAdditional(nbt: CompoundTag) { override fun saveAdditional(nbt: CompoundTag) {

View File

@ -15,7 +15,7 @@ import net.minecraftforge.items.CapabilityItemHandler
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.entity.player.Player import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu import net.minecraft.world.inventory.AbstractContainerMenu
import ru.dbotthepony.mc.otm.menu.PatternStorageMenu import ru.dbotthepony.mc.otm.menu.MenuPatternStorage
import net.minecraft.MethodsReturnNonnullByDefault import net.minecraft.MethodsReturnNonnullByDefault
import net.minecraft.core.Direction import net.minecraft.core.Direction
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
@ -149,7 +149,7 @@ class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) :
} }
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return PatternStorageMenu(containerID, inventory, this) return MenuPatternStorage(containerID, inventory, this)
} }
override fun getStoredPatterns(): Collection<PatternState> { override fun getStoredPatterns(): Collection<PatternState> {

View File

@ -16,7 +16,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryMachineEnergyStorage
import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.container.MatteryContainer
import ru.dbotthepony.mc.otm.container.MatteryContainerFilter import ru.dbotthepony.mc.otm.container.MatteryContainerFilter
import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.menu.PlatePressMenu import ru.dbotthepony.mc.otm.menu.MenuPlatePress
import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.set
class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryWorker(Registry.BlockEntities.PLATE_PRESS, p_155229_, p_155230_) { class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryWorker(Registry.BlockEntities.PLATE_PRESS, p_155229_, p_155230_) {
@ -49,7 +49,7 @@ class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockE
override fun getDefaultDisplayName() = NAME override fun getDefaultDisplayName() = NAME
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
return PlatePressMenu(containerID, inventory, this) return MenuPlatePress(containerID, inventory, this)
} }
override fun onJobFinish(job: MachineJob): MachineJobStatus { override fun onJobFinish(job: MachineJob): MachineJobStatus {

View File

@ -1,7 +1,7 @@
package ru.dbotthepony.mc.otm.client.screen package ru.dbotthepony.mc.otm.client.screen
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.menu.MatterScannerMenu import ru.dbotthepony.mc.otm.menu.MenuMatterScanner
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel 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.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.PowerGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
class MatterScannerScreen(p_97741_: MatterScannerMenu, p_97742_: Inventory, p_97743_: Component) : class MatterScannerScreen(p_97741_: MenuMatterScanner, p_97742_: Inventory, p_97743_: Component) :
MatteryScreen<MatterScannerMenu>(p_97741_, p_97742_, p_97743_) { MatteryScreen<MenuMatterScanner>(p_97741_, p_97742_, p_97743_) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!

View File

@ -1,16 +1,14 @@
package ru.dbotthepony.mc.otm.client.screen package ru.dbotthepony.mc.otm.client.screen
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.menu.PatternStorageMenu import ru.dbotthepony.mc.otm.menu.MenuPatternStorage
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel 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.panels.SlotPanel
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.PatternGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PatternGaugePanel
class PatternStorageScreen(p_97741_: PatternStorageMenu, p_97742_: Inventory, p_97743_: Component) : class PatternStorageScreen(p_97741_: MenuPatternStorage, p_97742_: Inventory, p_97743_: Component) :
MatteryScreen<PatternStorageMenu>(p_97741_, p_97742_, p_97743_) { MatteryScreen<MenuPatternStorage>(p_97741_, p_97742_, p_97743_) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!

View File

@ -6,10 +6,10 @@ 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.panels.SlotPanel
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
import ru.dbotthepony.mc.otm.menu.PlatePressMenu import ru.dbotthepony.mc.otm.menu.MenuPlatePress
class PlatePressScreen(menu: PlatePressMenu, inventory: Inventory, title: Component) : class PlatePressScreen(menu: MenuPlatePress, inventory: Inventory, title: Component) :
MatteryScreen<PlatePressMenu>(menu, inventory, title) { MatteryScreen<MenuPlatePress>(menu, inventory, title) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!

View File

@ -19,12 +19,12 @@ import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
import ru.dbotthepony.mc.otm.menu.AndroidStationMenu import ru.dbotthepony.mc.otm.menu.AndroidStationMenu
import java.util.* import java.util.*
class AndroidStationScreen constructor(p_97741_: AndroidStationMenu, p_97742_: Inventory, p_97743_: Component) : class ScreenAndroidStation constructor(p_97741_: AndroidStationMenu, p_97742_: Inventory, p_97743_: Component) :
MatteryScreen<AndroidStationMenu>(p_97741_, p_97742_, p_97743_) { MatteryScreen<AndroidStationMenu>(p_97741_, p_97742_, p_97743_) {
internal inner class AndroidResearchButton(parent: EditablePanel?, private val node: AndroidResearch) : internal inner class AndroidResearchButton(parent: EditablePanel?, private val node: AndroidResearch) :
EditablePanel( EditablePanel(
this@AndroidStationScreen, this@ScreenAndroidStation,
parent, parent,
0f, 0f,
0f, 0f,
@ -103,7 +103,7 @@ class AndroidStationScreen constructor(p_97741_: AndroidStationMenu, p_97742_: I
seen.add(research) seen.add(research)
if (rows[level] == null) { if (rows[level] == null) {
rows[level] = object : EditablePanel(this@AndroidStationScreen, canvas, 0f, (level * 22).toFloat(), 10000f, 22f) { rows[level] = object : EditablePanel(this@ScreenAndroidStation, canvas, 0f, (level * 22).toFloat(), 10000f, 22f) {
override fun mouseClickedInner(mouse_x: Double, mouse_y: Double, flag: Int) = false 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 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 override fun mouseDraggedInner(mouse_x: Double, mouse_y: Double, flag: Int, drag_x: Double, drag_y: Double) = false
@ -138,7 +138,7 @@ class AndroidStationScreen 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")) research = FramePanel(this, null, 0f, 0f, window.guiScaledWidth * 0.8f, window.guiScaledHeight * 0.8f, TranslatableComponent("otm.gui.android_research"))
canvas = object : DraggableCanvasPanel(this@AndroidStationScreen, research, width = (GRID_WIDTH * 22).toFloat(), height = 0f) { canvas = object : DraggableCanvasPanel(this@ScreenAndroidStation, research, width = (GRID_WIDTH * 22).toFloat(), height = 0f) {
override fun innerRender(stack: PoseStack, mouse_x: Float, mouse_y: Float, flag: Float) { override fun innerRender(stack: PoseStack, mouse_x: Float, mouse_y: Float, flag: Float) {
RenderHelper.setDrawColor(RGBAColor.BLACK) RenderHelper.setDrawColor(RGBAColor.BLACK)
RenderHelper.drawRect(stack, 0f, 0f, width, height) RenderHelper.drawRect(stack, 0f, 0f, width, height)

View File

@ -3,12 +3,11 @@ package ru.dbotthepony.mc.otm.client.screen
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.menu.BatteryBankMenu import ru.dbotthepony.mc.otm.menu.BatteryBankMenu
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel 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.panels.SlotPanel
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
class BatteryBankScreen(menu: BatteryBankMenu, p_97742_: Inventory, p_97743_: Component) : class ScreenBatteryBank(menu: BatteryBankMenu, p_97742_: Inventory, p_97743_: Component) :
MatteryScreen<BatteryBankMenu>(menu, p_97742_, p_97743_) { MatteryScreen<BatteryBankMenu>(menu, p_97742_, p_97743_) {
override fun makeMainFrame(): FramePanel{ override fun makeMainFrame(): FramePanel{

View File

@ -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.panels.*
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
import ru.dbotthepony.mc.otm.menu.ChemicalGeneratorMenu import ru.dbotthepony.mc.otm.menu.MenuCHemicalGenerator
class ChemicalGeneratorScreen(menu: ChemicalGeneratorMenu, inventory: Inventory, title: Component) : MatteryScreen<ChemicalGeneratorMenu>(menu, inventory, title) { class ScreenChemicalGenerator(menu: MenuCHemicalGenerator, inventory: Inventory, title: Component) : MatteryScreen<MenuCHemicalGenerator>(menu, inventory, title) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!

View File

@ -1,14 +1,14 @@
package ru.dbotthepony.mc.otm.client.screen package ru.dbotthepony.mc.otm.client.screen
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.menu.DriveRackMenu import ru.dbotthepony.mc.otm.menu.MenuDriveRack
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel 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.panels.SlotPanel
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
class DriveRackScreen(menu: DriveRackMenu, inventory: Inventory, title: Component) : class ScreenDriveRack(menu: MenuDriveRack, inventory: Inventory, title: Component) :
MatteryScreen<DriveRackMenu>(menu, inventory, title) { MatteryScreen<MenuDriveRack>(menu, inventory, title) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!

View File

@ -7,13 +7,13 @@ import net.minecraft.world.item.ItemStack
import ru.dbotthepony.mc.otm.client.screen.panels.* 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.PowerGaugePanel
import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive.FilterSettings import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive.FilterSettings
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu import ru.dbotthepony.mc.otm.menu.MenuDriveViewer
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu.FilterSetPacket import ru.dbotthepony.mc.otm.menu.MenuDriveViewer.FilterSetPacket
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu.FilterSwitchPacket import ru.dbotthepony.mc.otm.menu.MenuDriveViewer.FilterSwitchPacket
import ru.dbotthepony.mc.otm.network.MatteryNetworking import ru.dbotthepony.mc.otm.network.MatteryNetworking
class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Component) : class ScreenDriveViewer(menu: MenuDriveViewer, inventory: Inventory, title: Component) :
MatteryScreen<DriveViewerMenu>(menu, inventory, title) { MatteryScreen<MenuDriveViewer>(menu, inventory, title) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle()) val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle())
@ -59,7 +59,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
views.add(scroll_bar) views.add(scroll_bar)
for (i in 0 until GRID_WIDTH * GRID_HEIGHT) { for (i in 0 until GRID_WIDTH * GRID_HEIGHT) {
object : AbstractSlotPanel(this@DriveViewerScreen, grid, 0f, 0f) { object : AbstractSlotPanel(this@ScreenDriveViewer, grid, 0f, 0f) {
override fun getItemStack(): ItemStack { override fun getItemStack(): ItemStack {
val index = i + scroll_bar.getScroll(menu.view.getItems().size / GRID_WIDTH) val index = i + scroll_bar.getScroll(menu.view.getItems().size / GRID_WIDTH)
val list = menu.view.getItems() val list = menu.view.getItems()
@ -91,7 +91,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
settings.add(grid_filter) settings.add(grid_filter)
for (i in 0 until FilterSettings.MAX_FILTERS) { for (i in 0 until FilterSettings.MAX_FILTERS) {
object : AbstractSlotPanel(this@DriveViewerScreen, grid_filter, 0f, 0f) { object : AbstractSlotPanel(this@ScreenDriveViewer, grid_filter, 0f, 0f) {
override fun getItemStack(): ItemStack { override fun getItemStack(): ItemStack {
val filter = menu.getFilter() ?: return ItemStack.EMPTY val filter = menu.getFilter() ?: return ItemStack.EMPTY
return filter.items[i] return filter.items[i]
@ -118,7 +118,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
val yes = TranslatableComponent("otm.filter.yes") val yes = TranslatableComponent("otm.filter.yes")
val matchNbt = val matchNbt =
object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_nbt", no)) { object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_nbt", no)) {
override fun tick() { override fun tick() {
super.tick() super.tick()
@ -140,7 +140,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
null, null,
FilterSwitchPacket( FilterSwitchPacket(
menu.containerId, menu.containerId,
DriveViewerMenu.FilterSwitch.MATCH_NBT, MenuDriveViewer.FilterSwitch.MATCH_NBT,
!filter.matchNbt !filter.matchNbt
) )
) )
@ -150,7 +150,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
} }
val matchTag = val matchTag =
object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_tag", no)) { object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.match_tag", no)) {
override fun tick() { override fun tick() {
super.tick() super.tick()
@ -173,7 +173,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
null, null,
FilterSwitchPacket( FilterSwitchPacket(
menu.containerId, menu.containerId,
DriveViewerMenu.FilterSwitch.MATCH_TAG, MenuDriveViewer.FilterSwitch.MATCH_TAG,
!filter.matchTag !filter.matchTag
) )
) )
@ -183,7 +183,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
} }
val blacklist = val blacklist =
object : ButtonPanel(this@DriveViewerScreen, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.blacklist", no)) { object : ButtonPanel(this@ScreenDriveViewer, dock_left, 0f, 0f, 90f, 20f, TranslatableComponent("otm.filter.blacklist", no)) {
override fun tick() { override fun tick() {
super.tick() super.tick()
@ -204,7 +204,7 @@ class DriveViewerScreen(menu: DriveViewerMenu, inventory: Inventory, title: Comp
null, null,
FilterSwitchPacket( FilterSwitchPacket(
menu.containerId, menu.containerId,
DriveViewerMenu.FilterSwitch.BLACKLIST, MenuDriveViewer.FilterSwitch.BLACKLIST,
!filter.isBlacklist !filter.isBlacklist
) )
) )

View File

@ -6,14 +6,14 @@ import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.panels.Dock import ru.dbotthepony.mc.otm.client.screen.panels.Dock
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
import ru.dbotthepony.mc.otm.client.screen.panels.Label import ru.dbotthepony.mc.otm.client.screen.panels.Label
import ru.dbotthepony.mc.otm.menu.EnergyCounterMenu import ru.dbotthepony.mc.otm.menu.MenuEnergyCounter
import ru.dbotthepony.mc.otm.menu.FormattingHelper import ru.dbotthepony.mc.otm.menu.FormattingHelper
class EnergyCounterScreen(menu: EnergyCounterMenu, inventory: Inventory, title: Component) : MatteryScreen<EnergyCounterMenu>(menu, inventory, title) { class ScreenEnergyCounter(menu: MenuEnergyCounter, inventory: Inventory, title: Component) : MatteryScreen<MenuEnergyCounter>(menu, inventory, title) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!
var label: Label = object : Label(this@EnergyCounterScreen, frame) { var label: Label = object : Label(this@ScreenEnergyCounter, frame) {
override fun tick() { override fun tick() {
super.tick() super.tick()
setText( setText(
@ -28,7 +28,7 @@ class EnergyCounterScreen(menu: EnergyCounterMenu, inventory: Inventory, title:
label.dock = Dock.TOP label.dock = Dock.TOP
label.setDockMargin(4f, 0f, 0f, 0f) label.setDockMargin(4f, 0f, 0f, 0f)
label = object : Label(this@EnergyCounterScreen, frame) { label = object : Label(this@ScreenEnergyCounter, frame) {
override fun tick() { override fun tick() {
super.tick() super.tick()
setText( setText(
@ -43,7 +43,7 @@ class EnergyCounterScreen(menu: EnergyCounterMenu, inventory: Inventory, title:
label.dock = Dock.TOP label.dock = Dock.TOP
label.setDockMargin(4f, 0f, 0f, 0f) label.setDockMargin(4f, 0f, 0f, 0f)
label = object : Label(this@EnergyCounterScreen, frame) { label = object : Label(this@ScreenEnergyCounter, frame) {
override fun tick() { override fun tick() {
super.tick() super.tick()
setText( setText(
@ -58,7 +58,7 @@ class EnergyCounterScreen(menu: EnergyCounterMenu, inventory: Inventory, title:
label.dock = Dock.TOP label.dock = Dock.TOP
label.setDockMargin(4f, 0f, 0f, 0f) label.setDockMargin(4f, 0f, 0f, 0f)
label = object : Label(this@EnergyCounterScreen, frame) { label = object : Label(this@ScreenEnergyCounter, frame) {
override fun tick() { override fun tick() {
super.tick() super.tick()
setText( setText(

View File

@ -5,10 +5,10 @@ import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import ru.dbotthepony.mc.otm.client.screen.panels.* 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.PowerGaugePanel
import ru.dbotthepony.mc.otm.menu.ItemMonitorMenu import ru.dbotthepony.mc.otm.menu.MenuItemMonitor
class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Component) : class ScreenItemMonitor(menu: MenuItemMonitor, inventory: Inventory, title: Component) :
MatteryScreen<ItemMonitorMenu>(menu, inventory, title) { MatteryScreen<MenuItemMonitor>(menu, inventory, title) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle()) val frame = FramePanel(this, null, 0f, 0f, FRAME_WIDTH, FRAME_HEIGHT, getTitle())
@ -22,7 +22,7 @@ class ItemMonitorScreen(menu: ItemMonitorMenu, inventory: Inventory, title: Comp
val gridPanel = GridPanel(this, frame, 28f, 16f, GRID_WIDTH * 18f, GRID_HEIGHT * 18f, GRID_WIDTH, GRID_HEIGHT) 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) { for (i in 0 until GRID_WIDTH * GRID_HEIGHT) {
object : AbstractSlotPanel(this@ItemMonitorScreen, gridPanel) { object : AbstractSlotPanel(this@ScreenItemMonitor, gridPanel) {
override fun getItemStack(): ItemStack { override fun getItemStack(): ItemStack {
val index = i + scrollBar.getScroll(menu.view.getItemCount() / GRID_WIDTH) val index = i + scrollBar.getScroll(menu.view.getItemCount() / GRID_WIDTH)
val list = menu.view.getItems() val list = menu.view.getItems()

View File

@ -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.MatterGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
import ru.dbotthepony.mc.otm.menu.MatterBottlerMenu import ru.dbotthepony.mc.otm.menu.MenuMatterBottler
class MatterBottlerScreen(menu: MatterBottlerMenu, inventory: Inventory, title: Component) : class ScreenMatterBottler(menu: MenuMatterBottler, inventory: Inventory, title: Component) :
MatteryScreen<MatterBottlerMenu>(menu, inventory, title) { MatteryScreen<MenuMatterBottler>(menu, inventory, title) {
private var progress: ProgressGaugePanel? = null private var progress: ProgressGaugePanel? = null

View File

@ -1,14 +1,14 @@
package ru.dbotthepony.mc.otm.client.screen package ru.dbotthepony.mc.otm.client.screen
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.menu.MatterCapacitorBankMenu import ru.dbotthepony.mc.otm.menu.MenuMatterCapacitor
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel 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.panels.SlotPanel
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
class MatterCapacitorBankScreen(p_97741_: MatterCapacitorBankMenu, p_97742_: Inventory, p_97743_: Component) : class ScreenMatterCapacitorBank(p_97741_: MenuMatterCapacitor, p_97742_: Inventory, p_97743_: Component) :
MatteryScreen<MatterCapacitorBankMenu>(p_97741_, p_97742_, p_97743_) { MatteryScreen<MenuMatterCapacitor>(p_97741_, p_97742_, p_97743_) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!

View File

@ -9,7 +9,7 @@ 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.PowerGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
class MatterDecomposerScreen(p_97741_: MatterDecomposerMenu, p_97742_: Inventory, p_97743_: Component) : class ScreenMatterDecomposer(p_97741_: MatterDecomposerMenu, p_97742_: Inventory, p_97743_: Component) :
MatteryScreen<MatterDecomposerMenu>(p_97741_, p_97742_, p_97743_) { MatteryScreen<MatterDecomposerMenu>(p_97741_, p_97742_, p_97743_) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {

View File

@ -9,7 +9,7 @@ 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.PowerGaugePanel
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
class MatterReplicatorScreen(p_97741_: MatterReplicatorMenu, p_97742_: Inventory, p_97743_: Component) : class ScreenMatterReplicator(p_97741_: MatterReplicatorMenu, p_97742_: Inventory, p_97743_: Component) :
MatteryScreen<MatterReplicatorMenu>(p_97741_, p_97742_, p_97743_) { MatteryScreen<MatterReplicatorMenu>(p_97741_, p_97742_, p_97743_) {
override fun makeMainFrame(): FramePanel { override fun makeMainFrame(): FramePanel {
val frame = super.makeMainFrame()!! val frame = super.makeMainFrame()!!

View File

@ -33,7 +33,7 @@ class AndroidStationMenu @JvmOverloads constructor(
containerID: Int, containerID: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityAndroidStation? = null tile: BlockEntityAndroidStation? = null
) : PoweredMatteryMenu(Registry.Menus.ANDROID_STATION, containerID, inventory, tile) { ) : MenuMatteryPowered(Registry.Menus.ANDROID_STATION, containerID, inventory, tile) {
val androidBattery: MatterySlot = AndroidBatterySlot(AndroidStationContainer(inventory.player), 0) val androidBattery: MatterySlot = AndroidBatterySlot(AndroidStationContainer(inventory.player), 0)
init { init {

View File

@ -11,7 +11,7 @@ import ru.dbotthepony.mc.otm.menu.data.IntDataContainer
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget
class ChemicalGeneratorMenu @JvmOverloads constructor(id: Int, inv: Inventory, tile: BlockEntityChemicalGenerator? = null) class MenuCHemicalGenerator @JvmOverloads constructor(id: Int, inv: Inventory, tile: BlockEntityChemicalGenerator? = null)
: MatteryMenu(Registry.Menus.CHEMICAL_GENERATOR, id, inv, tile) { : MatteryMenu(Registry.Menus.CHEMICAL_GENERATOR, id, inv, tile) {
val container = tile?.container ?: SimpleContainer(3) val container = tile?.container ?: SimpleContainer(3)

View File

@ -5,11 +5,11 @@ import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.Registry
import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack
class DriveRackMenu @JvmOverloads constructor( class MenuDriveRack @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityDriveRack? = null tile: BlockEntityDriveRack? = null
) : PoweredMatteryMenu(Registry.Menus.DRIVE_RACK, p_38852_, inventory, tile) { ) : MenuMatteryPowered(Registry.Menus.DRIVE_RACK, p_38852_, inventory, tile) {
val drives = arrayOfNulls<MatterySlot>(4) val drives = arrayOfNulls<MatterySlot>(4)
init { init {

View File

@ -19,11 +19,11 @@ import ru.dbotthepony.mc.otm.storage.ItemStackWrapper
import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent
import java.util.function.Supplier import java.util.function.Supplier
class DriveViewerMenu @JvmOverloads constructor( class MenuDriveViewer @JvmOverloads constructor(
containerID: Int, containerID: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityDriveViewer? = null tile: BlockEntityDriveViewer? = null
) : PoweredMatteryMenu( ) : MenuMatteryPowered(
Registry.Menus.DRIVE_VIEWER, containerID, inventory, tile Registry.Menus.DRIVE_VIEWER, containerID, inventory, tile
), INetworkedItemViewSupplier { ), INetworkedItemViewSupplier {
@JvmField val view: NetworkedItemView @JvmField val view: NetworkedItemView
@ -167,7 +167,7 @@ class DriveViewerMenu @JvmOverloads constructor(
val ply = context.get().sender!! val ply = context.get().sender!!
val menu = ply.containerMenu val menu = ply.containerMenu
if (menu is DriveViewerMenu && menu.containerId == id) { if (menu is MenuDriveViewer && menu.containerId == id) {
if (menu.driveSlot.item.isEmpty) if (menu.driveSlot.item.isEmpty)
return@enqueueWork return@enqueueWork
@ -204,7 +204,7 @@ class DriveViewerMenu @JvmOverloads constructor(
val ply = context.get().sender!! val ply = context.get().sender!!
val menu = ply.containerMenu val menu = ply.containerMenu
if (menu is DriveViewerMenu && menu.containerId == id) { if (menu is MenuDriveViewer && menu.containerId == id) {
val settings = menu.getFilter() ?: return@enqueueWork val settings = menu.getFilter() ?: return@enqueueWork
when (type) { when (type) {

View File

@ -6,7 +6,7 @@ import ru.dbotthepony.mc.otm.Registry
import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter
import ru.dbotthepony.mc.otm.menu.data.FractionDataContainer import ru.dbotthepony.mc.otm.menu.data.FractionDataContainer
class EnergyCounterMenu @JvmOverloads constructor( class MenuEnergyCounter @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityEnergyCounter? = null tile: BlockEntityEnergyCounter? = null

View File

@ -5,7 +5,6 @@ import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.Registry
import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier
import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView
@ -13,11 +12,11 @@ import ru.dbotthepony.mc.otm.storage.ItemStackWrapper
import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent
import ru.dbotthepony.mc.otm.storage.VirtualComponent import ru.dbotthepony.mc.otm.storage.VirtualComponent
class ItemMonitorMenu @JvmOverloads constructor( class MenuItemMonitor @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityItemMonitor? = null tile: BlockEntityItemMonitor? = null
) : PoweredMatteryMenu(Registry.Menus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier { ) : MenuMatteryPowered(Registry.Menus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier {
@JvmField @JvmField
val view = NetworkedItemView(inventory.player, this, tile == null) val view = NetworkedItemView(inventory.player, this, tile == null)
private val subscribed: VirtualComponent<ItemStackWrapper>? private val subscribed: VirtualComponent<ItemStackWrapper>?

View File

@ -13,11 +13,11 @@ import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget
import ru.dbotthepony.mc.otm.network.MatterBottlerSwitchPacket import ru.dbotthepony.mc.otm.network.MatterBottlerSwitchPacket
import ru.dbotthepony.mc.otm.network.MatteryNetworking import ru.dbotthepony.mc.otm.network.MatteryNetworking
class MatterBottlerMenu @JvmOverloads constructor( class MenuMatterBottler @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityMatterBottler? = null tile: BlockEntityMatterBottler? = null
) : PoweredMatteryMenu( ) : MenuMatteryPowered(
Registry.Menus.MATTER_BOTTLER, p_38852_, inventory, tile Registry.Menus.MATTER_BOTTLER, p_38852_, inventory, tile
) { ) {
var workFlow = BooleanDataContainer() var workFlow = BooleanDataContainer()

View File

@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
class MatterCapacitorBankMenu @JvmOverloads constructor( class MenuMatterCapacitor @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityMatterCapacitorBank? = null tile: BlockEntityMatterCapacitorBank? = null

View File

@ -18,7 +18,7 @@ import ru.dbotthepony.mc.otm.network.PatternGridPacket
import java.util.* import java.util.*
import java.util.function.Consumer import java.util.function.Consumer
class MatterPanelMenu @JvmOverloads constructor( class MenuMatterPanel @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityMatterPanel? = null tile: BlockEntityMatterPanel? = null

View File

@ -12,11 +12,11 @@ import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.matter.MatterRegistry import ru.dbotthepony.mc.otm.matter.MatterRegistry
import java.math.BigInteger import java.math.BigInteger
class MatterScannerMenu @JvmOverloads constructor( class MenuMatterScanner @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityMatterScanner? = null tile: BlockEntityMatterScanner? = null
) : PoweredMatteryMenu( ) : MenuMatteryPowered(
Registry.Menus.MATTER_SCANNER, p_38852_, inventory, tile Registry.Menus.MATTER_SCANNER, p_38852_, inventory, tile
) { ) {
val input: MatterySlot val input: MatterySlot

View File

@ -7,7 +7,7 @@ import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.MatteryCapability
import net.minecraft.world.SimpleContainer import net.minecraft.world.SimpleContainer
abstract class PoweredMatteryMenu protected constructor( abstract class MenuMatteryPowered protected constructor(
menuType: MenuType<*>, menuType: MenuType<*>,
containerID: Int, containerID: Int,
inventory: Inventory, inventory: Inventory,

View File

@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.core.Fraction
import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
class PatternStorageMenu @JvmOverloads constructor( class MenuPatternStorage @JvmOverloads constructor(
p_38852_: Int, p_38852_: Int,
inventory: Inventory?, inventory: Inventory?,
tile: BlockEntityPatternStorage? = null tile: BlockEntityPatternStorage? = null

View File

@ -6,11 +6,11 @@ import ru.dbotthepony.mc.otm.Registry
import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress
import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget
class PlatePressMenu @JvmOverloads constructor( class MenuPlatePress @JvmOverloads constructor(
containerID: Int, containerID: Int,
inventory: Inventory, inventory: Inventory,
tile: BlockEntityPlatePress? = null tile: BlockEntityPlatePress? = null
) : PoweredMatteryMenu(Registry.Menus.PLATE_PRESS, containerID, inventory, tile) { ) : MenuMatteryPowered(Registry.Menus.PLATE_PRESS, containerID, inventory, tile) {
val container = tile?.container ?: SimpleContainer(2) val container = tile?.container ?: SimpleContainer(2)
val inputSlot = MatterySlot(container, BlockEntityPlatePress.SLOT_INPUT) val inputSlot = MatterySlot(container, BlockEntityPlatePress.SLOT_INPUT)