From b328a9134e1d94e11e4b07e78bfd18262e9688b3 Mon Sep 17 00:00:00 2001 From: XyperCode Date: Thu, 8 Aug 2024 13:03:28 +0200 Subject: [PATCH] Laggggggg --- common/build.gradle | 65 ++- .../api/java/dev/ultreon/devices/api/IO.java | 177 ++++++++ .../dev/ultreon/devices/api/bios/Bios.java | 15 + .../devices/api/bios/BiosCallType.java | 47 ++ .../devices/api/bios/BiosInterruptType.java | 11 + .../devices/api/bios/FrameBufferCall.java | 36 ++ .../devices/api/bios/FrameBufferInfo.java | 8 + .../devices/api/bios/InterruptData.java | 7 + .../devices/api/bios/InterruptHandler.java | 6 + .../devices/api/bios/VEFI_Executable.java | 7 + .../ultreon/devices/api/bios/VEFI_Handle.java | 6 + .../devices/api/bios/VEFI_VideoSize.java | 8 + .../devices/api/bios/efi/VEFI_DeviceID.java | 7 + .../devices/api/bios/efi/VEFI_DeviceInfo.java | 5 + .../devices/api/bios/efi/VEFI_DiskInfo.java | 7 + .../devices/api/bios/efi/VEFI_DriveType.java | 8 + .../devices/api/bios/efi/VEFI_File.java | 5 + .../devices/api/bios/efi/VEFI_FileInfo.java | 5 + .../devices/api/bios/efi/VEFI_IconType.java | 9 + .../api/bios/efi/VEFI_Notification.java | 4 + .../devices/api/bios/efi/VEFI_System.java | 84 ++++ .../ultreon/devices/api/boot/BootSector.java | 7 + .../devices/api/device/AudioDevice.java | 0 .../ultreon/devices/api/device/Device.java | 0 .../dev/ultreon/devices/api/device/Drive.java | 5 + .../devices/api/device/HardwareDevice.java | 15 + .../devices/api/device/MousePointer.java | 0 .../ultreon/devices/api/device/VEFI_Disk.java | 5 + .../classloader/api/ClassLoaderApi.java | 5 - .../java/dev/ultreon/devices/BuiltinApps.java | 21 +- .../dev/ultreon/devices/ClientModEvents.java | 8 +- .../dev/ultreon/devices/OperatingSystems.java | 2 +- .../ultreon/devices/UltreonDevicesMod.java | 46 +- .../devices/api/app/SystemAccessor.java | 7 - .../devices/api/os/OperatingSystem.java | 9 +- .../devices/api/video/CustomResolution.java | 6 - .../devices/block/ClientLaptopWrapper.java | 3 +- .../ultreon/devices/block/ComputerBlock.java | 2 +- .../dev/ultreon/devices/block/PaperBlock.java | 2 +- .../block/entity/ComputerBlockEntity.java | 33 +- .../block/entity/PaperBlockEntity.java | 2 +- .../block/entity/PrinterBlockEntity.java | 2 +- .../block/entity/renderer/PaperRenderer.java | 4 +- .../dev/ultreon/devices/client/Display.java | 4 +- .../dev/ultreon/devices/core/BiosImpl.java | 6 +- .../dev/ultreon/devices/core/BootLoader.java | 1 - .../dev/ultreon/devices/core/TaskBar.java | 30 +- .../devices/core/WorldLessBiosImpl.java | 39 +- .../dev/ultreon/devices/core/Wrappable.java | 6 +- .../core/client/ClientNotification.java | 25 +- .../core/client/debug/ClientAppDebug.java | 2 +- .../ultreon/devices/core/io/FileSystem.java | 26 +- .../ultreon/devices/core/io/ServerFile.java | 4 +- .../devices/core/io/action/FileAction.java | 4 +- .../devices/core/io/task/TaskGetFiles.java | 4 +- .../core/io/task/TaskGetMainDrive.java | 12 +- .../core/io/task/TaskGetStructure.java | 4 +- .../devices/core/io/task/TaskSendAction.java | 8 +- .../core/io/task/TaskSetupFileBrowser.java | 2 +- .../devices/core/laptop/common/TaskBar.java | 2 +- .../devices/core/network/TrayItemWifi.java | 39 +- .../core/network/task/TaskConnect.java | 2 +- .../core/network/task/TaskGetDevices.java | 2 +- .../devices/core/network/task/TaskPing.java | 2 +- .../devices/core/print/task/TaskPrint.java | 4 +- .../devices/core/task/TaskInstallApp.java | 4 +- .../devices/event/WorldDataHandler.java | 2 +- .../ultreon/devices/gui/GuiButtonClose.java | 2 +- .../{api => impl}/ApplicationManager.java | 6 +- .../{api => impl}/ApplicationSupplier.java | 4 +- .../devices/{api => impl}/DebugLog.java | 2 +- .../ultreon/devices/{api => impl}/Logger.java | 2 +- .../dev/ultreon/devices/impl/LoggerImpl.java | 1 - .../{api => impl}/SystemException.java | 2 +- .../devices/{api => impl}/TrayItemAdder.java | 4 +- .../devices/{api => impl}/WorldSavedData.java | 2 +- .../devices/{api => impl}/app/IIcon.java | 2 +- .../{api => impl}/app/component/Button.java | 14 +- .../app/component/ButtonToggle.java | 4 +- .../{api => impl}/app/component/CheckBox.java | 8 +- .../{api => impl}/app/component/ComboBox.java | 24 +- .../{api => impl}/app/component/Image.java | 16 +- .../app/component/Inventory.java | 12 +- .../{api => impl}/app/component/ItemList.java | 22 +- .../{api => impl}/app/component/Label.java | 6 +- .../app/component/NumberSelector.java | 8 +- .../app/component/ProgressBar.java | 6 +- .../app/component/RadioGroup.java | 2 +- .../{api => impl}/app/component/Slider.java | 12 +- .../{api => impl}/app/component/Spinner.java | 6 +- .../{api => impl}/app/component/Text.java | 6 +- .../{api => impl}/app/component/TextArea.java | 12 +- .../app/component/TextField.java | 6 +- .../app/interfaces/IHighlight.java | 2 +- .../app/listener/ChangeListener.java | 2 +- .../app/listener/ClickListener.java | 2 +- .../app/listener/InitListener.java | 2 +- .../app/listener/ItemClickListener.java | 2 +- .../app/listener/KeyListener.java | 2 +- .../app/listener/ReleaseListener.java | 4 +- .../app/listener/SlideListener.java | 4 +- .../app/renderer/ItemRenderer.java | 2 +- .../app/renderer/ListItemRenderer.java | 2 +- .../impl/bios/AbstractInterruptData.java | 40 ++ .../impl/bios/AlreadyClosedException.java | 8 + .../devices/{api => impl}/bios/Bios.java | 5 +- .../{api => impl}/bios/BiosInterrupt.java | 3 +- .../impl/bios/BiosInterruptCaller.java | 16 + .../{api => impl}/bios/BiosNotification.java | 4 +- .../ultreon/devices/impl/bios/DataDevice.java | 5 + .../ultreon/devices/impl/bios/DeviceInfo.java | 18 + .../dev/ultreon/devices/impl/bios/Disk.java | 9 + .../devices/impl/bios/DisplayDevice.java | 109 +++++ .../bios/DoubleFaultInterrupt.java | 2 +- .../ultreon/devices/impl/bios/ExecMeta.java | 11 + .../ultreon/devices/impl/bios/Executable.java | 24 + .../devices/impl/bios/ExecutableResource.java | 26 ++ .../{api => impl}/bios/FaultInterrupt.java | 2 +- .../devices/{api => impl}/bios/Font.java | 2 +- .../devices/impl/bios/FrameBuffer.java | 227 +++++++++ .../devices/impl/bios/FrameBufferTexture.java | 42 ++ .../devices/impl/bios/IOErrorInterrupt.java | 16 + .../{api => impl}/bios/InterruptData.java | 2 +- .../impl/bios/IsolatedClassLoader.java | 46 ++ .../ultreon/devices/impl/bios/NullPtr.java | 9 + .../devices/impl/bios/PartitionEntry.java | 104 +++++ .../devices/impl/bios/PartitionTable.java | 28 ++ .../bios/PowerModeInterrupt.java | 2 +- .../impl/bios/PredefinedResolution.java | 50 ++ .../impl/bios/UserspaceClassLoader.java | 44 ++ .../dev/ultreon/devices/impl/bios/VBios.java | 395 ++++++++++++++++ .../devices/impl/bios/VEFI_DiskHandle.java | 100 ++++ .../devices/impl/bios/VEFI_FileContext.java | 9 + .../devices/impl/bios/VEFI_SystemImpl.java | 429 ++++++++++++++++++ .../ultreon/devices/impl/bios/VideoMode.java | 8 + .../ultreon/devices/impl/bios/VirtVGA.java | 32 ++ .../devices/impl/bios/VirtualDisk.java | 354 +++++++++++++++ .../devices/impl/device/HostDevice.java | 25 + .../impl/device/PhysicalHardwareDevice.java | 10 + .../{api => impl}/event/LaptopEvent.java | 6 +- .../devices/{api => impl}/io/Drive.java | 2 +- .../devices/{api => impl}/io/File.java | 8 +- .../devices/{api => impl}/io/Folder.java | 14 +- .../devices/{api => impl}/io/MimeType.java | 2 +- .../devices/{api => impl}/os/OSScreen.java | 15 +- .../devices/{api => impl}/print/IPrint.java | 2 +- .../{api => impl}/print/PrintingManager.java | 2 +- .../{api => impl}/storage/DataStorage.java | 2 +- .../{api => impl}/storage/FileHandle.java | 2 +- .../devices/impl/storage/FileStorage.java | 4 - .../impl/storage/FileStorageHandle.java | 3 +- .../impl/storage/ResourceFileHandle.java | 1 - .../devices/impl/storage/ResourceStorage.java | 2 - .../devices/{api => impl}/task/Callback.java | 2 +- .../devices/{api => impl}/task/Task.java | 2 +- .../{api => impl}/task/TaskManager.java | 2 +- .../devices/{api => impl}/util/Color.java | 2 +- .../devices/{api => impl}/util/GuiHelper.java | 2 +- .../{api => impl}/util/ImageLoader.java | 4 +- .../{api => impl}/util/ImageSource.java | 2 +- .../{api => impl}/util/Vulnerability.java | 10 +- .../devices/{api => impl}/utils/BankUtil.java | 18 +- .../{api => impl}/utils/OnlineRequest.java | 2 +- .../{api => impl}/utils/RenderUtil.java | 6 +- .../devices/impl/video/CustomResolution.java | 6 + .../{api => impl}/video/VideoInfo.java | 10 +- .../ultreon/devices/mineos/DriverManager.java | 7 - .../ultreon/devices/mineos/MineOSSystem.java | 13 - .../devices/mineos/client/MineOSKernel.java | 23 - .../devices/minephone/MinePhoneOS.java | 6 +- .../network/task/NotificationPacket.java | 2 +- .../devices/network/task/RequestPacket.java | 4 +- .../devices/network/task/ResponsePacket.java | 4 +- .../network/task/SyncApplicationPacket.java | 4 +- .../devices/util/SiteRegistration.java | 2 +- .../devices/util/VulnerabilityUtil.java | 2 +- .../dev/ultreon/mineos/AppClassLoader.java | 41 ++ .../java/dev/ultreon/mineos/BootLoader.java | 18 + .../java/dev/ultreon}/mineos/DestFactor.java | 2 +- .../dev/ultreon/mineos/DriverManager.java | 11 + .../dev/ultreon/mineos/DriverManagerImpl.java | 44 ++ .../java/dev/ultreon/mineos/Executable.java | 26 ++ .../java/dev/ultreon/mineos/MineOSSystem.java | 13 + .../dev/ultreon}/mineos/SourceFactor.java | 2 +- .../dev/ultreon/mineos/api}/Alphabet.java | 3 +- .../dev/ultreon/mineos/api}/Application.java | 10 +- .../dev/ultreon/mineos/api}/Component.java | 8 +- .../java/dev/ultreon/mineos/api}/Dialog.java | 114 +++-- .../java/dev/ultreon/mineos/api}/Icons.java | 2 +- .../java/dev/ultreon/mineos/api}/Layout.java | 10 +- .../dev/ultreon/mineos/api}/Notification.java | 4 +- .../ultreon/mineos/api}/ScrollableLayout.java | 6 +- .../java/dev/ultreon/mineos/api}/System.java | 8 +- .../ultreon/mineos/api/SystemAccessor.java | 7 + .../ultreon}/mineos/apps/BoatRacersApp.java | 26 +- .../dev/ultreon}/mineos/apps/IconsApp.java | 9 +- .../ultreon}/mineos/apps/NoteStashApp.java | 11 +- .../ultreon}/mineos/apps/PixelPainterApp.java | 42 +- .../dev/ultreon}/mineos/apps/TestApp.java | 10 +- .../mineos/apps/auction/AuctionManager.java | 4 +- .../mineos/apps/auction/MineBayApp.java | 31 +- .../apps/auction/object/AuctionItem.java | 2 +- .../apps/auction/task/TaskAddAuction.java | 8 +- .../mineos/apps/auction/task/TaskBuyItem.java | 12 +- .../apps/auction/task/TaskGetAuctions.java | 8 +- .../mineos/apps/debug/TextAreaApp.java | 16 +- .../ultreon}/mineos/apps/email/EmailApp.java | 42 +- .../mineos/apps/email/EmailManager.java | 10 +- .../mineos/apps/email/object/Contact.java | 2 +- .../mineos/apps/email/object/Email.java | 4 +- .../email/task/TaskCheckEmailAccount.java | 6 +- .../apps/email/task/TaskDeleteEmail.java | 8 +- .../email/task/TaskRegisterEmailAccount.java | 6 +- .../mineos/apps/email/task/TaskSendEmail.java | 8 +- .../apps/email/task/TaskUpdateInbox.java | 8 +- .../mineos/apps/email/task/TaskViewEmail.java | 8 +- .../mineos/apps/example/ExampleApp.java | 11 +- .../example/task/TaskNotificationTest.java | 8 +- .../mineos/apps/gitweb/GitWebApp.java | 25 +- .../apps/gitweb/component/GitWebFrame.java | 26 +- .../gitweb/component/container/AnvilBox.java | 2 +- .../component/container/BrewingBox.java | 4 +- .../component/container/ContainerBox.java | 8 +- .../component/container/CraftingBox.java | 2 +- .../component/container/FurnaceBox.java | 4 +- .../gitweb/component/container/LoomBox.java | 4 +- .../apps/gitweb/layout/ModuleLayout.java | 8 +- .../mineos/apps/gitweb/layout/TextLayout.java | 6 +- .../apps/gitweb/module/AnvilModule.java | 6 +- .../apps/gitweb/module/AppLinkModule.java | 18 +- .../apps/gitweb/module/BannerIIModule.java | 12 +- .../apps/gitweb/module/BannerModule.java | 12 +- .../apps/gitweb/module/BrewingModule.java | 6 +- .../apps/gitweb/module/ContainerModule.java | 14 +- .../apps/gitweb/module/CraftingModule.java | 6 +- .../apps/gitweb/module/DividerModule.java | 6 +- .../apps/gitweb/module/DownloadModule.java | 20 +- .../apps/gitweb/module/FooterModule.java | 12 +- .../apps/gitweb/module/FurnaceModule.java | 6 +- .../apps/gitweb/module/HeaderModule.java | 12 +- .../mineos/apps/gitweb/module/LoomModule.java | 6 +- .../mineos/apps/gitweb/module/Module.java | 8 +- .../apps/gitweb/module/ModuleEntry.java | 2 +- .../apps/gitweb/module/NavigationModule.java | 10 +- .../apps/gitweb/module/ParagraphModule.java | 14 +- .../apps/gitweb/module/RedirectModule.java | 8 +- .../apps/gitweb/module/ScriptModule.java | 8 +- .../ultreon}/mineos/apps/snake/SnakeApp.java | 16 +- .../mineos/apps/snake/layout/SnakeLayout.java | 14 +- .../ultreon}/mineos/apps/system/AppStore.java | 42 +- .../ultreon}/mineos/apps/system/BankApp.java | 28 +- .../mineos/apps/system/DiagnosticsApp.java | 16 +- .../mineos/apps/system/DisplayResolution.java | 4 +- .../mineos/apps/system/FileBrowserApp.java | 16 +- .../apps/system/PredefinedResolution.java | 6 +- .../mineos/apps/system/SettingsApp.java | 63 ++- .../mineos/apps/system/SystemApp.java | 6 +- .../mineos/apps/system/VulnerabilityApp.java | 15 +- .../mineos/apps/system/component/AppGrid.java | 46 +- .../apps/system/component/FileBrowser.java | 58 ++- .../mineos/apps/system/component/Palette.java | 12 +- .../apps/system/component/SlideShow.java | 16 +- .../apps/system/layout/LayoutAppPage.java | 46 +- .../apps/system/layout/LayoutSearchApps.java | 24 +- .../apps/system/layout/StandardLayout.java | 16 +- .../mineos/apps/system/object/Account.java | 2 +- .../mineos/apps/system/object/AppEntry.java | 4 +- .../apps/system/object/ColorScheme.java | 2 +- .../object/ColorSchemePresetRegistry.java | 2 +- .../system/object/ColorSchemePresets.java | 2 +- .../mineos/apps/system/object/ImageEntry.java | 2 +- .../mineos/apps/system/object/LocalEntry.java | 4 +- .../mineos/apps/system/object/Preset.java | 2 +- .../apps/system/object/RemoteEntry.java | 4 +- .../mineos/apps/system/task/TaskAdd.java | 8 +- .../mineos/apps/system/task/TaskDeposit.java | 8 +- .../apps/system/task/TaskGetBalance.java | 8 +- .../mineos/apps/system/task/TaskPay.java | 8 +- .../mineos/apps/system/task/TaskRemove.java | 8 +- .../task/TaskUpdateApplicationData.java | 4 +- .../system/task/TaskUpdateSystemData.java | 4 +- .../mineos/apps/system/task/TaskWithdraw.java | 8 +- .../mineos/apps/themes/ThemesApp.java | 19 +- .../ultreon/mineos/impl/DevicePermission.java | 9 + .../dev/ultreon/mineos/impl/Permission.java | 13 + .../dev/ultreon/mineos/kernel/Device.java | 5 + .../dev/ultreon/mineos/kernel/Driver.java | 15 + .../ultreon/mineos/kernel/FrameBuffer.java | 85 ++++ .../java/dev/ultreon/mineos/kernel/Kern.java | 22 + .../ultreon/mineos/kernel/MineOSKernel.java | 50 ++ .../dev/ultreon/mineos/kernel/VGADriver.java | 52 +++ .../ultreon/mineos/kernel/VideoDriver.java | 5 + .../dev/ultreon/mineos}/object/AppInfo.java | 22 +- .../ultreon/mineos/object/ApplicationID.java | 21 + .../dev/ultreon/mineos}/object/Canvas.java | 18 +- .../dev/ultreon/mineos}/object/ColorGrid.java | 10 +- .../java/dev/ultreon/mineos}/object/Game.java | 8 +- .../dev/ultreon/mineos}/object/Picture.java | 4 +- .../dev/ultreon/mineos}/object/Player.java | 8 +- .../dev/ultreon/mineos}/object/TileGrid.java | 20 +- .../java/dev/ultreon/mineos}/object/Tool.java | 2 +- .../dev/ultreon/mineos}/object/TrayItem.java | 6 +- .../ultreon/mineos}/object/tiles/Tile.java | 7 +- .../mineos}/object/tiles/TileBlock.java | 7 +- .../mineos}/object/tiles/TileCactus.java | 7 +- .../object/tiles/TileEnchantmentTable.java | 7 +- .../mineos}/object/tiles/TileFlower.java | 7 +- .../mineos}/object/tiles/TileGrass.java | 7 +- .../mineos}/object/tiles/TileWheat.java | 7 +- .../mineos}/object/tools/ToolBucket.java | 6 +- .../mineos}/object/tools/ToolEraser.java | 6 +- .../mineos}/object/tools/ToolEyeDropper.java | 6 +- .../mineos}/object/tools/ToolPencil.java | 6 +- .../dev/ultreon/mineos/userspace/Font.java | 5 + .../ultreon/mineos/userspace/GuiGraphics.java | 5 + .../dev/ultreon/mineos/userspace}/MineOS.java | 283 ++++++++---- .../ultreon/mineos/userspace}/Settings.java | 10 +- .../ultreon/mineos/userspace}/TaskBar.java | 24 +- .../dev/ultreon/mineos/userspace}/Window.java | 10 +- .../jab125/clientint/ClientInit.java | 2 +- .../mixin/LanguageManagerAccessor.java | 2 +- .../src/main/resources/datahelp.mixins.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../jab125/testmod/ClientInit.java | 4 +- .../{com => dev}/jab125/testmod/TestApp.java | 6 +- .../src/main/resources/fabric.mod.json | 4 +- .../fabric/UltreonDevicesModFabric.java | 8 +- forge/build.gradle | 2 + .../ultreon/devices/forge/DevicesForge.java | 8 +- neoforge/build.gradle | 2 + .../devices/forge/DevicesNeoForge.java | 8 +- 331 files changed, 4573 insertions(+), 1285 deletions(-) create mode 100644 common/src/api/java/dev/ultreon/devices/api/IO.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/Bios.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/BiosCallType.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/BiosInterruptType.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferCall.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferInfo.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/InterruptData.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/InterruptHandler.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Executable.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Handle.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/VEFI_VideoSize.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceID.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceInfo.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DiskInfo.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DriveType.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_File.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_FileInfo.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_IconType.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_Notification.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_System.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/boot/BootSector.java rename common/src/{main => api}/java/dev/ultreon/devices/api/device/AudioDevice.java (100%) rename common/src/{main => api}/java/dev/ultreon/devices/api/device/Device.java (100%) create mode 100644 common/src/api/java/dev/ultreon/devices/api/device/Drive.java create mode 100644 common/src/api/java/dev/ultreon/devices/api/device/HardwareDevice.java rename common/src/{main => api}/java/dev/ultreon/devices/api/device/MousePointer.java (100%) create mode 100644 common/src/api/java/dev/ultreon/devices/api/device/VEFI_Disk.java delete mode 100644 common/src/main/java/dev/ultreon/devices/api/app/SystemAccessor.java delete mode 100644 common/src/main/java/dev/ultreon/devices/api/video/CustomResolution.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/ApplicationManager.java (96%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/ApplicationSupplier.java (71%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/DebugLog.java (87%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/Logger.java (95%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/SystemException.java (91%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/TrayItemAdder.java (78%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/WorldSavedData.java (80%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/IIcon.java (97%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/Button.java (97%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/ButtonToggle.java (97%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/CheckBox.java (95%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/ComboBox.java (93%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/Image.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/Inventory.java (94%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/ItemList.java (96%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/Label.java (95%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/NumberSelector.java (96%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/ProgressBar.java (94%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/RadioGroup.java (94%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/Slider.java (94%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/Spinner.java (92%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/Text.java (97%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/TextArea.java (99%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/component/TextField.java (93%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/interfaces/IHighlight.java (76%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/listener/ChangeListener.java (87%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/listener/ClickListener.java (87%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/listener/InitListener.java (84%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/listener/ItemClickListener.java (88%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/listener/KeyListener.java (74%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/listener/ReleaseListener.java (81%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/listener/SlideListener.java (77%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/renderer/ItemRenderer.java (86%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/app/renderer/ListItemRenderer.java (90%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/AlreadyClosedException.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/Bios.java (76%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/BiosInterrupt.java (69%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/BiosNotification.java (56%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/DataDevice.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/Disk.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/DisplayDevice.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/DoubleFaultInterrupt.java (82%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/ExecMeta.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/Executable.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/ExecutableResource.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/FaultInterrupt.java (74%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/Font.java (87%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/FrameBufferTexture.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/InterruptData.java (73%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/IsolatedClassLoader.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/NullPtr.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/PartitionEntry.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/PartitionTable.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/bios/PowerModeInterrupt.java (83%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/PredefinedResolution.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/UserspaceClassLoader.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_FileContext.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/VideoMode.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/bios/VirtualDisk.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/device/HostDevice.java create mode 100644 common/src/main/java/dev/ultreon/devices/impl/device/PhysicalHardwareDevice.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/event/LaptopEvent.java (70%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/io/Drive.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/io/File.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/io/Folder.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/io/MimeType.java (96%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/os/OSScreen.java (87%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/print/IPrint.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/print/PrintingManager.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/storage/DataStorage.java (92%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/storage/FileHandle.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/task/Callback.java (94%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/task/Task.java (99%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/task/TaskManager.java (97%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/util/Color.java (98%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/util/GuiHelper.java (91%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/util/ImageLoader.java (72%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/util/ImageSource.java (88%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/util/Vulnerability.java (92%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/utils/BankUtil.java (89%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/utils/OnlineRequest.java (99%) rename common/src/main/java/dev/ultreon/devices/{api => impl}/utils/RenderUtil.java (98%) create mode 100644 common/src/main/java/dev/ultreon/devices/impl/video/CustomResolution.java rename common/src/main/java/dev/ultreon/devices/{api => impl}/video/VideoInfo.java (80%) delete mode 100644 common/src/main/java/dev/ultreon/devices/mineos/DriverManager.java delete mode 100644 common/src/main/java/dev/ultreon/devices/mineos/MineOSSystem.java delete mode 100644 common/src/main/java/dev/ultreon/devices/mineos/client/MineOSKernel.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/AppClassLoader.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/BootLoader.java rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/DestFactor.java (77%) create mode 100644 common/src/mineos/java/dev/ultreon/mineos/DriverManager.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/DriverManagerImpl.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/Executable.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/MineOSSystem.java rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/SourceFactor.java (78%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/Alphabet.java (97%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/Application.java (98%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/Component.java (97%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/Dialog.java (87%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/Icons.java (98%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/Layout.java (97%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/Notification.java (96%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/ScrollableLayout.java (97%) rename common/src/{main/java/dev/ultreon/devices/api/app => mineos/java/dev/ultreon/mineos/api}/System.java (90%) create mode 100644 common/src/mineos/java/dev/ultreon/mineos/api/SystemAccessor.java rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/BoatRacersApp.java (85%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/IconsApp.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/NoteStashApp.java (96%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/PixelPainterApp.java (94%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/TestApp.java (89%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/auction/AuctionManager.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/auction/MineBayApp.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/auction/object/AuctionItem.java (97%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/auction/task/TaskAddAuction.java (89%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/auction/task/TaskBuyItem.java (80%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/auction/task/TaskGetAuctions.java (87%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/debug/TextAreaApp.java (89%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/EmailApp.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/EmailManager.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/object/Contact.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/object/Email.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/task/TaskCheckEmailAccount.java (85%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/task/TaskDeleteEmail.java (81%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/task/TaskRegisterEmailAccount.java (85%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/task/TaskSendEmail.java (84%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/task/TaskUpdateInbox.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/email/task/TaskViewEmail.java (82%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/example/ExampleApp.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/example/task/TaskNotificationTest.java (84%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/GitWebApp.java (85%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/component/GitWebFrame.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/component/container/AnvilBox.java (88%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/component/container/BrewingBox.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/component/container/ContainerBox.java (94%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/component/container/CraftingBox.java (91%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/component/container/FurnaceBox.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/component/container/LoomBox.java (96%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/layout/ModuleLayout.java (77%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/layout/TextLayout.java (79%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/AnvilModule.java (82%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/AppLinkModule.java (76%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/BannerIIModule.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/BannerModule.java (76%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/BrewingModule.java (84%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/ContainerModule.java (85%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/CraftingModule.java (83%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/DividerModule.java (83%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/DownloadModule.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/FooterModule.java (87%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/FurnaceModule.java (82%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/HeaderModule.java (84%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/LoomModule.java (75%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/Module.java (73%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/ModuleEntry.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/NavigationModule.java (93%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/ParagraphModule.java (87%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/RedirectModule.java (79%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/gitweb/module/ScriptModule.java (93%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/snake/SnakeApp.java (79%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/snake/layout/SnakeLayout.java (97%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/AppStore.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/BankApp.java (94%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/DiagnosticsApp.java (89%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/DisplayResolution.java (87%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/FileBrowserApp.java (74%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/PredefinedResolution.java (89%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/SettingsApp.java (89%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/SystemApp.java (70%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/VulnerabilityApp.java (93%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/component/AppGrid.java (76%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/component/FileBrowser.java (94%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/component/Palette.java (93%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/component/SlideShow.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/layout/LayoutAppPage.java (80%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/layout/LayoutSearchApps.java (84%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/layout/StandardLayout.java (80%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/Account.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/AppEntry.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/ColorScheme.java (99%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/ColorSchemePresetRegistry.java (93%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/ColorSchemePresets.java (96%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/ImageEntry.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/LocalEntry.java (91%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/Preset.java (90%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/object/RemoteEntry.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskAdd.java (81%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskDeposit.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskGetBalance.java (79%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskPay.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskRemove.java (83%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskUpdateApplicationData.java (94%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskUpdateSystemData.java (93%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/system/task/TaskWithdraw.java (88%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon}/mineos/apps/themes/ThemesApp.java (95%) create mode 100644 common/src/mineos/java/dev/ultreon/mineos/impl/DevicePermission.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/impl/Permission.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/kernel/Device.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/kernel/Driver.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/kernel/FrameBuffer.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/kernel/Kern.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/kernel/MineOSKernel.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/kernel/VGADriver.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/kernel/VideoDriver.java rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/AppInfo.java (95%) create mode 100644 common/src/mineos/java/dev/ultreon/mineos/object/ApplicationID.java rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/Canvas.java (94%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/ColorGrid.java (92%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/Game.java (98%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/Picture.java (97%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/Player.java (98%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/TileGrid.java (89%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/Tool.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/TrayItem.java (88%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tiles/Tile.java (95%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tiles/TileBlock.java (91%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tiles/TileCactus.java (86%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tiles/TileEnchantmentTable.java (84%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tiles/TileFlower.java (73%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tiles/TileGrass.java (90%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tiles/TileWheat.java (79%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tools/ToolBucket.java (88%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tools/ToolEraser.java (71%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tools/ToolEyeDropper.java (71%) rename common/src/{main/java/dev/ultreon/devices => mineos/java/dev/ultreon/mineos}/object/tools/ToolPencil.java (74%) create mode 100644 common/src/mineos/java/dev/ultreon/mineos/userspace/Font.java create mode 100644 common/src/mineos/java/dev/ultreon/mineos/userspace/GuiGraphics.java rename common/src/{main/java/dev/ultreon/devices/mineos/client => mineos/java/dev/ultreon/mineos/userspace}/MineOS.java (87%) rename common/src/{main/java/dev/ultreon/devices/mineos/client => mineos/java/dev/ultreon/mineos/userspace}/Settings.java (85%) rename common/src/{main/java/dev/ultreon/devices/mineos/client => mineos/java/dev/ultreon/mineos/userspace}/TaskBar.java (92%) rename common/src/{main/java/dev/ultreon/devices/mineos/client => mineos/java/dev/ultreon/mineos/userspace}/Window.java (97%) rename fabric-datagen-helper/src/main/java/{com => dev}/jab125/clientint/ClientInit.java (99%) rename fabric-datagen-helper/src/main/java/{com => dev}/jab125/clientint/mixin/LanguageManagerAccessor.java (91%) rename fabric-testmod/src/main/java/{com => dev}/jab125/testmod/ClientInit.java (86%) rename fabric-testmod/src/main/java/{com => dev}/jab125/testmod/TestApp.java (75%) diff --git a/common/build.gradle b/common/build.gradle index 2166329cd..8a34ccd86 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -3,6 +3,41 @@ architectury { common platforms.split(",") } +sourceSets { + api { + java { + srcDirs += [ + "src/api/java" + ] + } + } + + mineos { + java { + srcDirs += [ + "src/mineos/java" + ] + } + + runtimeClasspath += sourceSets.api.output + compileClasspath += sourceSets.api.output + } + + main { + resources { + srcDirs += [ + "src/main/generated/resources" + ] + } + + runtimeClasspath += sourceSets.api.output + compileClasspath += sourceSets.api.output + + runtimeClasspath += sourceSets.mineos.output + compileClasspath += sourceSets.mineos.output + } +} + loom { accessWidenerPath = file "src/main/resources/devices.accesswidener" } @@ -12,25 +47,27 @@ repositories { } dependencies { + apiImplementation 'org.jetbrains:annotations:24.0.0' + mineosImplementation 'org.jetbrains:annotations:24.0.0' + mineosImplementation "org.apache.commons:commons-compress:1.26.1" + // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies // Do NOT use other classes from fabric loader modImplementation "net.fabricmc:fabric-loader:$fabric_loader_version" // Remove the next line if you don't want to depend on the API modApi "dev.architectury:architectury:$architectury_version" - implementation("io.github.ultreon:ubo:1.3.0") - modApi "fuzs.forgeconfigapiport:forgeconfigapiport-common-neoforgeapi:$forgeconfigapiport_version" implementation project(":api") implementation "org.jetbrains.kotlin:kotlin-reflect:1.7.10" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10" -// modApi "com.ultreon:ultranlang:0.1.0+6" modCompileOnly "fuzs.forgeconfigapiport:forgeconfigapiport-common:8.0.0" modCompileOnly 'com.electronwill.night-config:core:3.6.3' modCompileOnly 'com.electronwill.night-config:toml:3.6.3' + implementation("de.waldheinz:fat32-lib:0.6.5") } sourceSets { @@ -44,6 +81,28 @@ sourceSets { } } +jar { + from("LICENSE") { + rename { "${it}_${archivesBaseName}" } + } + + from(sourceSets.api.output) +} + +tasks.register("mineosJar", Jar) { + archiveBaseName = "MineOS" + archiveVersion = "1.0.0" + archiveClassifier = null + + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + + from("LICENSE") { + rename { "${it}_MineOS" } + } + + from(sourceSets.mineos.output) +} + publishing { publications { mavenCommon(MavenPublication) { diff --git a/common/src/api/java/dev/ultreon/devices/api/IO.java b/common/src/api/java/dev/ultreon/devices/api/IO.java new file mode 100644 index 000000000..b9221b554 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/IO.java @@ -0,0 +1,177 @@ +package dev.ultreon.devices.api; + +import java.io.EOFException; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +public interface IO { + IO NULL = new IO() { + @Override + public int get(int index) { + return -1; + } + + @Override + public boolean set(int index, int value) { + return false; + } + + @Override + public long size() { + return 0; + } + }; + + default int read(byte[] buffer, int address, int length) throws EOFException { + for (int i = 0; i < length; i++) { + int aByte = get(address + i); + if (aByte == -1) throw new EOFException("End of device reached"); + buffer[i] = (byte) aByte; + } + return length; + } + + default void write(byte[] buffer, int address, int length) throws EOFException { + for (int i = 0; i < length; i++) { + if (!set(address + i, buffer[i])) { + throw new EOFException("End of device reached"); + } + } + } + + int get(int index); + + default byte getByte(int index) throws IOException { + if (index < 0) { + throw new IOException("Index out of bounds"); + } + + int b = get(index); + if (b == -1) { + throw new EOFException("End of device reached"); + } + return (byte) b; + } + default short getShort(int index) throws IOException { + byte b1 = getByte(index); + byte b2 = getByte(index + 1); + return (short) ((b1 << 8) | (b2 & 0xFF)); + } + default int getInt(int index) throws IOException { + byte b1 = getByte(index); + byte b2 = getByte(index + 1); + byte b3 = getByte(index + 2); + byte b4 = getByte(index + 3); + return (b1 << 24) | ((b2 & 0xFF) << 16) | ((b3 & 0xFF) << 8) | (b4 & 0xFF); + } + default long getLong(int index) throws IOException { + byte b1 = getByte(index); + byte b2 = getByte(index + 1); + byte b3 = getByte(index + 2); + byte b4 = getByte(index + 3); + byte b5 = getByte(index + 4); + byte b6 = getByte(index + 5); + byte b7 = getByte(index + 6); + byte b8 = getByte(index + 7); + return ((long) b1 << 56) | ((b2 & 0xFFL) << 48) | ((b3 & 0xFFL) << 40) | ((b4 & 0xFFL) << 32) | ((b5 & 0xFFL) << 24) | ((b6 & 0xFFL) << 16) | ((b7 & 0xFFL) << 8) | (b8 & 0xFFL); + } + default float getFloat(int index) throws IOException { + byte b1 = getByte(index); + byte b2 = getByte(index + 1); + byte b3 = getByte(index + 2); + byte b4 = getByte(index + 3); + return Float.intBitsToFloat((b1 << 24) | ((b2 & 0xFF) << 16) | ((b3 & 0xFF) << 8) | (b4 & 0xFF)); + } + default double getDouble(int index) throws IOException { + byte b1 = getByte(index); + byte b2 = getByte(index + 1); + byte b3 = getByte(index + 2); + byte b4 = getByte(index + 3); + byte b5 = getByte(index + 4); + byte b6 = getByte(index + 5); + byte b7 = getByte(index + 6); + byte b8 = getByte(index + 7); + + long l = ((long) b1 << 56) | ((b2 & 0xFFL) << 48) | ((b3 & 0xFFL) << 40) | ((b4 & 0xFFL) << 32) | ((b5 & 0xFFL) << 24) | ((b6 & 0xFFL) << 16) | ((b7 & 0xFFL) << 8) | (b8 & 0xFFL); + return Double.longBitsToDouble(l); + } + default char getChar(int index) throws IOException { + byte b1 = getByte(index); + byte b2 = getByte(index + 1); + return (char) ((b1 << 8) | (b2 & 0xFF)); + } + default String getString(int index) throws IOException { + int length = getInt(index); + byte[] bytes = getBytes(index + 4, length); + return new String(bytes, StandardCharsets.UTF_8); + } + default byte[] getBytes(int index, int length) throws IOException { + byte[] bytes = new byte[length]; + if (read(bytes, index, length) != length) { + throw new EOFException("End of device reached"); + } + return bytes; + } + + boolean set(int index, int value); + + default void setByte(int index, byte value) throws IOException { + if (!set(index, value)) { + throw new EOFException("End of device reached"); + } + } + default void setShort(int index, short value) throws IOException { + setByte(index, (byte) (value >> 8)); + setByte(index + 1, (byte) (value & 0xFF)); + } + default void setInt(int index, int value) throws IOException { + setByte(index, (byte) (value >> 24)); + setByte(index + 1, (byte) ((value >> 16) & 0xFF)); + setByte(index + 2, (byte) ((value >> 8) & 0xFF)); + setByte(index + 3, (byte) (value & 0xFF)); + } + default void setLong(int index, long value) throws IOException { + setByte(index, (byte) (value >> 56)); + setByte(index + 1, (byte) ((value >> 48) & 0xFF)); + setByte(index + 2, (byte) ((value >> 40) & 0xFF)); + setByte(index + 3, (byte) ((value >> 32) & 0xFF)); + setByte(index + 4, (byte) ((value >> 24) & 0xFF)); + setByte(index + 5, (byte) ((value >> 16) & 0xFF)); + setByte(index + 6, (byte) ((value >> 8) & 0xFF)); + setByte(index + 7, (byte) (value & 0xFF)); + } + default void setFloat(int index, float value) throws IOException { + int i = Float.floatToIntBits(value); + setByte(index, (byte) (i >> 24)); + setByte(index + 1, (byte) ((i >> 16) & 0xFF)); + setByte(index + 2, (byte) ((i >> 8) & 0xFF)); + setByte(index + 3, (byte) (i & 0xFF)); + } + default void setDouble(int index, double value) throws IOException { + long l = Double.doubleToLongBits(value); + setByte(index, (byte) (l >> 56)); + setByte(index + 1, (byte) ((l >> 48) & 0xFF)); + setByte(index + 2, (byte) ((l >> 40) & 0xFF)); + setByte(index + 3, (byte) ((l >> 32) & 0xFF)); + setByte(index + 4, (byte) ((l >> 24) & 0xFF)); + setByte(index + 5, (byte) ((l >> 16) & 0xFF)); + setByte(index + 6, (byte) ((l >> 8) & 0xFF)); + setByte(index + 7, (byte) (l & 0xFF)); + } + default void setChar(int index, char value) throws IOException { + setByte(index, (byte) (value >> 8)); + setByte(index + 1, (byte) (value & 0xFF)); + } + default void setString(int index, String value) throws IOException { + byte[] bytes = value.getBytes(StandardCharsets.UTF_8); + setInt(index, bytes.length); + setBytes(index + 4, bytes); + } + default void setBytes(int index, byte[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + setByte(index + i, value[i]); + } + } + + long size(); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/Bios.java b/common/src/api/java/dev/ultreon/devices/api/bios/Bios.java new file mode 100644 index 000000000..a900e75c1 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/Bios.java @@ -0,0 +1,15 @@ +package dev.ultreon.devices.api.bios; + +import dev.ultreon.devices.api.bios.efi.VEFI_System; + +public interface Bios { + void registerInterrupt(BiosInterruptType interrupt, InterruptHandler handler); + + Object call(BiosCallType call, Object[] args); + + void enableInterrupts(); + + void disableInterrupts(); + + VEFI_System getVEFISystem(); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/BiosCallType.java b/common/src/api/java/dev/ultreon/devices/api/bios/BiosCallType.java new file mode 100644 index 000000000..ec7f08df2 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/BiosCallType.java @@ -0,0 +1,47 @@ +package dev.ultreon.devices.api.bios; + +import dev.ultreon.devices.api.bios.efi.*; + +public enum BiosCallType { + POWER_OFF(void.class), + REBOOT(void.class), + ENTER_SLEEP(void.class), + EXIT_SLEEP(void.class), + + REBOOT_TO_FIRMWARE(void.class), + + GET_DEVICE_ID(void.class), + GET_RUNNING_OS(String.class), + GET_MAIN_DRIVE(VEFI_DiskInfo.class), + SET_MAIN_DRIVE(void.class, VEFI_DiskInfo.class), + ADD_SYSTEM(void.class, VEFI_File.class), + SEND_NOTIFICATION(VEFI_Notification.class), + GET_DEVICE_INFO(VEFI_DeviceInfo.class), + + GET_VIDEO_INFO(VEFI_VideoSize.class), + OPEN_DISPLAY(int.class), + CLOSE_DISPLAY(void.class), + GET_BOOT_DEVICE_ID(VEFI_DeviceID.class), + FRAMEBUFFER_CALL(FrameBufferCall.class), + ENTER_USERSPACE(void.class, String.class, String.class, ClassLoader.class),; + + public final Class returnType; + public final Class[] parameters; + + BiosCallType(Class returnType) { + this(returnType, new Class[0]); + } + + BiosCallType(Class returnType, Class... parameters) { + this.returnType = returnType; + this.parameters = parameters; + } + + public Class getReturnType() { + return returnType; + } + + public Class[] getParameters() { + return parameters; + } +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/BiosInterruptType.java b/common/src/api/java/dev/ultreon/devices/api/bios/BiosInterruptType.java new file mode 100644 index 000000000..d6a9e4f86 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/BiosInterruptType.java @@ -0,0 +1,11 @@ +package dev.ultreon.devices.api.bios; + +public enum BiosInterruptType { + DOUBLE_FAULT, + FAULT, + POWER_BUTTON, + KEYBOARD, + MOUSE, + IO_ERROR, + FRAMEBUFFER_INTERRUPT, +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferCall.java b/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferCall.java new file mode 100644 index 000000000..de6ac082b --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferCall.java @@ -0,0 +1,36 @@ +package dev.ultreon.devices.api.bios; + +import java.nio.ByteBuffer; + +public enum FrameBufferCall { + GET_INFO(FrameBufferInfo.class), // -> FrameBufferInfo + READ_PIXELS(void.class, ByteBuffer.class, int.class, int.class, int.class, int.class), // buffer, x, y, width, height -> void + READ_PIXEL(int.class, short.class, short.class), // x, y -> color + WRITE_PIXEL(void.class, short.class, short.class, int.class), // x, y, color -> void + + FILL_RECT(void.class, int.class, int.class, int.class, int.class, int.class), // x, y, width, height, color -> void + DRAW_RECT(void.class, int.class, int.class, int.class, int.class, int.class), // x, y, width, height, color -> void + DRAW_TEXT(void.class, int.class, int.class, String.class, int.class), // x, y, text, color -> void + DRAW_ITEM(void.class, String.class, int.class, int.class, int.class), // registry-name, count, x, y -> void + DRAW_IMAGE(void.class, String.class, int.class, int.class, int.class, int.class), // registry-name, x, y, width, height -> void + + CLEAR(void.class), + BLIT(void.class, String.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class), // id, x, y, width, height, src-x, src-y, src-width, src-height, tex-width, tex-height -> void + ; + + private final Class returnType; + private final Class[] parameters; + + FrameBufferCall(Class returnType, Class... parameters) { + this.returnType = returnType; + this.parameters = parameters; + } + + public Class getReturnType() { + return returnType; + } + + public Class[] getParameters() { + return parameters; + } +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferInfo.java b/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferInfo.java new file mode 100644 index 000000000..ecbccaa6a --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/FrameBufferInfo.java @@ -0,0 +1,8 @@ +package dev.ultreon.devices.api.bios; + +public record FrameBufferInfo( + int width, + int height, + int bpp +) { +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/InterruptData.java b/common/src/api/java/dev/ultreon/devices/api/bios/InterruptData.java new file mode 100644 index 000000000..1e5b16737 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/InterruptData.java @@ -0,0 +1,7 @@ +package dev.ultreon.devices.api.bios; + +public interface InterruptData { + T getField(String name); + + void setField(String name, Object value); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/InterruptHandler.java b/common/src/api/java/dev/ultreon/devices/api/bios/InterruptHandler.java new file mode 100644 index 000000000..0b6025a79 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/InterruptHandler.java @@ -0,0 +1,6 @@ +package dev.ultreon.devices.api.bios; + +@FunctionalInterface +public interface InterruptHandler { + void onInterrupt(InterruptData interrupt); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Executable.java b/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Executable.java new file mode 100644 index 000000000..eaea3d6f0 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Executable.java @@ -0,0 +1,7 @@ +package dev.ultreon.devices.api.bios; + +import dev.ultreon.devices.api.bios.efi.VEFI_System; + +public interface VEFI_Executable { + void execute(Bios bios, VEFI_System system); +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Handle.java b/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Handle.java new file mode 100644 index 000000000..37a3f30c4 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_Handle.java @@ -0,0 +1,6 @@ +package dev.ultreon.devices.api.bios; + +public record VEFI_Handle( + int handle +) { +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_VideoSize.java b/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_VideoSize.java new file mode 100644 index 000000000..40f45430a --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/VEFI_VideoSize.java @@ -0,0 +1,8 @@ +package dev.ultreon.devices.api.bios; + +public record VEFI_VideoSize( + int width, + int height +) { + +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceID.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceID.java new file mode 100644 index 000000000..6de84b5e1 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceID.java @@ -0,0 +1,7 @@ +package dev.ultreon.devices.api.bios.efi; + +import java.util.UUID; + +public record VEFI_DeviceID(UUID id, boolean isDrive) { + +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceInfo.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceInfo.java new file mode 100644 index 000000000..2338d225c --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DeviceInfo.java @@ -0,0 +1,5 @@ +package dev.ultreon.devices.api.bios.efi; + +public record VEFI_DeviceInfo(VEFI_DeviceID[] ids) { + +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DiskInfo.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DiskInfo.java new file mode 100644 index 000000000..9602fe9fa --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DiskInfo.java @@ -0,0 +1,7 @@ +package dev.ultreon.devices.api.bios.efi; + +public record VEFI_DiskInfo(VEFI_DeviceID deviceID, VEFI_DriveType driveType) { + public VEFI_DiskInfo(VEFI_DeviceID deviceID, byte b) { + this(deviceID, VEFI_DriveType.values()[b]); + } +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DriveType.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DriveType.java new file mode 100644 index 000000000..53b06e28d --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_DriveType.java @@ -0,0 +1,8 @@ +package dev.ultreon.devices.api.bios.efi; + +public enum VEFI_DriveType { + HDD, + SSD, + FLASH_DRIVE, + OTHER +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_File.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_File.java new file mode 100644 index 000000000..dd2e3bb88 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_File.java @@ -0,0 +1,5 @@ +package dev.ultreon.devices.api.bios.efi; + +public record VEFI_File(int handle) { + +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_FileInfo.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_FileInfo.java new file mode 100644 index 000000000..9a585b8be --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_FileInfo.java @@ -0,0 +1,5 @@ +package dev.ultreon.devices.api.bios.efi; + +public record VEFI_FileInfo(VEFI_DeviceID id, String path) { + +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_IconType.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_IconType.java new file mode 100644 index 000000000..1881eaf7f --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_IconType.java @@ -0,0 +1,9 @@ +package dev.ultreon.devices.api.bios.efi; + +public enum VEFI_IconType { + VEFI_Error, + VEFI_Info, + VEFI_Warning, + VEFI_Success, + VEFI_Unknown +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_Notification.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_Notification.java new file mode 100644 index 000000000..79fb785e7 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_Notification.java @@ -0,0 +1,4 @@ +package dev.ultreon.devices.api.bios.efi; + +public record VEFI_Notification(VEFI_IconType type, String header, String message) { +} diff --git a/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_System.java b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_System.java new file mode 100644 index 000000000..484417529 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/bios/efi/VEFI_System.java @@ -0,0 +1,84 @@ +package dev.ultreon.devices.api.bios.efi; + +import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.api.device.VEFI_Disk; +import org.intellij.lang.annotations.Language; + +import java.io.IOException; + +public interface VEFI_System { + int F_READ = 0; + int F_WRITE = 1; + int F_EXEC = 2; + + VEFI_DeviceInfo getDevices(); + + VEFI_DiskInfo[] getDriveList() throws IOException; + + void sendNotification(VEFI_Notification notification); + + void writePortB(VEFI_DeviceID id, int index, byte value) throws IOException; + void writePortS(VEFI_DeviceID id, int index, short value) throws IOException; + void writePortI(VEFI_DeviceID id, int index, int value) throws IOException; + void writePortL(VEFI_DeviceID id, int index, long value) throws IOException; + void writePortF(VEFI_DeviceID id, int index, float value) throws IOException; + void writePortD(VEFI_DeviceID id, int index, double value) throws IOException; + void writePortC(VEFI_DeviceID id, int index, char value) throws IOException; + void writePortZ(VEFI_DeviceID id, int index, boolean value) throws IOException; + void writePortT(VEFI_DeviceID id, int index, String value) throws IOException; + + void writePortBv(VEFI_DeviceID id, int index, byte[] value) throws IOException; + void writePortSv(VEFI_DeviceID id, int index, short[] value) throws IOException; + void writePortIv(VEFI_DeviceID id, int index, int[] value) throws IOException; + void writePortLv(VEFI_DeviceID id, int index, long[] value) throws IOException; + void writePortFv(VEFI_DeviceID id, int index, float[] value) throws IOException; + void writePortDv(VEFI_DeviceID id, int index, double[] value) throws IOException; + void writePortCv(VEFI_DeviceID id, int index, char[] value) throws IOException; + void writePortZv(VEFI_DeviceID id, int index, boolean[] value) throws IOException; + void writePortTv(VEFI_DeviceID id, int index, String[] value) throws IOException; + + byte readPortB(VEFI_DeviceID id, int index) throws IOException; + short readPortS(VEFI_DeviceID id, int index) throws IOException; + int readPortI(VEFI_DeviceID id, int index) throws IOException; + long readPortL(VEFI_DeviceID id, int index) throws IOException; + float readPortF(VEFI_DeviceID id, int index) throws IOException; + double readPortD(VEFI_DeviceID id, int index) throws IOException; + char readPortC(VEFI_DeviceID id, int index) throws IOException; + boolean readPortZ(VEFI_DeviceID id, int index) throws IOException; + String readPortT(VEFI_DeviceID id, int index) throws IOException; + + byte[] readPortBv(VEFI_DeviceID id, int index, int length) throws IOException; + short[] readPortSv(VEFI_DeviceID id, int index, int length) throws IOException; + int[] readPortIv(VEFI_DeviceID id, int index, int length) throws IOException; + long[] readPortLv(VEFI_DeviceID id, int index, int length) throws IOException; + float[] readPortFv(VEFI_DeviceID id, int index, int length) throws IOException; + double[] readPortDv(VEFI_DeviceID id, int index, int length) throws IOException; + char[] readPortCv(VEFI_DeviceID id, int index, int length) throws IOException; + boolean[] readPortZv(VEFI_DeviceID id, int index, int length) throws IOException; + String[] readPortTv(VEFI_DeviceID id, int index, int length) throws IOException; + + void writePortB(VEFI_DeviceID id, int index, byte value, int mask) throws IOException; + void writePortS(VEFI_DeviceID id, int index, short value, int mask) throws IOException; + void writePortI(VEFI_DeviceID id, int index, int value, int mask) throws IOException; + void writePortL(VEFI_DeviceID id, int index, long value, int mask) throws IOException; + void writePortF(VEFI_DeviceID id, int index, float value, int mask) throws IOException; + void writePortD(VEFI_DeviceID id, int index, double value, int mask) throws IOException; + + VEFI_Disk openDisk(VEFI_DiskInfo info); + + VEFI_File openFile(VEFI_Disk info, String path, int mode); + + void writeFileB(VEFI_File file, byte[] data, int offset, int length); + void writeFileT(VEFI_File file, String data, int offset, int length); + + void readFileB(VEFI_File file, byte[] data, int offset, int length); + void readFileT(VEFI_File file, char[] data, int offset, int length); + + void closeFile(VEFI_File file); + + Bios getBios(); + + Object runIsolated(Class contex, @Language("jvm-class-name") String className, String packageName, Object... args); + + void closeDisk(VEFI_Disk vefiDisk) throws IOException; +} diff --git a/common/src/api/java/dev/ultreon/devices/api/boot/BootSector.java b/common/src/api/java/dev/ultreon/devices/api/boot/BootSector.java new file mode 100644 index 000000000..187df5c60 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/boot/BootSector.java @@ -0,0 +1,7 @@ +package dev.ultreon.devices.api.boot; + +import dev.ultreon.devices.api.bios.Bios; + +public interface BootSector { + void boot(Bios bios); +} diff --git a/common/src/main/java/dev/ultreon/devices/api/device/AudioDevice.java b/common/src/api/java/dev/ultreon/devices/api/device/AudioDevice.java similarity index 100% rename from common/src/main/java/dev/ultreon/devices/api/device/AudioDevice.java rename to common/src/api/java/dev/ultreon/devices/api/device/AudioDevice.java diff --git a/common/src/main/java/dev/ultreon/devices/api/device/Device.java b/common/src/api/java/dev/ultreon/devices/api/device/Device.java similarity index 100% rename from common/src/main/java/dev/ultreon/devices/api/device/Device.java rename to common/src/api/java/dev/ultreon/devices/api/device/Device.java diff --git a/common/src/api/java/dev/ultreon/devices/api/device/Drive.java b/common/src/api/java/dev/ultreon/devices/api/device/Drive.java new file mode 100644 index 000000000..261c79e4f --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/device/Drive.java @@ -0,0 +1,5 @@ +package dev.ultreon.devices.api.device; + +public interface Drive { + +} diff --git a/common/src/api/java/dev/ultreon/devices/api/device/HardwareDevice.java b/common/src/api/java/dev/ultreon/devices/api/device/HardwareDevice.java new file mode 100644 index 000000000..0f5598501 --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/device/HardwareDevice.java @@ -0,0 +1,15 @@ +package dev.ultreon.devices.api.device; + +import dev.ultreon.devices.api.IO; + +public interface HardwareDevice { + void sendSignal(int signal); + + IO io(); + + default boolean isVirtual() { + return !isPhysical(); + } + + boolean isPhysical(); +} diff --git a/common/src/main/java/dev/ultreon/devices/api/device/MousePointer.java b/common/src/api/java/dev/ultreon/devices/api/device/MousePointer.java similarity index 100% rename from common/src/main/java/dev/ultreon/devices/api/device/MousePointer.java rename to common/src/api/java/dev/ultreon/devices/api/device/MousePointer.java diff --git a/common/src/api/java/dev/ultreon/devices/api/device/VEFI_Disk.java b/common/src/api/java/dev/ultreon/devices/api/device/VEFI_Disk.java new file mode 100644 index 000000000..97de9976e --- /dev/null +++ b/common/src/api/java/dev/ultreon/devices/api/device/VEFI_Disk.java @@ -0,0 +1,5 @@ +package dev.ultreon.devices.api.device; + +public record VEFI_Disk(int handle) { + +} diff --git a/common/src/main/java/com/jab125/classloader/api/ClassLoaderApi.java b/common/src/main/java/com/jab125/classloader/api/ClassLoaderApi.java index eff2186f6..8dc138c7c 100644 --- a/common/src/main/java/com/jab125/classloader/api/ClassLoaderApi.java +++ b/common/src/main/java/com/jab125/classloader/api/ClassLoaderApi.java @@ -1,13 +1,8 @@ package com.jab125.classloader.api; import com.jab125.classloader.impl.CustomClassLoader; -import net.fabricmc.loader.api.FabricLoader; -import net.fabricmc.loader.impl.launch.knot.Knot; -import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import java.nio.file.Paths; -import java.util.jar.JarFile; public class ClassLoaderApi { public static ClassLoaderApi INSTANCE = new ClassLoaderApi(); diff --git a/common/src/main/java/dev/ultreon/devices/BuiltinApps.java b/common/src/main/java/dev/ultreon/devices/BuiltinApps.java index f87b5addc..d264b849c 100644 --- a/common/src/main/java/dev/ultreon/devices/BuiltinApps.java +++ b/common/src/main/java/dev/ultreon/devices/BuiltinApps.java @@ -1,16 +1,15 @@ package dev.ultreon.devices; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.mineos.apps.BoatRacersApp; -import dev.ultreon.devices.mineos.apps.NoteStashApp; -import dev.ultreon.devices.mineos.apps.PixelPainterApp; -import dev.ultreon.devices.mineos.apps.auction.MineBayApp; -import dev.ultreon.devices.mineos.apps.email.EmailApp; -import dev.ultreon.devices.mineos.apps.gitweb.GitWebApp; -import dev.ultreon.devices.mineos.apps.snake.SnakeApp; -import dev.ultreon.devices.mineos.apps.system.VulnerabilityApp; -import dev.ultreon.devices.mineos.apps.themes.ThemesApp; -import dev.ultreon.devices.mineos.apps.system.*; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.mineos.apps.BoatRacersApp; +import dev.ultreon.mineos.apps.NoteStashApp; +import dev.ultreon.mineos.apps.PixelPainterApp; +import dev.ultreon.mineos.apps.auction.MineBayApp; +import dev.ultreon.mineos.apps.email.EmailApp; +import dev.ultreon.mineos.apps.gitweb.GitWebApp; +import dev.ultreon.mineos.apps.snake.SnakeApp; +import dev.ultreon.mineos.apps.system.*; +import dev.ultreon.mineos.apps.themes.ThemesApp; import dev.architectury.platform.Platform; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/ClientModEvents.java b/common/src/main/java/dev/ultreon/devices/ClientModEvents.java index 244c17eee..4a454aa95 100644 --- a/common/src/main/java/dev/ultreon/devices/ClientModEvents.java +++ b/common/src/main/java/dev/ultreon/devices/ClientModEvents.java @@ -1,17 +1,17 @@ package dev.ultreon.devices; import com.mojang.blaze3d.platform.NativeImage; -import dev.ultreon.devices.api.ApplicationManager; +import dev.ultreon.devices.impl.ApplicationManager; import dev.ultreon.devices.block.entity.renderer.*; import dev.ultreon.devices.client.RenderRegistry; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.debug.DebugFlags; import dev.ultreon.devices.debug.DebugUtils; import dev.ultreon.devices.debug.DumpType; import dev.ultreon.devices.init.DeviceBlockEntities; import dev.ultreon.devices.init.DeviceBlocks; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.system.object.ColorSchemePresets; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.system.object.ColorSchemePresets; import dev.architectury.platform.Platform; import dev.architectury.registry.ReloadListenerRegistry; import dev.architectury.registry.client.rendering.BlockEntityRendererRegistry; diff --git a/common/src/main/java/dev/ultreon/devices/OperatingSystems.java b/common/src/main/java/dev/ultreon/devices/OperatingSystems.java index 433001ffc..a68cb2ce8 100644 --- a/common/src/main/java/dev/ultreon/devices/OperatingSystems.java +++ b/common/src/main/java/dev/ultreon/devices/OperatingSystems.java @@ -2,7 +2,7 @@ import dev.ultreon.devices.api.os.OperatingSystem; import dev.ultreon.devices.core.BootLoader; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.architectury.registry.registries.RegistrySupplier; import java.util.function.Supplier; diff --git a/common/src/main/java/dev/ultreon/devices/UltreonDevicesMod.java b/common/src/main/java/dev/ultreon/devices/UltreonDevicesMod.java index c47431c60..a477132c6 100644 --- a/common/src/main/java/dev/ultreon/devices/UltreonDevicesMod.java +++ b/common/src/main/java/dev/ultreon/devices/UltreonDevicesMod.java @@ -4,17 +4,16 @@ import com.google.common.collect.ImmutableList; import com.google.gson.*; import com.mojang.serialization.Lifecycle; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.ApplicationSupplier; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.print.PrintingManager; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.util.Vulnerability; -import dev.ultreon.devices.api.utils.OnlineRequest; -import dev.ultreon.devices.mineos.apps.email.task.TaskRegisterEmailAccount; -import dev.ultreon.devices.mineos.apps.email.task.*; -import dev.ultreon.devices.mineos.apps.system.task.TaskAdd; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.ApplicationSupplier; +import dev.ultreon.mineos.api.Application; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.print.PrintingManager; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.util.Vulnerability; +import dev.ultreon.devices.impl.utils.OnlineRequest; +import dev.ultreon.mineos.apps.email.task.*; +import dev.ultreon.mineos.apps.system.task.*; import dev.ultreon.devices.core.BootLoader; import dev.ultreon.devices.core.client.ClientNotification; import dev.ultreon.devices.core.network.task.TaskConnect; @@ -25,22 +24,21 @@ import dev.ultreon.devices.block.PrinterBlock; import dev.ultreon.devices.core.io.task.*; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.mineos.apps.system.task.*; import dev.ultreon.devices.network.PacketHandler; import dev.ultreon.devices.network.task.SyncApplicationPacket; import dev.ultreon.devices.network.task.SyncConfigPacket; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.object.TrayItem; -import dev.ultreon.devices.mineos.apps.IconsApp; -import dev.ultreon.devices.mineos.apps.PixelPainterApp; -import dev.ultreon.devices.mineos.apps.TestApp; -import dev.ultreon.devices.mineos.apps.auction.task.TaskAddAuction; -import dev.ultreon.devices.mineos.apps.auction.task.TaskBuyItem; -import dev.ultreon.devices.mineos.apps.auction.task.TaskGetAuctions; -import dev.ultreon.devices.mineos.apps.debug.TextAreaApp; -import dev.ultreon.devices.mineos.apps.example.ExampleApp; -import dev.ultreon.devices.mineos.apps.example.task.TaskNotificationTest; -import dev.ultreon.devices.mineos.apps.system.SystemApp; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.object.TrayItem; +import dev.ultreon.mineos.apps.IconsApp; +import dev.ultreon.mineos.apps.PixelPainterApp; +import dev.ultreon.mineos.apps.TestApp; +import dev.ultreon.mineos.apps.auction.task.TaskAddAuction; +import dev.ultreon.mineos.apps.auction.task.TaskBuyItem; +import dev.ultreon.mineos.apps.auction.task.TaskGetAuctions; +import dev.ultreon.mineos.apps.debug.TextAreaApp; +import dev.ultreon.mineos.apps.example.ExampleApp; +import dev.ultreon.mineos.apps.example.task.TaskNotificationTest; +import dev.ultreon.mineos.apps.system.SystemApp; import dev.ultreon.devices.util.SiteRegistration; import dev.ultreon.devices.util.VulnerabilityUtil; import dev.architectury.event.EventResult; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/SystemAccessor.java b/common/src/main/java/dev/ultreon/devices/api/app/SystemAccessor.java deleted file mode 100644 index 4068f2f33..000000000 --- a/common/src/main/java/dev/ultreon/devices/api/app/SystemAccessor.java +++ /dev/null @@ -1,7 +0,0 @@ -package dev.ultreon.devices.api.app; - -import dev.ultreon.devices.mineos.MineOSSystem; - -public interface SystemAccessor { - void sendSystem(MineOSSystem system); -} diff --git a/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java b/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java index 8a053ec3d..09db2da6a 100644 --- a/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java +++ b/common/src/main/java/dev/ultreon/devices/api/os/OperatingSystem.java @@ -1,13 +1,14 @@ package dev.ultreon.devices.api.os; +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; import dev.ultreon.devices.client.Display; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.client.gui.screens.Screen; import net.minecraft.nbt.CompoundTag; -import dev.ultreon.devices.api.bios.Bios; import dev.ultreon.devices.api.bios.InterruptData; import net.minecraft.client.gui.GuiGraphics; -import dev.ultreon.devices.api.app.Application; +import dev.ultreon.mineos.api.Application; public interface OperatingSystem { void init(GuiGraphics graphics); @@ -41,4 +42,6 @@ public interface OperatingSystem { void connectDisplay(Display display); void disconnectDisplay(); + + VEFI_DeviceID getDeviceId(); } diff --git a/common/src/main/java/dev/ultreon/devices/api/video/CustomResolution.java b/common/src/main/java/dev/ultreon/devices/api/video/CustomResolution.java deleted file mode 100644 index da24be008..000000000 --- a/common/src/main/java/dev/ultreon/devices/api/video/CustomResolution.java +++ /dev/null @@ -1,6 +0,0 @@ -package dev.ultreon.devices.api.video; - -import dev.ultreon.devices.mineos.apps.system.DisplayResolution; - -public record CustomResolution(int width, int height) implements DisplayResolution { -} diff --git a/common/src/main/java/dev/ultreon/devices/block/ClientLaptopWrapper.java b/common/src/main/java/dev/ultreon/devices/block/ClientLaptopWrapper.java index d502536bd..47c4defda 100644 --- a/common/src/main/java/dev/ultreon/devices/block/ClientLaptopWrapper.java +++ b/common/src/main/java/dev/ultreon/devices/block/ClientLaptopWrapper.java @@ -2,7 +2,6 @@ import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.client.Display; -import dev.ultreon.devices.mineos.client.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Player; @@ -10,7 +9,7 @@ public class ClientLaptopWrapper { public static void execute(Player player, ComputerBlockEntity laptop) { - if (!laptop.isPoweredOn()) { + if (!laptop.isPoweredOff()) { player.displayClientMessage(Component.translatable("message.devices.computer.not_powered"), true); return; } diff --git a/common/src/main/java/dev/ultreon/devices/block/ComputerBlock.java b/common/src/main/java/dev/ultreon/devices/block/ComputerBlock.java index fb72b9ae6..619e33fe1 100644 --- a/common/src/main/java/dev/ultreon/devices/block/ComputerBlock.java +++ b/common/src/main/java/dev/ultreon/devices/block/ComputerBlock.java @@ -59,7 +59,7 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level level, @N if (!laptop.isOpen()) return InteractionResult.PASS; if (!level.isClientSide) return InteractionResult.sidedSuccess(false); - if (!laptop.isPoweredOn()) laptop.powerOn(); + if (laptop.isPoweredOff()) laptop.powerOn(); EnvExecutor.runInEnv(Env.CLIENT, () -> () -> ClientLaptopWrapper.execute(player, laptop)); return InteractionResult.sidedSuccess(true); } diff --git a/common/src/main/java/dev/ultreon/devices/block/PaperBlock.java b/common/src/main/java/dev/ultreon/devices/block/PaperBlock.java index 42b74de58..c7d4800a2 100644 --- a/common/src/main/java/dev/ultreon/devices/block/PaperBlock.java +++ b/common/src/main/java/dev/ultreon/devices/block/PaperBlock.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.block; import com.mojang.serialization.MapCodec; -import dev.ultreon.devices.api.print.IPrint; +import dev.ultreon.devices.impl.print.IPrint; import dev.ultreon.devices.block.entity.PaperBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/common/src/main/java/dev/ultreon/devices/block/entity/ComputerBlockEntity.java b/common/src/main/java/dev/ultreon/devices/block/entity/ComputerBlockEntity.java index 59cdee1ae..00cdb03a7 100644 --- a/common/src/main/java/dev/ultreon/devices/block/entity/ComputerBlockEntity.java +++ b/common/src/main/java/dev/ultreon/devices/block/entity/ComputerBlockEntity.java @@ -5,24 +5,23 @@ import dev.ultreon.devices.core.BiosImpl; import dev.ultreon.devices.core.BootLoader; import dev.ultreon.devices.core.io.FileSystem; -import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.impl.bios.DeviceInfo; +import dev.ultreon.devices.impl.device.HostDevice; import dev.ultreon.devices.util.BlockEntityUtil; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.gui.screens.Screen; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; import net.minecraft.world.item.DyeColor; -import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; +import java.nio.ByteBuffer; import java.util.List; -public abstract class ComputerBlockEntity extends NetworkDeviceBlockEntity.Colored { +public abstract class ComputerBlockEntity extends NetworkDeviceBlockEntity.Colored implements HostDevice { private final List> bootLoaders = Lists.newArrayList(OperatingSystems.MINE_OS.get()); private CompoundTag applicationData = new CompoundTag(); private CompoundTag systemData = new CompoundTag(); @@ -32,6 +31,8 @@ public abstract class ComputerBlockEntity extends NetworkDeviceBlockEntity.Color private boolean poweredOn; private CompoundTag originalData; private BiosImpl bios; + private final DeviceInfo deviceInfo = new DeviceInfo(); + private final ByteBuffer biosData = ByteBuffer.allocate(0x1000); protected ComputerBlockEntity(BlockEntityType type, BlockPos pWorldPosition, BlockState pBlockState) { super(type, pWorldPosition, pBlockState); @@ -154,6 +155,10 @@ public boolean isPoweredOn() { return this.poweredOn; } + public boolean isPoweredOff() { + return !this.poweredOn; + } + public void powerOn() { this.poweredOn = true; setChanged(); @@ -168,8 +173,22 @@ public void powerOn() { } } - private List> getBootLoaders() { - return bootLoaders; + @Override + public void powerOff() { + this.poweredOn = false; + setChanged(); + assert level != null; + BlockEntityUtil.markBlockForUpdate(level, worldPosition); + } + + @Override + public DeviceInfo getDevices() { + return this.deviceInfo; + } + + @Override + public ByteBuffer getBiosData() { + return this.biosData; } public BiosImpl getBios() { diff --git a/common/src/main/java/dev/ultreon/devices/block/entity/PaperBlockEntity.java b/common/src/main/java/dev/ultreon/devices/block/entity/PaperBlockEntity.java index 779a03561..39561bce4 100644 --- a/common/src/main/java/dev/ultreon/devices/block/entity/PaperBlockEntity.java +++ b/common/src/main/java/dev/ultreon/devices/block/entity/PaperBlockEntity.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.block.entity; -import dev.ultreon.devices.api.print.IPrint; +import dev.ultreon.devices.impl.print.IPrint; import dev.ultreon.devices.init.DeviceBlockEntities; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/block/entity/PrinterBlockEntity.java b/common/src/main/java/dev/ultreon/devices/block/entity/PrinterBlockEntity.java index c73408180..ac5680c99 100644 --- a/common/src/main/java/dev/ultreon/devices/block/entity/PrinterBlockEntity.java +++ b/common/src/main/java/dev/ultreon/devices/block/entity/PrinterBlockEntity.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.block.entity; import dev.ultreon.devices.DeviceConfig; -import dev.ultreon.devices.api.print.IPrint; +import dev.ultreon.devices.impl.print.IPrint; import dev.ultreon.devices.init.DeviceBlockEntities; import dev.ultreon.devices.init.DeviceSounds; import net.minecraft.core.BlockPos; diff --git a/common/src/main/java/dev/ultreon/devices/block/entity/renderer/PaperRenderer.java b/common/src/main/java/dev/ultreon/devices/block/entity/renderer/PaperRenderer.java index dad941691..035cc57d4 100644 --- a/common/src/main/java/dev/ultreon/devices/block/entity/renderer/PaperRenderer.java +++ b/common/src/main/java/dev/ultreon/devices/block/entity/renderer/PaperRenderer.java @@ -5,8 +5,8 @@ import net.minecraft.nbt.CompoundTag; import dev.ultreon.devices.DeviceConfig; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.print.PrintingManager; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.print.PrintingManager; import dev.ultreon.devices.block.PaperBlock; import dev.ultreon.devices.block.entity.PaperBlockEntity; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/client/Display.java b/common/src/main/java/dev/ultreon/devices/client/Display.java index 57186177c..6594d7615 100644 --- a/common/src/main/java/dev/ultreon/devices/client/Display.java +++ b/common/src/main/java/dev/ultreon/devices/client/Display.java @@ -7,8 +7,8 @@ import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.api.os.OperatingSystem; import dev.ultreon.devices.core.BiosImpl; -import dev.ultreon.devices.mineos.apps.system.DisplayResolution; -import dev.ultreon.devices.mineos.apps.system.PredefinedResolution; +import dev.ultreon.mineos.apps.system.DisplayResolution; +import dev.ultreon.mineos.apps.system.PredefinedResolution; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import net.minecraft.resources.ResourceLocation; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java b/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java index 58c652ca6..0687a587a 100644 --- a/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java +++ b/common/src/main/java/dev/ultreon/devices/core/BiosImpl.java @@ -1,10 +1,12 @@ package dev.ultreon.devices.core; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.io.Drive; +import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.impl.bios.BiosNotification; +import dev.ultreon.devices.impl.bios.PowerModeInterrupt; +import dev.ultreon.devices.impl.io.Drive; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.core.client.ClientNotification; -import dev.ultreon.devices.api.bios.*; import dev.ultreon.devices.api.os.OperatingSystem; import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; diff --git a/common/src/main/java/dev/ultreon/devices/core/BootLoader.java b/common/src/main/java/dev/ultreon/devices/core/BootLoader.java index 5ea3ba2f2..8b985b652 100644 --- a/common/src/main/java/dev/ultreon/devices/core/BootLoader.java +++ b/common/src/main/java/dev/ultreon/devices/core/BootLoader.java @@ -5,7 +5,6 @@ import dev.ultreon.devices.api.os.OperatingSystem; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.architectury.extensions.injected.InjectedRegistryEntryExtension; -import net.minecraft.client.gui.screens.Screen; import net.minecraft.core.Holder; import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/core/TaskBar.java b/common/src/main/java/dev/ultreon/devices/core/TaskBar.java index b090db78c..c254513d6 100644 --- a/common/src/main/java/dev/ultreon/devices/core/TaskBar.java +++ b/common/src/main/java/dev/ultreon/devices/core/TaskBar.java @@ -2,17 +2,17 @@ import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.TrayItemAdder; -import dev.ultreon.devices.api.event.LaptopEvent; -import dev.ultreon.devices.api.utils.RenderUtil; +import dev.ultreon.devices.impl.TrayItemAdder; +import dev.ultreon.devices.impl.event.LaptopEvent; +import dev.ultreon.devices.impl.utils.RenderUtil; import dev.ultreon.devices.core.network.TrayItemWifi; -import dev.ultreon.devices.api.util.Vulnerability; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.object.TrayItem; -import dev.ultreon.devices.mineos.apps.system.AppStore; -import dev.ultreon.devices.mineos.apps.system.FileBrowserApp; -import dev.ultreon.devices.mineos.apps.system.SettingsApp; +import dev.ultreon.devices.impl.util.Vulnerability; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.object.TrayItem; +import dev.ultreon.mineos.apps.system.AppStore; +import dev.ultreon.mineos.apps.system.FileBrowserApp; +import dev.ultreon.mineos.apps.system.SettingsApp; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; @@ -98,8 +98,8 @@ public void render(GuiGraphics graphics, MineOS laptop, Minecraft mc, int x, int int trayItemsWidth = trayItems.size() * 14; graphics.blit(APP_BAR_GUI, x, y, 1, 18, 0, 0, 1, 18, 256, 256); - graphics.blit(APP_BAR_GUI, x + 1, y, MineOS.getOpened().getScreenWidth() - 36 - trayItemsWidth, 18, 1, 0, 1, 18, 256, 256); - graphics.blit(APP_BAR_GUI, x + MineOS.getOpened().getScreenWidth() - 35 - trayItemsWidth, y, 35 + trayItemsWidth, 18, 2, 0, 1, 18, 256, 256); + graphics.blit(APP_BAR_GUI, x + 1, y, MineOS.get().getScreenWidth() - 36 - trayItemsWidth, 18, 1, 0, 1, 18, 256, 256); + graphics.blit(APP_BAR_GUI, x + MineOS.get().getScreenWidth() - 35 - trayItemsWidth, y, 35 + trayItemsWidth, 18, 2, 0, 1, 18, 256, 256); RenderSystem.disableBlend(); @@ -115,10 +115,10 @@ public void render(GuiGraphics graphics, MineOS laptop, Minecraft mc, int x, int assert mc.level == null || mc.player != null; // assert mc.level != null; //can no longer assume - graphics.drawString(mc.font, timeToString(mc.level != null ? mc.level.getDayTime() : 0), x + MineOS.getOpened().getScreenWidth() - 31, y + 5, Color.WHITE.getRGB(), true); + graphics.drawString(mc.font, timeToString(mc.level != null ? mc.level.getDayTime() : 0), x + MineOS.get().getScreenWidth() - 31, y + 5, Color.WHITE.getRGB(), true); /* Settings App */ - int startX = x + MineOS.getOpened().getScreenWidth() - 48; + int startX = x + MineOS.get().getScreenWidth() - 48; for (int i = 0; i < trayItems.size(); i++) { int posX = startX - (trayItems.size() - 1 - i) * 14; if (isMouseInside(mouseX, mouseY, posX, y + 2, posX + 13, y + 15)) { @@ -151,7 +151,7 @@ public void handleClick(MineOS laptop, int x, int y, int mouseX, int mouseY, int } } - int startX = x + MineOS.getOpened().getScreenWidth() - 48; + int startX = x + MineOS.get().getScreenWidth() - 48; for (int i = 0; i < trayItems.size(); i++) { int posX = startX - (trayItems.size() - 1 - i) * 14; if (isMouseInside(mouseX, mouseY, posX, y + 2, posX + 13, y + 15)) { diff --git a/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java b/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java index f41852168..f87b0c3c9 100644 --- a/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java +++ b/common/src/main/java/dev/ultreon/devices/core/WorldLessBiosImpl.java @@ -1,9 +1,12 @@ package dev.ultreon.devices.core; import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.bios.BiosNotification; -import dev.ultreon.devices.api.bios.PowerModeInterrupt; -import dev.ultreon.devices.api.io.Drive; +import dev.ultreon.devices.api.bios.BiosCallType; +import dev.ultreon.devices.api.bios.BiosInterruptType; +import dev.ultreon.devices.api.bios.InterruptHandler; +import dev.ultreon.devices.impl.bios.BiosNotification; +import dev.ultreon.devices.impl.bios.PowerModeInterrupt; +import dev.ultreon.devices.impl.io.Drive; import dev.ultreon.devices.api.os.OperatingSystem; import dev.ultreon.devices.core.client.ClientNotification; @@ -57,4 +60,34 @@ public void setMainDrive(Drive drive) { public UUID getDeviceId() { return VIRTUAL_ID; } + + @Override + public void registerInterrupt(BiosInterruptType interrupt, InterruptHandler handler) { + + } + + @Override + public void enableInterrupt(BiosInterruptType interrupt) { + + } + + @Override + public void disableInterrupt(BiosInterruptType interrupt) { + + } + + @Override + public Object call(BiosCallType call, Object[] args) { + switch (call) { + case POWER_OFF -> { + return powerOff(); + } + case GET_RUNNING_OS -> { + return getRunningOS().getDeviceId(); + } + default -> { + return null; + } + } + } } diff --git a/common/src/main/java/dev/ultreon/devices/core/Wrappable.java b/common/src/main/java/dev/ultreon/devices/core/Wrappable.java index 84f391b69..eff24a465 100644 --- a/common/src/main/java/dev/ultreon/devices/core/Wrappable.java +++ b/common/src/main/java/dev/ultreon/devices/core/Wrappable.java @@ -1,8 +1,8 @@ package dev.ultreon.devices.core; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.client.Window; +import dev.ultreon.mineos.api.Dialog; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.userspace.Window; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java b/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java index 0956ae271..e991d586a 100644 --- a/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java +++ b/common/src/main/java/dev/ultreon/devices/core/client/ClientNotification.java @@ -2,9 +2,12 @@ import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.IIcon; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.api.bios.BiosNotification; +import dev.ultreon.devices.api.bios.efi.VEFI_IconType; +import dev.ultreon.devices.api.bios.efi.VEFI_Notification; +import dev.ultreon.devices.impl.app.IIcon; +import dev.ultreon.mineos.api.Icons; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.devices.impl.bios.BiosNotification; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; @@ -38,6 +41,22 @@ public static ClientNotification of(BiosNotification notification) { return clientNotification; } + public static ClientNotification of(VEFI_Notification notification) { + ClientNotification clientNotification = new ClientNotification(); + VEFI_IconType type = notification.type(); + switch (type) { + case VEFI_Info -> clientNotification.icon = Icons.INFO; + case VEFI_Warning -> clientNotification.icon = Icons.WARNING; + case VEFI_Error -> clientNotification.icon = Icons.ERROR; + case VEFI_Success -> clientNotification.icon = Icons.HEART_ON; + default -> throw new IllegalStateException("Unexpected value: " + type); + } + + clientNotification.title = notification.header(); + clientNotification.subTitle = notification.message(); + return clientNotification; + } + @NotNull @Override public Visibility render(@NotNull GuiGraphics graphics, ToastComponent toastComponent, long timeSinceLastVisible) { diff --git a/common/src/main/java/dev/ultreon/devices/core/client/debug/ClientAppDebug.java b/common/src/main/java/dev/ultreon/devices/core/client/debug/ClientAppDebug.java index 13b345a4c..d407f9565 100644 --- a/common/src/main/java/dev/ultreon/devices/core/client/debug/ClientAppDebug.java +++ b/common/src/main/java/dev/ultreon/devices/core/client/debug/ClientAppDebug.java @@ -3,7 +3,7 @@ import dev.ultreon.devices.DeviceConfig; import dev.ultreon.devices.block.entity.LaptopBlockEntity; import dev.ultreon.devices.core.WorldLessBiosImpl; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.laptop.client.ClientLaptop; import dev.ultreon.devices.core.laptop.client.ClientLaptopScreen; import dev.ultreon.devices.core.laptop.server.ServerLaptop; diff --git a/common/src/main/java/dev/ultreon/devices/core/io/FileSystem.java b/common/src/main/java/dev/ultreon/devices/core/io/FileSystem.java index 76b3a9614..19a45bef0 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/FileSystem.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/FileSystem.java @@ -1,14 +1,14 @@ package dev.ultreon.devices.core.io; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.io.Drive; -import dev.ultreon.devices.api.io.Folder; -import dev.ultreon.devices.api.task.Callback; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.task.TaskManager; +import dev.ultreon.mineos.api.Application; +import dev.ultreon.devices.impl.io.Drive; +import dev.ultreon.devices.impl.io.Folder; +import dev.ultreon.devices.impl.task.Callback; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.task.TaskManager; import dev.ultreon.devices.block.entity.ComputerBlockEntity; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.io.action.FileAction; import dev.ultreon.devices.core.io.drive.AbstractDrive; import dev.ultreon.devices.core.io.drive.ExternalDrive; @@ -62,7 +62,7 @@ public FileSystem(ComputerBlockEntity blockEntity, CompoundTag tag) { @Environment(EnvType.CLIENT) public static void sendAction(Drive drive, FileAction action, @Nullable Callback callback) { - if (MineOS.getOpened().getPos() != null) { + if (MineOS.get().getPos() != null) { DebugLog.log("Sending action " + action + " to " + drive); Task task = new TaskSendAction(drive, action); task.setCallback((tag, success) -> { @@ -87,8 +87,8 @@ public static void getApplicationFolder(Application app, Callback callba } } - if (MineOS.getOpened().getMainDrive() == null) { - Task task = new TaskGetMainDrive(MineOS.getOpened().getPos()); + if (MineOS.get().getMainDrive() == null) { + Task task = new TaskGetMainDrive(MineOS.get().getPos()); task.setCallback((tag, success) -> { if (success) { setupApplicationFolder(app, callback); @@ -104,8 +104,8 @@ public static void getApplicationFolder(Application app, Callback callba } private static void setupApplicationFolder(Application app, Callback callback) { - assert MineOS.getOpened().getMainDrive() != null; - Folder folder = MineOS.getOpened().getMainDrive().getFolder(FileSystem.DIR_APPLICATION_DATA); + assert MineOS.get().getMainDrive() != null; + Folder folder = MineOS.get().getMainDrive().getFolder(FileSystem.DIR_APPLICATION_DATA); if (folder != null) { if (folder.hasFolder(app.getInfo().getFormattedId())) { Folder appFolder = folder.getFolder(app.getInfo().getFormattedId()); @@ -113,7 +113,7 @@ private static void setupApplicationFolder(Application app, Callback cal if (appFolder.isSynced()) { callback.execute(appFolder, true); } else { - Task task = new TaskGetFiles(appFolder, MineOS.getOpened().getPos()); + Task task = new TaskGetFiles(appFolder, MineOS.get().getPos()); task.setCallback((tag, success) -> { assert tag != null; if (success && tag.contains("files", Tag.TAG_LIST)) { diff --git a/common/src/main/java/dev/ultreon/devices/core/io/ServerFile.java b/common/src/main/java/dev/ultreon/devices/core/io/ServerFile.java index da08398f7..ed81af9d7 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/ServerFile.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/ServerFile.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.core.io; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.io.MimeType; +import dev.ultreon.mineos.api.Application; +import dev.ultreon.devices.impl.io.MimeType; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/core/io/action/FileAction.java b/common/src/main/java/dev/ultreon/devices/core/io/action/FileAction.java index 66b8c83da..6858245f9 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/action/FileAction.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/action/FileAction.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.core.io.action; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.api.io.Folder; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.devices.impl.io.Folder; import net.minecraft.nbt.CompoundTag; /** diff --git a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetFiles.java b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetFiles.java index 09391df38..07836d094 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetFiles.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetFiles.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.core.io.task; -import dev.ultreon.devices.api.io.Folder; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.io.Folder; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.ServerFile; diff --git a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetMainDrive.java b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetMainDrive.java index 204f49637..16d6a991f 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetMainDrive.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetMainDrive.java @@ -1,11 +1,11 @@ package dev.ultreon.devices.core.io.task; -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.io.Drive; -import dev.ultreon.devices.api.io.Folder; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.bios.Bios; +import dev.ultreon.devices.impl.io.Drive; +import dev.ultreon.devices.impl.io.Folder; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.drive.AbstractDrive; import net.minecraft.client.Minecraft; @@ -68,7 +68,7 @@ public void processResponse(CompoundTag tag) { drive.syncRoot(Folder.fromTag(FileSystem.LAPTOP_DRIVE_NAME, structureTag)); drive.getRoot().validate(); - Bios bios = MineOS.getOpened().getBios(); + Bios bios = MineOS.get().getBios(); if (bios.getMainDrive() == null) { bios.setMainDrive(drive); } diff --git a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetStructure.java b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetStructure.java index f8abf8f61..2e976bb29 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetStructure.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskGetStructure.java @@ -1,8 +1,8 @@ package dev.ultreon.devices.core.io.task; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.io.Drive; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.io.Drive; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.ServerFolder; diff --git a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSendAction.java b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSendAction.java index 912fa319a..1cd0a23f7 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSendAction.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSendAction.java @@ -1,9 +1,9 @@ package dev.ultreon.devices.core.io.task; -import dev.ultreon.devices.api.io.Drive; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.io.Drive; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.action.FileAction; import net.minecraft.core.BlockPos; @@ -31,7 +31,7 @@ public TaskSendAction(Drive drive, FileAction action) { this(); this.uuid = drive.getUUID().toString(); this.action = action; - this.pos = MineOS.getOpened().getPos(); + this.pos = MineOS.get().getPos(); } @Override diff --git a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSetupFileBrowser.java b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSetupFileBrowser.java index f7fbdb478..d75a107ae 100644 --- a/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSetupFileBrowser.java +++ b/common/src/main/java/dev/ultreon/devices/core/io/task/TaskSetupFileBrowser.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.core.io.task; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.drive.AbstractDrive; diff --git a/common/src/main/java/dev/ultreon/devices/core/laptop/common/TaskBar.java b/common/src/main/java/dev/ultreon/devices/core/laptop/common/TaskBar.java index a13c5db9d..0e00112b5 100644 --- a/common/src/main/java/dev/ultreon/devices/core/laptop/common/TaskBar.java +++ b/common/src/main/java/dev/ultreon/devices/core/laptop/common/TaskBar.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.core.laptop.client.ClientLaptop; -import dev.ultreon.devices.mineos.apps.system.object.ColorScheme; +import dev.ultreon.mineos.apps.system.object.ColorScheme; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/core/network/TrayItemWifi.java b/common/src/main/java/dev/ultreon/devices/core/network/TrayItemWifi.java index 720ef0423..21b79823c 100644 --- a/common/src/main/java/dev/ultreon/devices/core/network/TrayItemWifi.java +++ b/common/src/main/java/dev/ultreon/devices/core/network/TrayItemWifi.java @@ -2,20 +2,21 @@ import dev.ultreon.devices.DeviceConfig; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.ItemList; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.utils.RenderUtil; +import dev.ultreon.mineos.api.Icons; +import dev.ultreon.mineos.api.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.ItemList; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.utils.RenderUtil; import dev.ultreon.devices.block.entity.DeviceBlockEntity; import dev.ultreon.devices.block.entity.RouterBlockEntity; import dev.ultreon.devices.core.Device; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.kernel.Kern; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.network.task.TaskConnect; import dev.ultreon.devices.core.network.task.TaskPing; -import dev.ultreon.devices.object.TrayItem; +import dev.ultreon.mineos.object.TrayItem; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.core.BlockPos; @@ -53,7 +54,7 @@ public void render(GuiGraphics graphics, Device device, Minecraft mc, int x, int if (device.getPos() == null) return; - BlockPos laptopPos = MineOS.getOpened().getPos(); + BlockPos laptopPos = MineOS.get().getPos(); assert laptopPos != null; double distance = Math.sqrt(device.getPos().distToCenterSqr(laptopPos.getX() + 0.5, laptopPos.getY() + 0.5, laptopPos.getZ() + 0.5)); if (distance > 20) { @@ -66,7 +67,7 @@ public void render(GuiGraphics graphics, Device device, Minecraft mc, int x, int } }); itemListRouters.sortBy((o1, o2) -> { - BlockPos laptopPos = MineOS.getOpened().getPos(); + BlockPos laptopPos = MineOS.get().getPos(); assert o1.getPos() != null; assert laptopPos != null; double distance1 = Math.sqrt(o1.getPos().distToCenterSqr(laptopPos.getX() + 0.5, laptopPos.getY() + 0.5, laptopPos.getZ() + 0.5)); @@ -80,11 +81,11 @@ public void render(GuiGraphics graphics, Device device, Minecraft mc, int x, int buttonConnect.setClickListener((mouseX, mouseY, mouseButton) -> { if (mouseButton == 0) { if (itemListRouters.getSelectedItem() != null) { - TaskConnect connect = new TaskConnect(MineOS.getOpened().getPos(), itemListRouters.getSelectedItem().getPos()); + TaskConnect connect = new TaskConnect(Kern.get().getPos(), itemListRouters.getSelectedItem().getPos()); connect.setCallback((tag, success) -> { if (success) { item.setIcon(Icons.WIFI_HIGH); - MineOS.getOpened().closeContext(); + MineOS.get().closeContext(); } }); TaskManager.sendTask(connect); @@ -100,11 +101,11 @@ private static List getRouters() { List routers = new ArrayList<>(); Level level = Minecraft.getInstance().level; - if (MineOS.getOpened().isWorldLess()) { + if (MineOS.get().isWorldLess()) { return new ArrayList<>(); } - BlockPos laptopPos = MineOS.getOpened().getPos(); + BlockPos laptopPos = MineOS.get().getPos(); int range = DeviceConfig.SIGNAL_RANGE.get(); for (int y = -range; y < range + 1; y++) { @@ -126,10 +127,10 @@ private static List getRouters() { @Override public void init() { this.setClickListener((mouseX, mouseY, mouseButton) -> { - if (MineOS.getOpened().hasContext()) { - MineOS.getOpened().closeContext(); + if (MineOS.get().hasContext()) { + MineOS.get().closeContext(); } else { - MineOS.getOpened().openContext(createWifiMenu(this), mouseX - 100, mouseY - 100); + MineOS.get().openContext(createWifiMenu(this), mouseX - 100, mouseY - 100); } }); @@ -145,7 +146,7 @@ public void tick() { } private void runPingTask() { - TaskPing task = new TaskPing(MineOS.getOpened().getPos()); + TaskPing task = new TaskPing(MineOS.get().getPos()); task.setCallback((tag, success) -> { if (success) { assert tag != null; diff --git a/common/src/main/java/dev/ultreon/devices/core/network/task/TaskConnect.java b/common/src/main/java/dev/ultreon/devices/core/network/task/TaskConnect.java index 1248dbc1a..9858fc376 100644 --- a/common/src/main/java/dev/ultreon/devices/core/network/task/TaskConnect.java +++ b/common/src/main/java/dev/ultreon/devices/core/network/task/TaskConnect.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.core.network.task; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.NetworkDeviceBlockEntity; import dev.ultreon.devices.block.entity.RouterBlockEntity; import dev.ultreon.devices.core.network.Router; diff --git a/common/src/main/java/dev/ultreon/devices/core/network/task/TaskGetDevices.java b/common/src/main/java/dev/ultreon/devices/core/network/task/TaskGetDevices.java index 9b23b03d7..7cc73e65c 100644 --- a/common/src/main/java/dev/ultreon/devices/core/network/task/TaskGetDevices.java +++ b/common/src/main/java/dev/ultreon/devices/core/network/task/TaskGetDevices.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.core.network.task; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.NetworkDeviceBlockEntity; import dev.ultreon.devices.core.network.NetworkDevice; import dev.ultreon.devices.core.network.Router; diff --git a/common/src/main/java/dev/ultreon/devices/core/network/task/TaskPing.java b/common/src/main/java/dev/ultreon/devices/core/network/task/TaskPing.java index d0318f747..48086324a 100644 --- a/common/src/main/java/dev/ultreon/devices/core/network/task/TaskPing.java +++ b/common/src/main/java/dev/ultreon/devices/core/network/task/TaskPing.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.core.network.task; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.NetworkDeviceBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/core/print/task/TaskPrint.java b/common/src/main/java/dev/ultreon/devices/core/print/task/TaskPrint.java index b18fbe6d0..18aff00ff 100644 --- a/common/src/main/java/dev/ultreon/devices/core/print/task/TaskPrint.java +++ b/common/src/main/java/dev/ultreon/devices/core/print/task/TaskPrint.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.core.print.task; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.NetworkDeviceBlockEntity; import dev.ultreon.devices.block.entity.PrinterBlockEntity; import dev.ultreon.devices.core.network.NetworkDevice; diff --git a/common/src/main/java/dev/ultreon/devices/core/task/TaskInstallApp.java b/common/src/main/java/dev/ultreon/devices/core/task/TaskInstallApp.java index 99d0af846..0b1cee44f 100644 --- a/common/src/main/java/dev/ultreon/devices/core/task/TaskInstallApp.java +++ b/common/src/main/java/dev/ultreon/devices/core/task/TaskInstallApp.java @@ -1,10 +1,10 @@ package dev.ultreon.devices.core.task; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; diff --git a/common/src/main/java/dev/ultreon/devices/event/WorldDataHandler.java b/common/src/main/java/dev/ultreon/devices/event/WorldDataHandler.java index 79fb5f926..e47de59c0 100644 --- a/common/src/main/java/dev/ultreon/devices/event/WorldDataHandler.java +++ b/common/src/main/java/dev/ultreon/devices/event/WorldDataHandler.java @@ -1,6 +1,6 @@ package dev.ultreon.devices.event; -import dev.ultreon.devices.api.WorldSavedData; +import dev.ultreon.devices.impl.WorldSavedData; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.NbtAccounter; import net.minecraft.nbt.NbtIo; diff --git a/common/src/main/java/dev/ultreon/devices/gui/GuiButtonClose.java b/common/src/main/java/dev/ultreon/devices/gui/GuiButtonClose.java index 6b90a6db9..f2ef3209a 100644 --- a/common/src/main/java/dev/ultreon/devices/gui/GuiButtonClose.java +++ b/common/src/main/java/dev/ultreon/devices/gui/GuiButtonClose.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.gui; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.mineos.client.Window; +import dev.ultreon.mineos.userspace.Window; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; diff --git a/common/src/main/java/dev/ultreon/devices/api/ApplicationManager.java b/common/src/main/java/dev/ultreon/devices/impl/ApplicationManager.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/api/ApplicationManager.java rename to common/src/main/java/dev/ultreon/devices/impl/ApplicationManager.java index 5bab81dee..f8e58e54b 100644 --- a/common/src/main/java/dev/ultreon/devices/api/ApplicationManager.java +++ b/common/src/main/java/dev/ultreon/devices/impl/ApplicationManager.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.api; +package dev.ultreon.devices.impl; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.api.Application; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.resources.ResourceLocation; import org.slf4j.Marker; import org.slf4j.MarkerFactory; diff --git a/common/src/main/java/dev/ultreon/devices/api/ApplicationSupplier.java b/common/src/main/java/dev/ultreon/devices/impl/ApplicationSupplier.java similarity index 71% rename from common/src/main/java/dev/ultreon/devices/api/ApplicationSupplier.java rename to common/src/main/java/dev/ultreon/devices/impl/ApplicationSupplier.java index 786f5295b..0c619b7c4 100644 --- a/common/src/main/java/dev/ultreon/devices/api/ApplicationSupplier.java +++ b/common/src/main/java/dev/ultreon/devices/impl/ApplicationSupplier.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api; +package dev.ultreon.devices.impl; -import dev.ultreon.devices.api.app.Application; +import dev.ultreon.mineos.api.Application; import java.util.function.Supplier; diff --git a/common/src/main/java/dev/ultreon/devices/api/DebugLog.java b/common/src/main/java/dev/ultreon/devices/impl/DebugLog.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/api/DebugLog.java rename to common/src/main/java/dev/ultreon/devices/impl/DebugLog.java index ccc4c8c3b..e3dd2427f 100644 --- a/common/src/main/java/dev/ultreon/devices/api/DebugLog.java +++ b/common/src/main/java/dev/ultreon/devices/impl/DebugLog.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api; +package dev.ultreon.devices.impl; import dev.ultreon.devices.UltreonDevicesMod; diff --git a/common/src/main/java/dev/ultreon/devices/api/Logger.java b/common/src/main/java/dev/ultreon/devices/impl/Logger.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/api/Logger.java rename to common/src/main/java/dev/ultreon/devices/impl/Logger.java index da8f8dd2e..1f0a90fc2 100644 --- a/common/src/main/java/dev/ultreon/devices/api/Logger.java +++ b/common/src/main/java/dev/ultreon/devices/impl/Logger.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api; +package dev.ultreon.devices.impl; public interface Logger { void debug(String message); diff --git a/common/src/main/java/dev/ultreon/devices/impl/LoggerImpl.java b/common/src/main/java/dev/ultreon/devices/impl/LoggerImpl.java index fb81a0568..591d3963b 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/LoggerImpl.java +++ b/common/src/main/java/dev/ultreon/devices/impl/LoggerImpl.java @@ -1,6 +1,5 @@ package dev.ultreon.devices.impl; -import dev.ultreon.devices.api.Logger; import org.slf4j.LoggerFactory; public class LoggerImpl implements Logger { diff --git a/common/src/main/java/dev/ultreon/devices/api/SystemException.java b/common/src/main/java/dev/ultreon/devices/impl/SystemException.java similarity index 91% rename from common/src/main/java/dev/ultreon/devices/api/SystemException.java rename to common/src/main/java/dev/ultreon/devices/impl/SystemException.java index a61712d69..50b839d70 100644 --- a/common/src/main/java/dev/ultreon/devices/api/SystemException.java +++ b/common/src/main/java/dev/ultreon/devices/impl/SystemException.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api; +package dev.ultreon.devices.impl; public class SystemException extends RuntimeException { public SystemException() { diff --git a/common/src/main/java/dev/ultreon/devices/api/TrayItemAdder.java b/common/src/main/java/dev/ultreon/devices/impl/TrayItemAdder.java similarity index 78% rename from common/src/main/java/dev/ultreon/devices/api/TrayItemAdder.java rename to common/src/main/java/dev/ultreon/devices/impl/TrayItemAdder.java index 64f88ab57..906cd5f3a 100644 --- a/common/src/main/java/dev/ultreon/devices/api/TrayItemAdder.java +++ b/common/src/main/java/dev/ultreon/devices/impl/TrayItemAdder.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api; +package dev.ultreon.devices.impl; -import dev.ultreon.devices.object.TrayItem; +import dev.ultreon.mineos.object.TrayItem; import java.util.List; diff --git a/common/src/main/java/dev/ultreon/devices/api/WorldSavedData.java b/common/src/main/java/dev/ultreon/devices/impl/WorldSavedData.java similarity index 80% rename from common/src/main/java/dev/ultreon/devices/api/WorldSavedData.java rename to common/src/main/java/dev/ultreon/devices/impl/WorldSavedData.java index e1987297e..1e98caa19 100644 --- a/common/src/main/java/dev/ultreon/devices/api/WorldSavedData.java +++ b/common/src/main/java/dev/ultreon/devices/impl/WorldSavedData.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api; +package dev.ultreon.devices.impl; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/IIcon.java b/common/src/main/java/dev/ultreon/devices/impl/app/IIcon.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/IIcon.java rename to common/src/main/java/dev/ultreon/devices/impl/app/IIcon.java index a1d975819..220a5389c 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/IIcon.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/IIcon.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.devices.impl.app; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/Button.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/Button.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/component/Button.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/Button.java index 3daced796..c0c264e9c 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/Button.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/Button.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.IIcon; -import dev.ultreon.devices.api.app.listener.ClickListener; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.devices.impl.app.IIcon; +import dev.ultreon.devices.impl.app.listener.ClickListener; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import dev.ultreon.devices.util.StringUtils; import net.minecraft.ChatFormatting; @@ -214,7 +214,7 @@ public void render(GuiGraphics graphics, MineOS laptop, Minecraft mc, int x, int RenderSystem.setShaderTexture(0, Component.COMPONENTS_GUI); RenderSystem.setShaderColor(1f, 1f, 1f, 1f); - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getButtonColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getButtonColor()); RenderSystem.setShaderColor(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1); this.hovered = GuiHelper.isMouseWithin(mouseX, mouseY, x, y, width, height) && windowActive; @@ -242,7 +242,7 @@ public void render(GuiGraphics graphics, MineOS laptop, Minecraft mc, int x, int RenderSystem.setShaderColor(1f, 1f, 1f, 1f); if (this.hovered) { - graphics.renderOutline(x, y, width, height, MineOS.getOpened().getSettings().getColorScheme().getButtonOutlineColor()); + graphics.renderOutline(x, y, width, height, MineOS.get().getSettings().getColorScheme().getButtonOutlineColor()); } int contentWidth = (iconResource != null ? iconWidth : 0) + getTextWidth(text); diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/ButtonToggle.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/ButtonToggle.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/component/ButtonToggle.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/ButtonToggle.java index ef762129b..b92ecafb7 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/ButtonToggle.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/ButtonToggle.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; -import dev.ultreon.devices.api.app.IIcon; +import dev.ultreon.devices.impl.app.IIcon; import net.minecraft.client.Minecraft; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/CheckBox.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/CheckBox.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/api/app/component/CheckBox.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/CheckBox.java index b9eac3989..c26d1edb0 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/CheckBox.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/CheckBox.java @@ -1,9 +1,9 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.listener.ClickListener; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.devices.impl.app.listener.ClickListener; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/ComboBox.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/ComboBox.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/api/app/component/ComboBox.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/ComboBox.java index 3e2b73c4a..11e016842 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/ComboBox.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/ComboBox.java @@ -1,13 +1,13 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.listener.ChangeListener; -import dev.ultreon.devices.api.app.renderer.ItemRenderer; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.api.Layout; +import dev.ultreon.devices.impl.app.listener.ChangeListener; +import dev.ultreon.devices.impl.app.renderer.ItemRenderer; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -41,7 +41,7 @@ public ComboBox(int left, int top, int width) { @Override public void handleTick() { super.handleTick(); - if (opened && !MineOS.getOpened().hasContext()) { + if (opened && !MineOS.get().hasContext()) { opened = false; } } @@ -115,7 +115,7 @@ public void handleMouseClick(int mouseX, int mouseY, int mouseButton) { if (this.hovered && !this.opened) { this.opened = true; - MineOS.getOpened().openContext(this.layout, xPosition, yPosition + 13); + MineOS.get().openContext(this.layout, xPosition, yPosition + 13); } } @@ -156,7 +156,7 @@ public void setChangeListener(ChangeListener changeListener) { } public void closeContext() { - MineOS.getOpened().closeContext(); + MineOS.get().closeContext(); } public static class List extends ComboBox { @@ -201,7 +201,7 @@ public void init(Layout layout) { if (mouseButton == 0) { selected = t; updateValue(t); - MineOS.getOpened().closeContext(); + MineOS.get().closeContext(); } }); this.layout.addComponent(list); diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/Image.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/Image.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/app/component/Image.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/Image.java index b404efc94..68ce4e050 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/Image.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/Image.java @@ -1,16 +1,16 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.platform.NativeImage; import com.mojang.blaze3d.platform.TextureUtil; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.IIcon; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.utils.OnlineRequest; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.devices.impl.app.IIcon; +import dev.ultreon.mineos.api.Layout; +import dev.ultreon.devices.impl.utils.OnlineRequest; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/Inventory.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/Inventory.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/api/app/component/Inventory.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/Inventory.java index f6d503f32..34fdab648 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/Inventory.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/Inventory.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.listener.ClickListener; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.devices.impl.app.listener.ClickListener; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/ItemList.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/ItemList.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/api/app/component/ItemList.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/ItemList.java index 85a6d4aa5..e4c1660b9 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/ItemList.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/ItemList.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.api.app.component; - -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.listener.ItemClickListener; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.mineos.client.MineOS; +package dev.ultreon.devices.impl.app.component; + +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.api.Icons; +import dev.ultreon.mineos.api.Layout; +import dev.ultreon.devices.impl.app.listener.ItemClickListener; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -33,8 +33,8 @@ public class ItemList extends Component implements Iterable { protected List items = NonNullList.create(); protected ListItemRenderer renderer = null; protected ItemClickListener itemClickListener = null; - protected Button btnUp; - protected Button btnDown; + protected dev.ultreon.devices.impl.app.component.Button btnUp; + protected dev.ultreon.devices.impl.app.component.Button btnDown; protected Layout layoutLoading; protected int textColor = Color.WHITE.getRGB(); protected int backgroundColor = Color.GRAY.getRGB(); @@ -63,7 +63,7 @@ public ItemList(int left, int top, int width, int visibleItems, boolean showAll) @Override public void init(Layout layout) { - btnUp = new Button(left + width - 12, top, Icons.CHEVRON_UP); + btnUp = new dev.ultreon.devices.impl.app.component.Button(left + width - 12, top, Icons.CHEVRON_UP); btnUp.setClickListener((mouseX, mouseY, mouseButton) -> { if (mouseButton == 0) scrollUp(); diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/Label.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/Label.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/api/app/component/Label.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/Label.java index 26dedea4f..c0ea629af 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/Label.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/Label.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/NumberSelector.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/NumberSelector.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/api/app/component/NumberSelector.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/NumberSelector.java index 72440ffb6..0167069e1 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/NumberSelector.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/NumberSelector.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.api.Layout; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/ProgressBar.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/ProgressBar.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/api/app/component/ProgressBar.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/ProgressBar.java index a6ee8521e..0dc5120d8 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/ProgressBar.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/ProgressBar.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/RadioGroup.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/RadioGroup.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/api/app/component/RadioGroup.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/RadioGroup.java index 3ecf91162..3f92ad49a 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/RadioGroup.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/RadioGroup.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import java.util.HashSet; import java.util.Set; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/Slider.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/Slider.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/api/app/component/Slider.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/Slider.java index 90dbdf581..e7ffb98c7 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/Slider.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/Slider.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.listener.ClickListener; -import dev.ultreon.devices.api.app.listener.ReleaseListener; -import dev.ultreon.devices.api.app.listener.SlideListener; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.devices.impl.app.listener.ClickListener; +import dev.ultreon.devices.impl.app.listener.ReleaseListener; +import dev.ultreon.devices.impl.app.listener.SlideListener; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/Spinner.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/Spinner.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/api/app/component/Spinner.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/Spinner.java index 38f4b91d4..7c55847f2 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/Spinner.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/Spinner.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/Text.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/Text.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/component/Text.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/Text.java index 226bded80..a40d87d51 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/Text.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/Text.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/TextArea.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/TextArea.java similarity index 99% rename from common/src/main/java/dev/ultreon/devices/api/app/component/TextArea.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/TextArea.java index d23910e2b..bdf30cc6f 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/TextArea.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/TextArea.java @@ -1,12 +1,12 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.platform.InputConstants; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.interfaces.IHighlight; -import dev.ultreon.devices.api.app.listener.KeyListener; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.devices.impl.app.interfaces.IHighlight; +import dev.ultreon.devices.impl.app.listener.KeyListener; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.debug.DebugLog; import dev.ultreon.devices.util.GLHelper; import dev.ultreon.devices.util.GuiHelper; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/component/TextField.java b/common/src/main/java/dev/ultreon/devices/impl/app/component/TextField.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/api/app/component/TextField.java rename to common/src/main/java/dev/ultreon/devices/impl/app/component/TextField.java index cce2c92cf..ce3acec96 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/component/TextField.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/component/TextField.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.api.app.component; +package dev.ultreon.devices.impl.app.component; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.IIcon; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.IIcon; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/interfaces/IHighlight.java b/common/src/main/java/dev/ultreon/devices/impl/app/interfaces/IHighlight.java similarity index 76% rename from common/src/main/java/dev/ultreon/devices/api/app/interfaces/IHighlight.java rename to common/src/main/java/dev/ultreon/devices/impl/app/interfaces/IHighlight.java index f927358a5..8add06ba5 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/interfaces/IHighlight.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/interfaces/IHighlight.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.interfaces; +package dev.ultreon.devices.impl.app.interfaces; import net.minecraft.ChatFormatting; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/listener/ChangeListener.java b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ChangeListener.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/api/app/listener/ChangeListener.java rename to common/src/main/java/dev/ultreon/devices/impl/app/listener/ChangeListener.java index 66ad0c117..655f07569 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/listener/ChangeListener.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ChangeListener.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.listener; +package dev.ultreon.devices.impl.app.listener; /** * The change listener interface. Used for handling value diff --git a/common/src/main/java/dev/ultreon/devices/api/app/listener/ClickListener.java b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ClickListener.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/api/app/listener/ClickListener.java rename to common/src/main/java/dev/ultreon/devices/impl/app/listener/ClickListener.java index 0d5a0461b..e6381e3e5 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/listener/ClickListener.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ClickListener.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.listener; +package dev.ultreon.devices.impl.app.listener; /** * The click listener interface. Used for handling clicks diff --git a/common/src/main/java/dev/ultreon/devices/api/app/listener/InitListener.java b/common/src/main/java/dev/ultreon/devices/impl/app/listener/InitListener.java similarity index 84% rename from common/src/main/java/dev/ultreon/devices/api/app/listener/InitListener.java rename to common/src/main/java/dev/ultreon/devices/impl/app/listener/InitListener.java index 6acd73fe4..848768890 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/listener/InitListener.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/listener/InitListener.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.listener; +package dev.ultreon.devices.impl.app.listener; /** * The initialization listener interface. Used for running diff --git a/common/src/main/java/dev/ultreon/devices/api/app/listener/ItemClickListener.java b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ItemClickListener.java similarity index 88% rename from common/src/main/java/dev/ultreon/devices/api/app/listener/ItemClickListener.java rename to common/src/main/java/dev/ultreon/devices/impl/app/listener/ItemClickListener.java index 3c6282c80..4ee20174a 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/listener/ItemClickListener.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ItemClickListener.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.listener; +package dev.ultreon.devices.impl.app.listener; /** * The click listener interface. Used for handling clicks diff --git a/common/src/main/java/dev/ultreon/devices/api/app/listener/KeyListener.java b/common/src/main/java/dev/ultreon/devices/impl/app/listener/KeyListener.java similarity index 74% rename from common/src/main/java/dev/ultreon/devices/api/app/listener/KeyListener.java rename to common/src/main/java/dev/ultreon/devices/impl/app/listener/KeyListener.java index 65993845f..b03ed78c5 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/listener/KeyListener.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/listener/KeyListener.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.listener; +package dev.ultreon.devices.impl.app.listener; /** * @author MrCrayfish diff --git a/common/src/main/java/dev/ultreon/devices/api/app/listener/ReleaseListener.java b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ReleaseListener.java similarity index 81% rename from common/src/main/java/dev/ultreon/devices/api/app/listener/ReleaseListener.java rename to common/src/main/java/dev/ultreon/devices/impl/app/listener/ReleaseListener.java index 7527211ca..4d3a5d476 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/listener/ReleaseListener.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/listener/ReleaseListener.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.app.listener; +package dev.ultreon.devices.impl.app.listener; -import dev.ultreon.devices.api.app.Component; +import dev.ultreon.mineos.api.Component; /** * The release listener interface. Used for handling releasing diff --git a/common/src/main/java/dev/ultreon/devices/api/app/listener/SlideListener.java b/common/src/main/java/dev/ultreon/devices/impl/app/listener/SlideListener.java similarity index 77% rename from common/src/main/java/dev/ultreon/devices/api/app/listener/SlideListener.java rename to common/src/main/java/dev/ultreon/devices/impl/app/listener/SlideListener.java index a83c8046b..ea9a0dc20 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/listener/SlideListener.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/listener/SlideListener.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.app.listener; +package dev.ultreon.devices.impl.app.listener; -import dev.ultreon.devices.api.app.component.Slider; +import dev.ultreon.devices.impl.app.component.Slider; /** * The slider listener interface. Used for getting diff --git a/common/src/main/java/dev/ultreon/devices/api/app/renderer/ItemRenderer.java b/common/src/main/java/dev/ultreon/devices/impl/app/renderer/ItemRenderer.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/api/app/renderer/ItemRenderer.java rename to common/src/main/java/dev/ultreon/devices/impl/app/renderer/ItemRenderer.java index a2f5fcc40..32cf8bf2c 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/renderer/ItemRenderer.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/renderer/ItemRenderer.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.renderer; +package dev.ultreon.devices.impl.app.renderer; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/renderer/ListItemRenderer.java b/common/src/main/java/dev/ultreon/devices/impl/app/renderer/ListItemRenderer.java similarity index 90% rename from common/src/main/java/dev/ultreon/devices/api/app/renderer/ListItemRenderer.java rename to common/src/main/java/dev/ultreon/devices/impl/app/renderer/ListItemRenderer.java index 5fe248018..83c62c175 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/renderer/ListItemRenderer.java +++ b/common/src/main/java/dev/ultreon/devices/impl/app/renderer/ListItemRenderer.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app.renderer; +package dev.ultreon.devices.impl.app.renderer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java b/common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java new file mode 100644 index 000000000..e962b7efa --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/AbstractInterruptData.java @@ -0,0 +1,40 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.api.bios.InterruptData; + +import java.lang.reflect.Field; + +public abstract class AbstractInterruptData implements InterruptData { + private final VBios vbios; + + public AbstractInterruptData(VBios vbios) { + this.vbios = vbios; + } + + @Override + @SuppressWarnings("unchecked") + public T getField(String name) { + Class self = this.getClass(); + try { + Field declaredField = self.getDeclaredField(name); + declaredField.setAccessible(true); + return (T) declaredField.get(this); // Oooo spooky + } catch (NoSuchFieldException | IllegalAccessException e) { + return null; + } + } + + @Override + public void setField(String name, Object value) { + Class self = this.getClass(); + try { + Field declaredField = self.getDeclaredField(name); + declaredField.setAccessible(true); + declaredField.set(this, value); + } catch (NoSuchFieldException e) { + return; + } catch (IllegalAccessException e) { + vbios.fault(e); + } + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/AlreadyClosedException.java b/common/src/main/java/dev/ultreon/devices/impl/bios/AlreadyClosedException.java new file mode 100644 index 000000000..c671eb8c2 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/AlreadyClosedException.java @@ -0,0 +1,8 @@ +package dev.ultreon.devices.impl.bios; + +import java.io.IOException; +import java.nio.channels.ClosedChannelException; + +public class AlreadyClosedException extends ClosedChannelException { + +} diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/Bios.java b/common/src/main/java/dev/ultreon/devices/impl/bios/Bios.java similarity index 76% rename from common/src/main/java/dev/ultreon/devices/api/bios/Bios.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/Bios.java index 807b0b042..ebb2bd5d4 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/Bios.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/Bios.java @@ -1,9 +1,8 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; -import dev.ultreon.devices.api.io.Drive; +import dev.ultreon.devices.api.device.Drive; import dev.ultreon.devices.api.os.OperatingSystem; import dev.ultreon.devices.core.BootLoader; -import net.minecraft.client.gui.screens.Screen; import java.util.UUID; diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/BiosInterrupt.java b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterrupt.java similarity index 69% rename from common/src/main/java/dev/ultreon/devices/api/bios/BiosInterrupt.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterrupt.java index a3a53fd2c..c659963e4 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/BiosInterrupt.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterrupt.java @@ -1,6 +1,5 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; public interface BiosInterrupt { void interrupt(T data); - } diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java new file mode 100644 index 000000000..ea26ba6e2 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosInterruptCaller.java @@ -0,0 +1,16 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.api.bios.InterruptData; +import dev.ultreon.devices.api.bios.InterruptHandler; + +public class BiosInterruptCaller { + public InterruptHandler handler; + + public BiosInterruptCaller() { + + } + + public void trigger(InterruptData data) { + handler.onInterrupt(data); + } +} diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/BiosNotification.java b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosNotification.java similarity index 56% rename from common/src/main/java/dev/ultreon/devices/api/bios/BiosNotification.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/BiosNotification.java index e6a85f20a..92f610acb 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/BiosNotification.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/BiosNotification.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; -import dev.ultreon.devices.api.app.IIcon; +import dev.ultreon.devices.impl.app.IIcon; public record BiosNotification( IIcon icon, diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/DataDevice.java b/common/src/main/java/dev/ultreon/devices/impl/bios/DataDevice.java new file mode 100644 index 000000000..e2bad3596 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/DataDevice.java @@ -0,0 +1,5 @@ +package dev.ultreon.devices.impl.bios; + +public interface DataDevice { + +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java b/common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java new file mode 100644 index 000000000..8b283dbd2 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/DeviceInfo.java @@ -0,0 +1,18 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; + +import java.util.ArrayList; +import java.util.List; + +public class DeviceInfo { + public final List deviceList = new ArrayList<>(); + + public VEFI_DeviceID[] createDeviceList() { + return deviceList.toArray(new VEFI_DeviceID[0]); + } + + public VEFI_DeviceID[] createDriveList() { + return deviceList.stream().filter(VEFI_DeviceID::isDrive).toArray(VEFI_DeviceID[]::new); + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/Disk.java b/common/src/main/java/dev/ultreon/devices/impl/bios/Disk.java new file mode 100644 index 000000000..eb29deb0b --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/Disk.java @@ -0,0 +1,9 @@ +package dev.ultreon.devices.impl.bios; + +import de.waldheinz.fs.FileSystem; + +public abstract class Disk { + public static final long EFI_SIGNATURE = 0x545342465449L; + + public abstract FileSystem open(); +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/DisplayDevice.java b/common/src/main/java/dev/ultreon/devices/impl/bios/DisplayDevice.java new file mode 100644 index 000000000..b0a731fbd --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/DisplayDevice.java @@ -0,0 +1,109 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.api.IO; +import dev.ultreon.devices.impl.device.PhysicalHardwareDevice; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.network.chat.Component; + +import java.util.ArrayList; +import java.util.List; + +public class DisplayDevice extends Screen implements PhysicalHardwareDevice { + private static final int SIG_TURN_ON = 0x49; + private static final int SIG_TURN_OFF = 0x4A; + private static final VideoMode[] ALL_ = PredefinedResolution.values(); + private final FrameBuffer frameBuffer; + private boolean enabled; + private final VideoMode[] modes; + private transient int modeSelect = 0; + private final IO io = new IO() { + @Override + public int get(int index) { + return switch (index) { + case 0 -> enabled ? 1 : 0; + case 1 -> modes.length & 0xFF; // short[0] + case 2 -> modes.length >> 8 & 0xFF; // short[1] + default -> 0; + }; + } + + @Override + public boolean set(int index, int value) { + return switch (index) { + case 0 -> { + enabled = value != 0; + yield true; + } + case 1, 2 -> { + if (index == 1) { + modeSelect = (value & 0xFF) | ((modeSelect & 0xFF00)); + } else { + modeSelect = (modeSelect & 0x00FF) | ((value & 0xFF) << 8); + } + yield false; + } + default -> false; + }; + } + + @Override + public long size() { + return 1; + } + }; + + public DisplayDevice(VBios vbios) { + super(Component.literal("VDisplay")); + this.frameBuffer = vbios.getFrameBuffer(); + + int maxWidth = this.width; + int maxHeight = this.height; + + List modes = new ArrayList<>(); + for (VideoMode mode : ALL_) { + if (mode.getHorizontalResolution() <= maxWidth && mode.getVerticalResolution() <= maxHeight) { + modes.add(mode); + } + } + + this.modes = modes.toArray(new VideoMode[0]); + } + + @Override + public void resize(Minecraft minecraft, int width, int height) { + super.resize(minecraft, width, height); + + if (this.frameBuffer != null) { + this.frameBuffer.dispose(); + this.frameBuffer.create(width, height); + } + } + + @Override + public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) { + super.render(guiGraphics, mouseX, mouseY, partialTick); + + AbstractTexture texture = this.frameBuffer.getTexture(); + texture.bind(); + } + + @Override + public void sendSignal(int signal) { + switch (signal) { + case SIG_TURN_ON -> this.enabled = true; + case SIG_TURN_OFF -> this.enabled = false; + } + } + + @Override + public IO io() { + return this.io; + } + + public FrameBuffer getFrameBuffer() { + return frameBuffer; + } +} diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/DoubleFaultInterrupt.java b/common/src/main/java/dev/ultreon/devices/impl/bios/DoubleFaultInterrupt.java similarity index 82% rename from common/src/main/java/dev/ultreon/devices/api/bios/DoubleFaultInterrupt.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/DoubleFaultInterrupt.java index b86e1b8d6..169b8b6e9 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/DoubleFaultInterrupt.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/DoubleFaultInterrupt.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; import java.util.List; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/ExecMeta.java b/common/src/main/java/dev/ultreon/devices/impl/bios/ExecMeta.java new file mode 100644 index 000000000..f9c7fa29f --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/ExecMeta.java @@ -0,0 +1,11 @@ +package dev.ultreon.devices.impl.bios; + +import net.minecraft.resources.ResourceLocation; + +public record ExecMeta( + String name, + String description, + String launcher, + ResourceLocation icon +) { +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/Executable.java b/common/src/main/java/dev/ultreon/devices/impl/bios/Executable.java new file mode 100644 index 000000000..d883a45ec --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/Executable.java @@ -0,0 +1,24 @@ +package dev.ultreon.devices.impl.bios; + +public class Executable { + private final ExecMeta meta; + private final ExecutableResource resource; + + public Executable(ExecMeta meta, ExecutableResource resource) { + this.meta = meta; + this.resource = resource; + } + + public void execute(UserspaceClassLoader classLoader, String[] args) throws Throwable { + Class clazz = classLoader.loadClass(meta.launcher()); + clazz.getDeclaredMethod("main", String[].class).invoke(null, new Object[]{args}); + } + + public ExecMeta getMeta() { + return meta; + } + + public byte[] getClass(String name) throws ClassNotFoundException { + return resource.getClass(name); + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/ExecutableResource.java b/common/src/main/java/dev/ultreon/devices/impl/bios/ExecutableResource.java new file mode 100644 index 000000000..9c25832af --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/ExecutableResource.java @@ -0,0 +1,26 @@ +package dev.ultreon.devices.impl.bios; + +import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; +import org.apache.commons.compress.archivers.zip.ZipFile; + +import java.io.IOError; +import java.io.IOException; +import java.io.InputStream; + +public class ExecutableResource { + private final ZipFile zipFile; + + public ExecutableResource(ZipFile zipFile) { + this.zipFile = zipFile; + } + + byte[] getClass(String name) throws ClassNotFoundException { + ZipArchiveEntry entry = zipFile.getEntry(name.replace('.', '/') + ".class"); + if (entry == null) throw new ClassNotFoundException(name); + try(InputStream inputStream = zipFile.getInputStream(entry)) { + return inputStream.readAllBytes(); + } catch (IOException e) { + throw new IOError(e); + } + } +} diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/FaultInterrupt.java b/common/src/main/java/dev/ultreon/devices/impl/bios/FaultInterrupt.java similarity index 74% rename from common/src/main/java/dev/ultreon/devices/api/bios/FaultInterrupt.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/FaultInterrupt.java index d3f8ad7fe..49a3f48fb 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/FaultInterrupt.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/FaultInterrupt.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; public record FaultInterrupt( Throwable cause, diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/Font.java b/common/src/main/java/dev/ultreon/devices/impl/bios/Font.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/api/bios/Font.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/Font.java index b68c6b500..7e946b2b1 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/Font.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/Font.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java b/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java new file mode 100644 index 000000000..e65a70502 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBuffer.java @@ -0,0 +1,227 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.UltreonDevicesMod; +import dev.ultreon.devices.api.bios.FrameBufferCall; +import dev.ultreon.devices.api.bios.FrameBufferInfo; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL30; + +import java.nio.ByteBuffer; + +public class FrameBuffer { + public static final int RESIZE = 0; + public static final int DISABLE = 1; + public static final int ENABLE = 2; + private GuiGraphics guiGraphics; + private int fboId; + + private int depthBufferId; + private int stencilBufferId; + + int width; + int height; + private AbstractTexture texture; + private ResourceLocation texturePath; + + public FrameBuffer(int width, int height) { + this.width = width; + this.height = height; + } + + public Object call(FrameBufferCall call, Object... data) { + switch (call) { + case GET_INFO -> { + int width = this.width; + int height = width * 9 / 16; + return new FrameBufferInfo(width, height, 32); + } + case READ_PIXELS -> { + ByteBuffer buffer = (ByteBuffer) data[0]; + int x = (int) data[1]; + int y = (int) data[2]; + int width = (int) data[3]; + int height2 = (int) data[4]; + bind(); + GL30.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); + GL30.glReadPixels(x, y, width, height2, GL30.GL_RGBA, GL30.GL_UNSIGNED_BYTE, buffer); + unbind(); + return null; + } + case READ_PIXEL -> { + int x = (int) data[0]; + int y = (int) data[1]; + int[] color = new int[1]; + bind(); + GL30.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); + GL30.glReadPixels(x, y, 1, 1, GL30.GL_RGBA, GL30.GL_UNSIGNED_BYTE, color); + unbind(); + return color[0]; + } + case DRAW_RECT -> { + int x = (int) data[0]; + int y = (int) data[1]; + int width = (int) data[2]; + int height = (int) data[3]; + int color = (int) data[4]; + bind(); + guiGraphics.renderOutline(x, y, x + width, y + height, color); + unbind(); + return null; + } + case FILL_RECT -> { + int x = (int) data[0]; + int y = (int) data[1]; + int width = (int) data[2]; + int height = (int) data[3]; + int color = (int) data[4]; + bind(); + guiGraphics.fill(x, y, x + width, y + height, color); + unbind(); + return null; + } + case DRAW_TEXT -> { + int x = (int) data[0]; + int y = (int) data[1]; + String text = (String) data[2]; + int color = (int) data[3]; + bind(); + guiGraphics.drawString(Minecraft.getInstance().font, text, x, y, color); + unbind(); + return null; + } + case WRITE_PIXEL -> { + int x = (int) data[0]; + int y = (int) data[1]; + int color = (int) data[2]; + bind(); +// GL30.glDrawPixels(x, y, 1, 1, GL30.GL_RGBA, GL30.GL_UNSIGNED_BYTE, color); + // Hehe + unbind(); + return null; + } + case DRAW_ITEM -> { + String registryName = (String) data[0]; + int count = (int) data[1]; + int x = (int) data[2]; + int y = (int) data[3]; + + ResourceLocation resourceLocation = new ResourceLocation(registryName); + Item item = UltreonDevicesMod.REGISTRIES.get().get(BuiltInRegistries.ITEM).get(resourceLocation); + + bind(); + if (item != null) + guiGraphics.renderItem(new ItemStack(item, count), x, y); + unbind(); + + return null; + } + case DRAW_IMAGE -> { + String registryName = (String) data[0]; + int x = (int) data[1]; + int y = (int) data[2]; + + ResourceLocation resourceLocation = new ResourceLocation(registryName); + Item item = BuiltInRegistries.ITEM.get(resourceLocation); + + bind(); + guiGraphics.renderItem(new ItemStack(item), x, y); + unbind(); + + return null; + } + case CLEAR -> { + bind(); + GL11.glClearColor(0, 0, 0, 0); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + unbind(); + return null; + } + case BLIT -> { + String registryName = (String) data[0]; + int x = (int) data[1]; + int y = (int) data[2]; + int width = (int) data[3]; + int height = (int) data[4]; + int srcX = (int) data[5]; + int srcY = (int) data[6]; + int srcWidth = (int) data[7]; + int srcHeight = (int) data[8]; + int texWidth = (int) data[9]; + int texHeight = (int) data[10]; + + ResourceLocation resourceLocation = new ResourceLocation(registryName); + + bind(); + guiGraphics.blit(resourceLocation, x, y, width, height, srcX, srcY, srcWidth, srcHeight, texWidth, texHeight); + unbind(); + return null; + } + + default -> { + return null; + } + } + } + + public void bind() { + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fboId); + } + + public static void unbind() { + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0); + } + + public void dispose() { + GL30.glDeleteFramebuffers(fboId); + GL30.glDeleteRenderbuffers(depthBufferId); + GL30.glDeleteRenderbuffers(stencilBufferId); + + GL11.glDeleteTextures(texture.getId()); + + texture = null; + + Minecraft.getInstance().getTextureManager().release(texturePath); + } + + public GuiGraphics getGuiGraphics() { + return guiGraphics; + } + + public void create(int width, int height) { + this.width = width; + this.height = height; + + this.fboId = GL30.glGenFramebuffers(); + int textureId = GL11.glGenTextures(); + AbstractTexture texture = new FrameBufferTexture(textureId, width, height); + + this.depthBufferId = GL30.glGenRenderbuffers(); + this.stencilBufferId = GL30.glGenRenderbuffers(); + + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fboId); + GL30.glDrawBuffer(GL30.GL_COLOR_ATTACHMENT0); + GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL30.GL_TEXTURE_2D, textureId, 0); + GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, GL30.GL_RENDERBUFFER, depthBufferId); + GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, GL30.GL_STENCIL_ATTACHMENT, GL30.GL_RENDERBUFFER, stencilBufferId); + GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0); + + this.guiGraphics = new GuiGraphics(Minecraft.getInstance(), Minecraft.getInstance().renderBuffers().bufferSource()); + ResourceLocation texturePath = new ResourceLocation("textures/gui/framebuffer_" + System.currentTimeMillis() + ".png"); + + Minecraft.getInstance().getTextureManager().register(texturePath, texture); + this.texturePath = texturePath; + + this.texture = texture; + } + + public AbstractTexture getTexture() { + return texture; + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBufferTexture.java b/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBufferTexture.java new file mode 100644 index 000000000..d9c25daa2 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/FrameBufferTexture.java @@ -0,0 +1,42 @@ +package dev.ultreon.devices.impl.bios; + +import net.minecraft.client.renderer.texture.AbstractTexture; +import net.minecraft.server.packs.resources.ResourceManager; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL30; + +import java.io.IOException; +import java.nio.ByteBuffer; + +public class FrameBufferTexture extends AbstractTexture { + private final int textureId; + + public FrameBufferTexture(int textureId, int width, int height) { + super(); + this.textureId = textureId; + + bind(); + GL30.glTexImage2D(GL30.GL_TEXTURE_2D, 0, GL30.GL_RGBA, width, height, 0, GL30.GL_RGBA, GL30.GL_UNSIGNED_BYTE, (ByteBuffer) null); + GL11.glTexParameteri(GL30.GL_TEXTURE_2D, GL30.GL_TEXTURE_MIN_FILTER, GL30.GL_LINEAR); + GL11.glTexParameteri(GL30.GL_TEXTURE_2D, GL30.GL_TEXTURE_MAG_FILTER, GL30.GL_LINEAR); + GL11.glTexParameteri(GL30.GL_TEXTURE_2D, GL30.GL_TEXTURE_WRAP_S, GL30.GL_CLAMP_TO_EDGE); + GL11.glTexParameteri(GL30.GL_TEXTURE_2D, GL30.GL_TEXTURE_WRAP_T, GL30.GL_CLAMP_TO_EDGE); + + GL11.glBindTexture(GL30.GL_TEXTURE_2D, GL11.GL_NONE); + } + + @Override + public void load(ResourceManager resourceManager) throws IOException { + // No + } + + @Override + public int getId() { + return textureId; + } + + @Override + public void close() { + // No + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java b/common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java new file mode 100644 index 000000000..86cc03fae --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/IOErrorInterrupt.java @@ -0,0 +1,16 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.api.bios.InterruptData; + +import java.io.IOException; + +public class IOErrorInterrupt extends AbstractInterruptData { + public final VEFI_SystemImpl vefiSystem; + public final IOException e; + + public IOErrorInterrupt(VBios bios, VEFI_SystemImpl vefiSystem, IOException e) { + super(bios); + this.vefiSystem = vefiSystem; + this.e = e; + } +} diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/InterruptData.java b/common/src/main/java/dev/ultreon/devices/impl/bios/InterruptData.java similarity index 73% rename from common/src/main/java/dev/ultreon/devices/api/bios/InterruptData.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/InterruptData.java index 1e6aaf2a1..a31e041d6 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/InterruptData.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/InterruptData.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; public sealed interface InterruptData permits DoubleFaultInterrupt, FaultInterrupt, PowerModeInterrupt { diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/IsolatedClassLoader.java b/common/src/main/java/dev/ultreon/devices/impl/bios/IsolatedClassLoader.java new file mode 100644 index 000000000..897ec3659 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/IsolatedClassLoader.java @@ -0,0 +1,46 @@ +package dev.ultreon.devices.impl.bios; + +import java.net.URL; +import java.net.URLClassLoader; + +public class IsolatedClassLoader extends URLClassLoader { + private final ClassLoader parent; + private final String packageName; + + public IsolatedClassLoader(ClassLoader parent, URL url, String packageName) { + super(new URL[]{url}, parent); + this.parent = parent; + this.packageName = packageName; + } + + public String getPackageName() { + return packageName; + } + + @Override + public Class findClass(String name) throws ClassNotFoundException { + if (name.startsWith("dev.ultreon.devices.api.bios.")) { + return parent.loadClass(name); + } + if (name.startsWith(packageName)) { + return super.findClass(name); + } + throw new ClassNotFoundException(name); + } + + @Override + public Class loadClass(String name) throws ClassNotFoundException { + if (name.startsWith("dev.ultreon.devices.api.bios.")) { + return parent.loadClass(name); + } + if (name.startsWith(packageName)) { + return super.loadClass(name); + } + throw new ClassNotFoundException(name); + } + + @Override + protected void addURL(URL url) { + super.addURL(url); + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/NullPtr.java b/common/src/main/java/dev/ultreon/devices/impl/bios/NullPtr.java new file mode 100644 index 000000000..33ef01161 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/NullPtr.java @@ -0,0 +1,9 @@ +package dev.ultreon.devices.impl.bios; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface NullPtr { + +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/PartitionEntry.java b/common/src/main/java/dev/ultreon/devices/impl/bios/PartitionEntry.java new file mode 100644 index 000000000..b7a31ba61 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/PartitionEntry.java @@ -0,0 +1,104 @@ +package dev.ultreon.devices.impl.bios; + +import de.waldheinz.fs.BlockDevice; +import de.waldheinz.fs.ReadOnlyException; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.nio.charset.StandardCharsets; +import java.util.UUID; + +public final class PartitionEntry { + public static final int SIZE = 296; + public long start; + public long end; + public byte type; + public UUID guid; + public String name; + public boolean readOnlyStatus; + + public static PartitionEntry read(BlockDevice device, long offset) throws IOException { + ByteBuffer buffer = ByteBuffer.allocate(32); + device.read(offset, buffer); + + buffer.flip(); + + PartitionEntry partitionEntry = new PartitionEntry(); + partitionEntry.start = offset; + partitionEntry.end = buffer.getInt(); + partitionEntry.type = buffer.get(); + partitionEntry.guid = new UUID(buffer.getLong(), buffer.getLong()); + partitionEntry.name = getString(buffer, 16); + partitionEntry.readOnlyStatus = buffer.get() == 1; + + return partitionEntry; + } + + private static String getString(ByteBuffer buffer, int len) { + byte[] bytes = new byte[len]; + buffer.get(bytes); + return new String(bytes, StandardCharsets.US_ASCII); + } + + public BlockDevice open(BlockDevice parent) { + return new PartitionBlockDevice(this, parent); + } + + private static class PartitionBlockDevice implements BlockDevice { + private final PartitionEntry partitionEntry; + private final BlockDevice parent; + private boolean closed; + + public PartitionBlockDevice(PartitionEntry partitionEntry, BlockDevice parent) { + this.partitionEntry = partitionEntry; + this.parent = parent; + } + + @Override + public long getSize() { + return this.partitionEntry.end - this.partitionEntry.start; + } + + @Override + public void read(long devOffset, ByteBuffer dest) throws IOException { + if (closed) throw new ClosedChannelException(); + if (devOffset > this.getSize()) + throw new IOException("IO address overflow: " + devOffset + " > " + this.getSize()); + this.parent.read(this.partitionEntry.start + devOffset, dest); + } + + @Override + public void write(long devOffset, ByteBuffer src) throws ReadOnlyException, IOException, IllegalArgumentException { + if (closed) throw new ClosedChannelException(); + if (devOffset > this.getSize()) + throw new IOException("IO address overflow: " + devOffset + " > " + this.getSize()); + this.parent.write(this.partitionEntry.start + devOffset, src); + } + + @Override + public void flush() throws IOException { + this.parent.flush(); + } + + @Override + public int getSectorSize() throws IOException { + return this.parent.getSectorSize(); + } + + @Override + public void close() { + this.closed = true; + } + + @Override + public boolean isClosed() { + return closed; + } + + @Override + public boolean isReadOnly() { + return this.parent.isReadOnly() || this.partitionEntry.readOnlyStatus; + } + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/PartitionTable.java b/common/src/main/java/dev/ultreon/devices/impl/bios/PartitionTable.java new file mode 100644 index 000000000..0ed786056 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/PartitionTable.java @@ -0,0 +1,28 @@ +package dev.ultreon.devices.impl.bios; + +import de.waldheinz.fs.BlockDevice; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class PartitionTable { + public static final int MAX_PARTITIONS = 128; + public List entries; + + public PartitionTable(List entries) { + this.entries = entries; + } + + public static PartitionTable load(BlockDevice blockDevice) throws IOException { + long size = blockDevice.getSize(); + + List entries = new ArrayList<>(); + + for (int i = 0; i < MAX_PARTITIONS; i++) { + entries.add(PartitionEntry.read(blockDevice, size - (i + 1) * PartitionEntry.SIZE)); + } + + return new PartitionTable(entries); + } +} diff --git a/common/src/main/java/dev/ultreon/devices/api/bios/PowerModeInterrupt.java b/common/src/main/java/dev/ultreon/devices/impl/bios/PowerModeInterrupt.java similarity index 83% rename from common/src/main/java/dev/ultreon/devices/api/bios/PowerModeInterrupt.java rename to common/src/main/java/dev/ultreon/devices/impl/bios/PowerModeInterrupt.java index 968aa267a..29026d66f 100644 --- a/common/src/main/java/dev/ultreon/devices/api/bios/PowerModeInterrupt.java +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/PowerModeInterrupt.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.bios; +package dev.ultreon.devices.impl.bios; public record PowerModeInterrupt( PowerMode powerMode diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/PredefinedResolution.java b/common/src/main/java/dev/ultreon/devices/impl/bios/PredefinedResolution.java new file mode 100644 index 000000000..911b18477 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/PredefinedResolution.java @@ -0,0 +1,50 @@ +package dev.ultreon.devices.impl.bios; + +public enum PredefinedResolution implements VideoMode { + PREDEFINED_31360x17280(31360, 17280), + PREDEFINED_15680x8640(15680, 8640), + PREDEFINED_7840x4320(7840, 4320), + PREDEFINED_3840x2160(3840, 2160), + PREDEFINED_2560x1440(2560, 1440), + PREDEFINED_1920x1080(1920, 1080), + PREDEFINED_960x540(960, 540), + PREDEFINED_800x450(800, 450), + PREDEFINED_768x432(768, 432), + PREDEFINED_696x360(696, 360), + PREDEFINED_640x360(640, 360), + PREDEFINED_512x288(512, 288), + PREDEFINED_448x256(448, 256), + PREDEFINED_384x216(384, 216); + + private final int width; + private final int height; + + PredefinedResolution(int width, int height) { + this.width = width; + this.height = height; + } + + @Override + public int getHorizontalResolution() { + return width; + } + + @Override + public int getVerticalResolution() { + return height; + } + + @Override + public int getBitsPerPixel() { + return 32; + } + + @Override + public int getRefreshRate() { + return 60; + } + + public String toString() { + return width + "x" + height; + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/UserspaceClassLoader.java b/common/src/main/java/dev/ultreon/devices/impl/bios/UserspaceClassLoader.java new file mode 100644 index 000000000..3c11c556b --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/UserspaceClassLoader.java @@ -0,0 +1,44 @@ +package dev.ultreon.devices.impl.bios; + +import java.io.IOError; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class UserspaceClassLoader extends ClassLoader { + private final IsolatedClassLoader parent; + private final VBios vBios; + private final Executable executable; + + private final Map> classes = new HashMap<>(); + + public UserspaceClassLoader(IsolatedClassLoader parent, VBios vBios, Executable executable) { + this.parent = parent; + this.vBios = vBios; + this.executable = executable; + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + if (name.startsWith("java.awt") || !name.startsWith("java.") && name.startsWith("dev.ultreon.devices.")) { + throw new ClassNotFoundException(name); + } + + if (classes.containsKey(name)) { + return classes.get(name); + } + + if (this.executable == null) { + throw new IOError(new IOException("Executable is null")); + } + + byte[] aClass = this.executable.getClass(name); + if (aClass == null) { + throw new ClassNotFoundException(name); + } + + Class definedClass = defineClass(name, aClass, 0, aClass.length); + classes.put(name, definedClass); + return definedClass; + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java new file mode 100644 index 000000000..71084ea56 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VBios.java @@ -0,0 +1,395 @@ +package dev.ultreon.devices.impl.bios; + +import com.google.gson.Gson; +import de.waldheinz.fs.*; +import de.waldheinz.fs.fat.FatFileSystem; +import dev.ultreon.devices.api.bios.*; +import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.api.bios.InterruptData; +import dev.ultreon.devices.api.bios.efi.VEFI_DiskInfo; +import dev.ultreon.devices.api.bios.efi.VEFI_File; +import dev.ultreon.devices.api.bios.efi.VEFI_System; +import dev.ultreon.devices.api.device.HardwareDevice; +import dev.ultreon.devices.api.device.VEFI_Disk; +import dev.ultreon.devices.impl.device.HostDevice; +import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; +import org.apache.commons.compress.archivers.zip.ZipFile; +import org.apache.commons.io.FileExistsException; +import org.jetbrains.annotations.Nullable; + +import java.io.*; +import java.nio.ByteBuffer; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.SeekableByteChannel; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; + +import static java.lang.Math.min; + +public class VBios implements Bios { + private static final int PB_POWER_OFF = 0x00; + private final BiosInterruptCaller[] interrupts = new BiosInterruptCaller[BiosInterruptType.values().length]; + private final HostDevice hostDevice; + private final VEFI_SystemImpl system; + private int faults = 0; + private UUID bootDeviceId; + private BlockDevice blockDevice; + private VirtVGA graphics; + private FileSystem fileSystem; + private Map virtualDisks = new LinkedHashMap<>(); + private Gson gson = new Gson(); + + public VBios(HostDevice hostDevice) { + this.hostDevice = hostDevice; + for (int i = 0; i < interrupts.length; i++) { + interrupts[i] = new BiosInterruptCaller(); + } + + this.system = new VEFI_SystemImpl(hostDevice.getDevices(), this); + + try { + VEFI_DiskInfo[] driveList = this.system.getDriveList(); + for (VEFI_DiskInfo drive : driveList) { + if (drive.deviceID().isDrive()) { + this.attemptBoot(drive); + } + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private void attemptBoot(VEFI_DiskInfo diskInfo) { + VEFI_Disk vefiDisk = this.system.openDisk(diskInfo); + + if (vefiDisk != null) { + this.bootDeviceId = diskInfo.deviceID().id(); + if (this.virtualDisks.containsKey(this.bootDeviceId)) { + VirtualDisk virtualDisk = this.virtualDisks.get(this.bootDeviceId); + this.fileSystem = virtualDisk; + this.graphics = new VirtVGA(this.hostDevice.getGraphics()); + return; + } + BlockDevice blockDevice = this.system.disks[vefiDisk.handle()].blockDevice(); + try { + PartitionTable partitionTable = PartitionTable.load(blockDevice); + for (PartitionEntry entry : partitionTable.entries) { + this.fileSystem = FatFileSystem.read(entry.open(blockDevice), true); + } + this.graphics = new VirtVGA(this.hostDevice.getGraphics()); + } catch (IOException e) { + try { + this.system.closeDisk(vefiDisk); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + } + } + + @Override + public void registerInterrupt(BiosInterruptType interrupt, InterruptHandler handler) { + this.interrupts[interrupt.ordinal()].handler = handler; + } + + @Override + public Object call(BiosCallType call, Object[] args) { + return switch (call) { + case REBOOT -> { + this.reset(); + yield null; + } + case POWER_OFF -> { + this.powerOff(); + yield null; + } + case ADD_SYSTEM -> { + VEFI_File file = (VEFI_File) args[0]; + int handle = file.handle(); + + VEFI_FileContext fileContext = this.system.getFile(handle); + byte[] data = new byte[32]; + byte[] bytes = fileContext.fileInfo().getBytes(); + ByteBuffer biosData = this.hostDevice.getBiosData(); + biosData.position(0xf00); + byte b = biosData.get(0xeff); + biosData.put(bytes, 0xf00 + b * 32, min(32, bytes.length)); + yield null; + } + case GET_BOOT_DEVICE_ID -> this.getBootDeviceId(); + case FRAMEBUFFER_CALL -> { + FrameBufferCall callId = (FrameBufferCall) args[0]; + Object[] data = (Object[]) args[1]; + + yield this.graphics.call(callId, data); + } + case ENTER_USERSPACE -> { + String path = (String) args[0]; + ClassLoader parent = (ClassLoader) args[2]; + this.enterUserspace(parent, Paths.get(path)); + yield null; + } + case ENTER_SLEEP -> { + this.interrupt(BiosInterruptType.FRAMEBUFFER_INTERRUPT, new AbstractInterruptData(this) { + @SuppressWarnings("unused") + public final int type = FrameBuffer.DISABLE; + }); + this.graphics.turnOff(); + this.hostDevice.enterSleep(); + yield null; + } + case EXIT_SLEEP -> { + this.interrupt(BiosInterruptType.FRAMEBUFFER_INTERRUPT, new AbstractInterruptData(this) { + @SuppressWarnings("unused") + public final int type = FrameBuffer.ENABLE; + }); + this.graphics.reset(); + this.hostDevice.exitSleep(); + yield null; + } + default -> null; + }; + } + + private void enterUserspace(ClassLoader parent, Path executable) { + if (!(parent instanceof IsolatedClassLoader isolation)) { + fault(new Exception("Invalid parent classloader")); + return; + } + + try { + Executable exec = readExecutable(this.openFile(executable)); + + UserspaceClassLoader classLoader = new UserspaceClassLoader(isolation, this, exec); + exec.execute(classLoader, new String[0]); + } catch (Throwable e) { + fault(e); + } + } + + private Executable readExecutable(SeekableByteChannel inputStream) { + try { + ZipFile zipFile = new ZipFile(inputStream); + ExecutableResource resource = new ExecutableResource(zipFile); + ZipArchiveEntry entry = zipFile.getEntry(".meta"); + InputStream inputStream1 = zipFile.getInputStream(entry); + ExecMeta execMeta = gson.fromJson(new InputStreamReader(inputStream1), ExecMeta.class); + return new Executable(execMeta, resource); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private SeekableByteChannel openFile(Path executable) throws IOException { + FsFile file = this.getFile(executable); + return new FSFileChannel(file); + } + + private FsFile getFile(Path path) throws IOException { + FsDirectoryEntry root = this.getFsDirectoryEntry(path); + + if (root instanceof FsFile) { + return (FsFile) root; + } + + throw new FileNotFoundException(path.toString()); + } + + private UUID getBootDeviceId() { + return this.bootDeviceId; + } + + private void powerOff() { + this.powerDownImmediately(); + } + + @Override + public void enableInterrupts() { + + } + + @Override + public void disableInterrupts() { + + } + + @Override + public VEFI_System getVEFISystem() { + return this.system; + } + + public void interrupt(BiosInterruptType biosInterruptType, InterruptData data) { + if (biosInterruptType == BiosInterruptType.FAULT) { + if (faults > 10) { + this.reset(); + } + if (faults > 0) { + biosInterruptType = BiosInterruptType.DOUBLE_FAULT; + } + + faults++; + } + + interrupts[biosInterruptType.ordinal()].trigger(data); + } + + private void reset() { + this.powerDownImmediately(); + } + + private void powerDownImmediately() { + this.hostDevice.powerOff(); + } + + public void fault(Throwable e) { + FaultInterrupt faultInterrupt = new FaultInterrupt(this); + faultInterrupt.errorCode = 1; + faultInterrupt.stackTrace = Arrays.stream(e.getStackTrace()).map(Object::toString).collect(Collectors.joining("\n")); + faultInterrupt.cause = e; + this.interrupt(BiosInterruptType.FAULT, faultInterrupt); + } + + public void requestPowerOff() { + this.interrupt(BiosInterruptType.POWER_BUTTON, new AbstractInterruptData(this) { + @SuppressWarnings("unused") + public final int type = PB_POWER_OFF; + }); + } + + public HardwareDevice getPhysicalDevice(UUID id) { + return hostDevice.getPhysicalDevice(id); + } + + public VEFI_SystemImpl getSystem() { + return system; + } + + public FrameBuffer getFrameBuffer() { + return graphics.getFrameBuffer(); + } + + public byte[] getUserspaceClass(String path) throws IOException { + Path file = Paths.get(path); + FsDirectoryEntry current = getFsDirectoryEntry(file); + + if (current instanceof FsFile fsFile) { + ByteBuffer buffer = ByteBuffer.allocate((int) fsFile.getLength()); + fsFile.read(0L, buffer); + buffer.flip(); + + return buffer.array(); + } + throw new FileNotFoundException(path); + } + + private @Nullable FsDirectoryEntry getFsDirectoryEntry(Path file) throws IOException { + FsDirectory root = this.fileSystem.getRoot(); + FsDirectoryEntry current = null; + + StringBuilder curPath = new StringBuilder("/"); + + for (Path p : file) { + String name = p.getFileName().toString(); + if (current == null) { + current = root.getEntry(name); + if (current.isDirectory()) { + curPath.append(name).append("/"); + } else { + curPath.append(name); + } + } else if (current.isDirectory() && current instanceof FsDirectory) { + current = ((FsDirectory) current).getEntry(name); + } else { + throw new FileExistsException(curPath.toString()); + } + if (current == null) { + throw new FileNotFoundException(curPath.toString()); + } + } + return current; + } + + private static class FaultInterrupt extends AbstractInterruptData { + public int errorCode = 0; + public @NullPtr String stackTrace = ""; + public @NullPtr Throwable cause; + + public FaultInterrupt(VBios vbios) { + super(vbios); + } + } + + private static class FSFileChannel implements SeekableByteChannel { + private final FsFile file; + private long position; + private boolean open; + + public FSFileChannel(FsFile file) { + this.file = file; + this.position = 0; + } + + @Override + public void close() throws IOException { + if (this.open) { + this.open = false; + } else { + throw new AlreadyClosedException(); + } + } + + @Override + public int read(ByteBuffer dst) throws IOException { + if (!this.open) throw new ClosedChannelException(); + long endOff = this.position + dst.remaining(); + if (this.position >= this.file.getLength()) return -1; + this.file.read(this.position, dst); + if (endOff > this.file.getLength()) { + this.position = this.file.getLength(); + return (int) (endOff - this.file.getLength()); + } + + this.position = endOff; + return dst.remaining(); + } + + @Override + public int write(ByteBuffer src) throws IOException { + if (!this.open) throw new ClosedChannelException(); + this.file.write(this.position, src); + this.position += src.remaining(); + return src.remaining(); + } + + @Override + public long position() throws IOException { + return this.position; + } + + @Override + public SeekableByteChannel position(long newPosition) throws IOException { + this.position = newPosition; + return this; + } + + @Override + public long size() throws IOException { + return this.file.getLength(); + } + + @Override + public SeekableByteChannel truncate(long size) throws IOException { + throw new IOException("Not supported"); + } + + @Override + public boolean isOpen() { + return open; + } + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java new file mode 100644 index 000000000..967b7fec3 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_DiskHandle.java @@ -0,0 +1,100 @@ +package dev.ultreon.devices.impl.bios; + +import de.waldheinz.fs.BlockDevice; +import dev.ultreon.devices.api.bios.efi.VEFI_File; +import dev.ultreon.devices.api.device.HardwareDevice; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.List; +import java.util.Objects; + +public final class VEFI_DiskHandle { + private final VEFI_SystemImpl system; + private final HardwareDevice hardwareDevice; + private final BlockDevice blockDevice; + private final int handle; + BitSet openFiles = new BitSet(128); + VEFI_File[] files = new VEFI_File[128]; + private BlockDevice bootPartition = null; + + public VEFI_DiskHandle(VEFI_SystemImpl system, HardwareDevice hardwareDevice, BlockDevice blockDevice, int handle) { + this.system = system; + this.hardwareDevice = hardwareDevice; + this.blockDevice = blockDevice; + this.handle = handle; + } + + public BlockDevice blockDevice() { + return blockDevice; + } + + public HardwareDevice hardwareDevice() { + return hardwareDevice; + } + + public int handle() { + return handle; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) return true; + if (obj == null || obj.getClass() != this.getClass()) return false; + var that = (VEFI_DiskHandle) obj; + return Objects.equals(this.hardwareDevice, that.hardwareDevice) && + this.handle == that.handle; + } + + @Override + public int hashCode() { + return Objects.hash(hardwareDevice, handle); + } + + @Override + public String toString() { + return "VEFI_DiskHandle[" + + "hardwareDevice=" + hardwareDevice + ", " + + "handle=" + handle + ']'; + } + + void findBootPartition(PartitionEntry entry) { + this.bootPartition = entry.open(blockDevice); + } + + public BlockDevice getBootPartition() { + return bootPartition; + } + + public void close() throws IOException { + List suppressed = new ArrayList<>(); + for (VEFI_File file : files) { + if (file != null) { + system.closeFile(file); + } + } + + if (bootPartition != null) { + try { + bootPartition.close(); + } catch (Exception e) { + suppressed.add(e); + } + } + + if (blockDevice != null) { + try { + blockDevice.close(); + } catch (Exception e) { + suppressed.add(e); + } + } + + if (!suppressed.isEmpty()) { + IOException exception = new IOException("Failed to close VEFI_DiskHandle"); + suppressed.forEach(exception::addSuppressed); + throw exception; + } + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_FileContext.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_FileContext.java new file mode 100644 index 000000000..dbc6568b2 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_FileContext.java @@ -0,0 +1,9 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.api.device.HardwareDevice; + +public record VEFI_FileContext(HardwareDevice device, String fileInfo, int mode, int handle) { + public void write(byte[] data, int offset, int length) { + + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java new file mode 100644 index 000000000..fcaba322c --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VEFI_SystemImpl.java @@ -0,0 +1,429 @@ +package dev.ultreon.devices.impl.bios; + +import de.waldheinz.fs.BlockDevice; +import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.api.bios.BiosInterruptType; +import dev.ultreon.devices.api.bios.efi.*; +import dev.ultreon.devices.api.device.HardwareDevice; +import dev.ultreon.devices.api.device.VEFI_Disk; +import dev.ultreon.devices.core.client.ClientNotification; + +import java.io.IOException; +import java.util.Arrays; +import java.util.BitSet; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; + +public class VEFI_SystemImpl implements VEFI_System { + public static final byte EFI_SIGNATURE = (byte) 0x83; + private final VEFI_DeviceID[] deviceInfo; + private final Map devices = new ConcurrentHashMap<>(); + private final VEFI_DeviceID[] driveInfo; + private final VBios vBios; + private final BitSet openFiles = new BitSet(128); + private final VEFI_FileContext[] files = new VEFI_FileContext[128]; + private final BitSet openDisks = new BitSet(32); + final VEFI_DiskHandle[] disks = new VEFI_DiskHandle[32]; + + public VEFI_SystemImpl(DeviceInfo deviceInfo, VBios vBios) { + this.deviceInfo = deviceInfo.createDeviceList(); + this.driveInfo = deviceInfo.createDriveList(); + + for (VEFI_DeviceID id : deviceInfo.deviceList) { + this.devices.put(id.id(), vBios.getPhysicalDevice(id.id())); + } + this.vBios = vBios; + } + + @Override + public VEFI_DeviceInfo getDevices() { + VEFI_DeviceID[] devices = new VEFI_DeviceID[deviceInfo.length]; + System.arraycopy(deviceInfo, 0, devices, 0, deviceInfo.length); + return new VEFI_DeviceInfo(devices); + } + + @Override + public VEFI_DiskInfo[] getDriveList() throws IOException { + VEFI_DiskInfo[] drives = new VEFI_DiskInfo[driveInfo.length]; + for (int i = 0; i < driveInfo.length; i++) { + drives[i] = new VEFI_DiskInfo(driveInfo[i], readPortB(driveInfo[i], 0)); + } + return drives; + } + + @Override + public void sendNotification(VEFI_Notification notification) { + try { + ClientNotification clientNotification = ClientNotification.of(notification); + clientNotification.push(); + } catch (Throwable fault) { + this.vBios.fault(fault); + } + } + + @Override + public void writePortB(VEFI_DeviceID id, int index, byte value) throws IOException { + this.devices.get(id.id()).io().setByte(index, value); + } + + @Override + public void writePortS(VEFI_DeviceID id, int index, short value) throws IOException { + this.devices.get(id.id()).io().setShort(index, value); + } + + @Override + public void writePortI(VEFI_DeviceID id, int index, int value) throws IOException { + this.devices.get(id.id()).io().setInt(index, value); + } + + @Override + public void writePortL(VEFI_DeviceID id, int index, long value) throws IOException { + this.devices.get(id.id()).io().setLong(index, value); + } + + @Override + public void writePortF(VEFI_DeviceID id, int index, float value) throws IOException { + this.devices.get(id.id()).io().setFloat(index, value); + } + + @Override + public void writePortD(VEFI_DeviceID id, int index, double value) throws IOException { + this.devices.get(id.id()).io().setDouble(index, value); + } + + @Override + public void writePortC(VEFI_DeviceID id, int index, char value) throws IOException { + this.devices.get(id.id()).io().setChar(index, value); + } + + @Override + public void writePortZ(VEFI_DeviceID id, int index, boolean value) throws IOException { + this.devices.get(id.id()).io().setByte(index, (byte) (value ? 1 : 0)); + } + + @Override + public void writePortT(VEFI_DeviceID id, int index, String value) throws IOException { + this.devices.get(id.id()).io().setString(index, value); + } + + @Override + public void writePortBv(VEFI_DeviceID id, int index, byte[] value) throws IOException { + this.devices.get(id.id()).io().setBytes(index, value); + } + + @Override + public void writePortSv(VEFI_DeviceID id, int index, short[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io().setShort(index + i * Short.BYTES, value[i]); + } + } + + @Override + public void writePortIv(VEFI_DeviceID id, int index, int[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io().setInt(index + i * Integer.BYTES, value[i]); + } + } + + @Override + public void writePortLv(VEFI_DeviceID id, int index, long[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io().setLong(index + i * Long.BYTES, value[i]); + } + } + + @Override + public void writePortFv(VEFI_DeviceID id, int index, float[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io().setFloat(index + i * Float.BYTES, value[i]); + } + } + + @Override + public void writePortDv(VEFI_DeviceID id, int index, double[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io().setDouble(index + i * Double.BYTES, value[i]); + } + } + + @Override + public void writePortCv(VEFI_DeviceID id, int index, char[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io().setChar(index + i * Character.BYTES, value[i]); + } + } + + @Override + public void writePortZv(VEFI_DeviceID id, int index, boolean[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io().setByte(index + i, (byte) (value[i] ? 1 : 0)); + } + } + + @Override + public void writePortTv(VEFI_DeviceID id, int index, String[] value) throws IOException { + for (int i = 0; i < value.length; i++) { + this.devices.get(id.id()).io(). + setString(index + i * Character.BYTES, value[i]); + } + } + + @Override + public byte readPortB(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getByte(index); + } + + @Override + public short readPortS(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getShort(index); + } + + @Override + public int readPortI(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getInt(index); + } + + @Override + public long readPortL(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getLong(index); + } + + @Override + public float readPortF(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getFloat(index); + } + + @Override + public double readPortD(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getDouble(index); + } + + @Override + public char readPortC(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getChar(index); + } + + @Override + public boolean readPortZ(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getByte(index) != 0; + } + + @Override + public String readPortT(VEFI_DeviceID id, int index) throws IOException { + return this.devices.get(id.id()).io().getString(index); + } + + @Override + public byte[] readPortBv(VEFI_DeviceID id, int index, int length) throws IOException { + return this.devices.get(id.id()).io().getBytes(index, length); + } + + @Override + public short[] readPortSv(VEFI_DeviceID id, int index, int length) throws IOException { + short[] shorts = new short[length]; + for (int i = 0; i < length; i++) { + shorts[i] = this.devices.get(id.id()).io().getShort(index + i * Short.BYTES); + } + return shorts; + } + + @Override + public int[] readPortIv(VEFI_DeviceID id, int index, int length) throws IOException { + int[] ints = new int[length]; + for (int i = 0; i < length; i++) { + ints[i] = this.devices.get(id.id()).io().getInt(index + i * Integer.BYTES); + } + return ints; + } + + @Override + public long[] readPortLv(VEFI_DeviceID id, int index, int length) throws IOException { + long[] longs = new long[length]; + for (int i = 0; i < length; i++) { + longs[i] = this.devices.get(id.id()).io().getLong(index + i * Long.BYTES); + } + return longs; + } + + @Override + public float[] readPortFv(VEFI_DeviceID id, int index, int length) throws IOException { + float[] floats = new float[length]; + for (int i = 0; i < length; i++) { + floats[i] = this.devices.get(id.id()).io().getFloat(index + i * Float.BYTES); + } + return floats; + } + + @Override + public double[] readPortDv(VEFI_DeviceID id, int index, int length) throws IOException { + double[] doubles = new double[length]; + for (int i = 0; i < length; i++) { + doubles[i] = this.devices.get(id.id()).io().getDouble(index + i * Double.BYTES); + } + return doubles; + } + + @Override + public char[] readPortCv(VEFI_DeviceID id, int index, int length) throws IOException { + char[] chars = new char[length]; + for (int i = 0; i < length; i++) { + chars[i] = this.devices.get(id.id()).io().getChar(index + i * Character.BYTES); + } + return chars; + } + + @Override + public boolean[] readPortZv(VEFI_DeviceID id, int index, int length) throws IOException { + boolean[] booleans = new boolean[length]; + for (int i = 0; i < length; i++) { + booleans[i] = this.devices.get(id.id()).io().getByte(index + i) != 0; + } + return booleans; + } + + @Override + public String[] readPortTv(VEFI_DeviceID id, int index, int length) throws IOException { + String[] strings = new String[length]; + for (int i = 0; i < length; i++) { + strings[i] = this.devices.get(id.id()).io().getString(index + i * Integer.BYTES); + } + return strings; + } + + @Override + public void writePortB(VEFI_DeviceID id, int index, byte value, int mask) throws IOException { + this.devices.get(id.id()).io().setByte(index, (byte) (value & mask)); + } + + @Override + public void writePortS(VEFI_DeviceID id, int index, short value, int mask) throws IOException { + this.devices.get(id.id()).io().setShort(index, (short) (value & mask)); + } + + @Override + public void writePortI(VEFI_DeviceID id, int index, int value, int mask) throws IOException { + this.devices.get(id.id()).io().setInt(index, value & mask); + } + + @Override + public void writePortL(VEFI_DeviceID id, int index, long value, int mask) throws IOException { + this.devices.get(id.id()).io().setLong(index, value & mask); + } + + @Override + public void writePortF(VEFI_DeviceID id, int index, float value, int mask) throws IOException { + this.devices.get(id.id()).io().setFloat(index, Float.intBitsToFloat(Float.floatToIntBits(value) & mask)); + } + + @Override + public void writePortD(VEFI_DeviceID id, int index, double value, int mask) throws IOException { + this.devices.get(id.id()).io().setDouble(index, Double.longBitsToDouble(Double.doubleToLongBits(value) & mask)); + } + + @Override + public VEFI_Disk openDisk(VEFI_DiskInfo info) { + VEFI_DeviceID id = info.deviceID(); + if (!this.devices.containsKey(id.id()) || !id.isDrive()) { + return null; + } + + int i = this.openDisks.nextClearBit(0); + + this.openDisks.set(i); + HardwareDevice hardwareDevice = this.devices.get(id.id()); + if (hardwareDevice instanceof BlockDevice blockDevice) { + VEFI_DiskHandle handle = new VEFI_DiskHandle(this, hardwareDevice, blockDevice, i); + this.disks[i] = handle; + try { + this.loadPartitions(handle); + } catch (IOException e) { + this.vBios.interrupt(BiosInterruptType.IO_ERROR, new IOErrorInterrupt(this.vBios, this, e)); + } + } else { + this.disks[i] = null; + this.openDisks.clear(i); + } + + return new VEFI_Disk(i); + } + + private void loadPartitions(VEFI_DiskHandle disk) throws IOException { + PartitionTable partitionTable = PartitionTable.load(disk.blockDevice()); + partitionTable.entries.forEach((entry) -> { + if (entry.type == EFI_SIGNATURE) { + disk.findBootPartition(entry); + } + }); + } + + @Override + public VEFI_File openFile(VEFI_Disk info, String path, int mode) { + VEFI_DiskHandle disk = this.disks[info.handle()]; + int i = this.openFiles.nextClearBit(0); + disk.openFiles.set(i); + this.files[i] = new VEFI_FileContext(disk.hardwareDevice(), path, mode, i); + + return new VEFI_File(i); + } + + @Override + public void writeFileB(VEFI_File file, byte[] data, int offset, int length) { + this.files[file.handle()].write(data, offset, length); + } + + @Override + public void writeFileT(VEFI_File file, String data, int offset, int length) { + + } + + @Override + public void readFileB(VEFI_File file, byte[] data, int offset, int length) { + + } + + @Override + public void readFileT(VEFI_File file, char[] data, int offset, int length) { + + } + + @Override + public void closeFile(VEFI_File file) { + + } + + @Override + public Bios getBios() { + return vBios; + } + + @Override + public Object runIsolated(Class context, String className, String packageName, Object... args) { + IsolatedClassLoader classLoader = new IsolatedClassLoader(getClass().getClassLoader(), context.getProtectionDomain().getCodeSource().getLocation(), packageName); + try { + Class theClass = classLoader.loadClass(className); + Class[] parameterTypes = Arrays.stream(args).map(Object::getClass).toArray(Class[]::new); + return theClass.getConstructor(parameterTypes).newInstance(args); + } catch (Throwable e) { + vBios.fault(e); + + class BrokenObject {} + return new BrokenObject(); + } + } + + public VEFI_FileContext getFile(int handle) { + return files[handle]; + } + + @Override + public void closeDisk(VEFI_Disk vefiDisk) throws IOException { + VEFI_DiskHandle handle = disks[vefiDisk.handle()]; + if (handle != null) { + handle.close(); + } + + disks[vefiDisk.handle()] = null; + openDisks.clear(vefiDisk.handle()); + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VideoMode.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VideoMode.java new file mode 100644 index 000000000..a245b429c --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VideoMode.java @@ -0,0 +1,8 @@ +package dev.ultreon.devices.impl.bios; + +public interface VideoMode { + int getHorizontalResolution(); + int getVerticalResolution(); + int getBitsPerPixel(); + int getRefreshRate(); +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java new file mode 100644 index 000000000..968ade423 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VirtVGA.java @@ -0,0 +1,32 @@ +package dev.ultreon.devices.impl.bios; + +import dev.ultreon.devices.api.bios.FrameBufferCall; +import org.joml.Vector2i; + +public class VirtVGA { + private final Vector2i cachedSize = new Vector2i(); + private FrameBuffer frameBuffer; + + public VirtVGA(DisplayDevice device) { + this.frameBuffer = new FrameBuffer(800, 600); + } + + public Object call(FrameBufferCall callId, Object... data) { + return this.frameBuffer.call(callId, data); + } + + public FrameBuffer getFrameBuffer() { + return frameBuffer; + } + + public void turnOff() { + this.cachedSize.set(this.frameBuffer.width, this.frameBuffer.height); + this.frameBuffer.dispose(); + this.frameBuffer = null; + } + + public void reset() { + this.frameBuffer.dispose(); + this.frameBuffer = new FrameBuffer(this.cachedSize.x, this.cachedSize.y); + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/bios/VirtualDisk.java b/common/src/main/java/dev/ultreon/devices/impl/bios/VirtualDisk.java new file mode 100644 index 000000000..5bdbe969f --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/bios/VirtualDisk.java @@ -0,0 +1,354 @@ +package dev.ultreon.devices.impl.bios; + +import com.google.common.collect.Iterators; +import de.waldheinz.fs.*; +import org.jetbrains.annotations.NotNull; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Collectors; + +public class VirtualDisk extends Disk implements FileSystem { + private final Path bootFile; + private FsDirectory root; + + public VirtualDisk(Path bootFile) { + this.bootFile = bootFile; + + this.root = new VirtualDiskRoot(bootFile); + } + + @Override + public FileSystem open() { + return this; + } + + @Override + public FsDirectory getRoot() { + return root; + } + + @Override + public boolean isReadOnly() { + return false; + } + + @Override + public void close() { + + } + + @Override + public boolean isClosed() { + return false; + } + + @Override + public long getTotalSpace() { + return 0; + } + + @Override + public long getFreeSpace() { + return 0; + } + + @Override + public long getUsableSpace() { + return 0; + } + + @Override + public void flush() { + + } + + private class VirtualDiskRoot implements FsDirectory { + private final VirtualDirectory bootDir; + + public VirtualDiskRoot(Path bootFile) { + this.bootDir = new VirtualDirectory("boot"); + VirtualDirectory vefiDir = new VirtualDirectory("vefi", List.of( + new VirtualFile(bootFile, "boot.jefi") + )); + this.bootDir.entries.put("vefi", vefiDir); + } + + @Override + public Iterator iterator() { + return Iterators.singletonIterator(bootDir); + } + + @Override + public FsDirectoryEntry getEntry(String name) throws IOException { + if (name.equals("boot")) { + return bootDir; + } else { + throw new FileNotFoundException(name); + } + } + + @Override + public FsDirectoryEntry addFile(String name) { + throw new ReadOnlyException(); + } + + @Override + public FsDirectoryEntry addDirectory(String name) { + throw new ReadOnlyException(); + } + + @Override + public void remove(String name) { + throw new ReadOnlyException(); + } + + @Override + public void flush() { + // No + } + + @Override + public boolean isValid() { + return true; + } + + @Override + public boolean isReadOnly() { + return true; + } + } + + private static class VirtualDirectory implements FsDirectory, FsDirectoryEntry { + final Map entries = new LinkedHashMap<>(); + private final String name; + + public VirtualDirectory(String name) { + + this.name = name; + } + + public VirtualDirectory(String name, List entries) { + this.name = name; + this.entries.putAll(entries.stream().collect(Collectors.toMap(FsDirectoryEntry::getName, e -> e))); + } + + @Override + public @NotNull Iterator iterator() { + return entries.values().iterator(); + } + + @Override + public FsDirectoryEntry getEntry(String name) { + return entries.get(name); + } + + @Override + public FsDirectoryEntry addFile(String name) { + throw new ReadOnlyException(); + } + + @Override + public FsDirectoryEntry addDirectory(String name) { + throw new ReadOnlyException(); + } + + @Override + public void remove(String name) { + throw new ReadOnlyException(); + } + + @Override + public void flush() { + // No + } + + @Override + public boolean isValid() { + return true; + } + + @Override + public boolean isReadOnly() { + return true; + } + + @Override + public String getName() { + return name; + } + + @Override + public FsDirectory getParent() { + return null; + } + + @Override + public long getLastModified() { + return 0; + } + + @Override + public long getCreated() { + return 0; + } + + @Override + public long getLastAccessed() { + return 0; + } + + @Override + public boolean isFile() { + return false; + } + + @Override + public boolean isDirectory() { + return false; + } + + @Override + public void setName(String newName) { + + } + + @Override + public void setLastModified(long lastModified) { + + } + + @Override + public FsFile getFile() { + return null; + } + + @Override + public FsDirectory getDirectory() { + return null; + } + + @Override + public boolean isDirty() { + return false; + } + } + + private static class VirtualFile implements FsFile, FsDirectoryEntry { + private final Path hostFile; + private final String name; + FsDirectory parent; + + public VirtualFile(Path hostFile, String name) { + this.hostFile = hostFile; + this.name = name; + } + + @Override + public long getLength() { + try { + return Files.size(hostFile); + } catch (IOException e) { + return 0; + } + } + + @Override + public void setLength(long length) { + throw new ReadOnlyException(); + } + + @Override + public void read(long offset, ByteBuffer dest) throws IOException { + try (var channel = Files.newByteChannel(hostFile)) { + channel.position(offset); + channel.read(dest); + } + } + + @Override + public void write(long offset, ByteBuffer src) throws ReadOnlyException { + throw new ReadOnlyException(); + } + + @Override + public void flush() { + throw new ReadOnlyException(); + } + + @Override + public boolean isValid() { + return true; + } + + @Override + public boolean isReadOnly() { + return true; + } + + @Override + public String getName() { + return name; + } + + @Override + public FsDirectory getParent() { + return parent; + } + + @Override + public long getLastModified() { + return 0; + } + + @Override + public long getCreated() { + return 0; + } + + @Override + public long getLastAccessed() { + return 0; + } + + @Override + public boolean isFile() { + return false; + } + + @Override + public boolean isDirectory() { + return false; + } + + @Override + public void setName(String newName) { + + } + + @Override + public void setLastModified(long lastModified) { + + } + + @Override + public FsFile getFile() { + return this; + } + + @Override + public FsDirectory getDirectory() throws IOException { + throw new IOException("File is not a directory"); + } + + @Override + public boolean isDirty() { + return false; + } + + } +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/device/HostDevice.java b/common/src/main/java/dev/ultreon/devices/impl/device/HostDevice.java new file mode 100644 index 000000000..3247dbfce --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/device/HostDevice.java @@ -0,0 +1,25 @@ +package dev.ultreon.devices.impl.device; + +import dev.ultreon.devices.api.device.HardwareDevice; +import dev.ultreon.devices.impl.bios.DeviceInfo; +import dev.ultreon.devices.impl.bios.DisplayDevice; +import dev.ultreon.devices.impl.bios.VEFI_SystemImpl; + +import java.nio.ByteBuffer; +import java.util.UUID; + +public interface HostDevice { + void powerOff(); + + PhysicalHardwareDevice getPhysicalDevice(UUID id); + + DeviceInfo getDevices(); + + ByteBuffer getBiosData(); + + void enterSleep(); + + void exitSleep(); + + DisplayDevice getGraphics(); +} diff --git a/common/src/main/java/dev/ultreon/devices/impl/device/PhysicalHardwareDevice.java b/common/src/main/java/dev/ultreon/devices/impl/device/PhysicalHardwareDevice.java new file mode 100644 index 000000000..4a808731b --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/device/PhysicalHardwareDevice.java @@ -0,0 +1,10 @@ +package dev.ultreon.devices.impl.device; + +import dev.ultreon.devices.api.device.HardwareDevice; + +public interface PhysicalHardwareDevice extends HardwareDevice { + @Override + default boolean isPhysical() { + return true; + } +} diff --git a/common/src/main/java/dev/ultreon/devices/api/event/LaptopEvent.java b/common/src/main/java/dev/ultreon/devices/impl/event/LaptopEvent.java similarity index 70% rename from common/src/main/java/dev/ultreon/devices/api/event/LaptopEvent.java rename to common/src/main/java/dev/ultreon/devices/impl/event/LaptopEvent.java index 03383a6b5..56937be76 100644 --- a/common/src/main/java/dev/ultreon/devices/api/event/LaptopEvent.java +++ b/common/src/main/java/dev/ultreon/devices/impl/event/LaptopEvent.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.api.event; +package dev.ultreon.devices.impl.event; -import dev.ultreon.devices.api.TrayItemAdder; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.TrayItemAdder; +import dev.ultreon.mineos.userspace.MineOS; import dev.architectury.event.Event; import dev.architectury.event.EventFactory; diff --git a/common/src/main/java/dev/ultreon/devices/api/io/Drive.java b/common/src/main/java/dev/ultreon/devices/impl/io/Drive.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/io/Drive.java rename to common/src/main/java/dev/ultreon/devices/impl/io/Drive.java index ab86eb8f3..650614b1c 100644 --- a/common/src/main/java/dev/ultreon/devices/api/io/Drive.java +++ b/common/src/main/java/dev/ultreon/devices/impl/io/Drive.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.io; +package dev.ultreon.devices.impl.io; import dev.ultreon.devices.core.io.FileSystem; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/api/io/File.java b/common/src/main/java/dev/ultreon/devices/impl/io/File.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/io/File.java rename to common/src/main/java/dev/ultreon/devices/impl/io/File.java index 9e3986675..bd772cab6 100644 --- a/common/src/main/java/dev/ultreon/devices/api/io/File.java +++ b/common/src/main/java/dev/ultreon/devices/impl/io/File.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.api.io; +package dev.ultreon.devices.impl.io; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.task.Callback; +import dev.ultreon.mineos.api.Application; +import dev.ultreon.devices.impl.task.Callback; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.action.FileAction; -import dev.ultreon.devices.mineos.apps.system.component.FileBrowser; +import dev.ultreon.mineos.apps.system.component.FileBrowser; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/api/io/Folder.java b/common/src/main/java/dev/ultreon/devices/impl/io/Folder.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/io/Folder.java rename to common/src/main/java/dev/ultreon/devices/impl/io/Folder.java index d247941f6..d746ffe30 100644 --- a/common/src/main/java/dev/ultreon/devices/api/io/Folder.java +++ b/common/src/main/java/dev/ultreon/devices/impl/io/Folder.java @@ -1,14 +1,14 @@ -package dev.ultreon.devices.api.io; +package dev.ultreon.devices.impl.io; -import dev.ultreon.devices.api.task.Callback; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.task.Callback; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.action.FileAction; import dev.ultreon.devices.core.io.task.TaskGetFiles; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.mineos.apps.system.component.FileBrowser; +import dev.ultreon.mineos.apps.system.component.FileBrowser; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; @@ -456,7 +456,7 @@ public void sync(@Nullable Callback callback) { if (!valid) throw new IllegalStateException("Folder must be added to the system before it can be synced"); if (!isSynced()) { - BlockPos pos = MineOS.getOpened().getPos(); + BlockPos pos = MineOS.get().getPos(); if (pos == null) { if (callback != null) { callback.execute(this, false); diff --git a/common/src/main/java/dev/ultreon/devices/api/io/MimeType.java b/common/src/main/java/dev/ultreon/devices/impl/io/MimeType.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/api/io/MimeType.java rename to common/src/main/java/dev/ultreon/devices/impl/io/MimeType.java index 277e3c606..b05973e79 100644 --- a/common/src/main/java/dev/ultreon/devices/api/io/MimeType.java +++ b/common/src/main/java/dev/ultreon/devices/impl/io/MimeType.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.io; +package dev.ultreon.devices.impl.io; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/api/os/OSScreen.java b/common/src/main/java/dev/ultreon/devices/impl/os/OSScreen.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/api/os/OSScreen.java rename to common/src/main/java/dev/ultreon/devices/impl/os/OSScreen.java index 4f8c5d76d..51795ddd3 100644 --- a/common/src/main/java/dev/ultreon/devices/api/os/OSScreen.java +++ b/common/src/main/java/dev/ultreon/devices/impl/os/OSScreen.java @@ -1,17 +1,18 @@ -package dev.ultreon.devices.api.os; +package dev.ultreon.devices.impl.os; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.bios.InterruptData; +import dev.ultreon.devices.api.os.OperatingSystem; +import dev.ultreon.devices.api.os.ShutdownSource; +import dev.ultreon.mineos.api.Application; +import dev.ultreon.devices.impl.bios.Bios; +import dev.ultreon.devices.impl.bios.InterruptData; import dev.ultreon.devices.client.Display; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.Screen; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; -import java.util.concurrent.CompletableFuture; - +@Deprecated(forRemoval = true) public abstract class OSScreen extends Screen implements OperatingSystem { private Display display; diff --git a/common/src/main/java/dev/ultreon/devices/api/print/IPrint.java b/common/src/main/java/dev/ultreon/devices/impl/print/IPrint.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/print/IPrint.java rename to common/src/main/java/dev/ultreon/devices/impl/print/IPrint.java index 9418025ed..b29740810 100644 --- a/common/src/main/java/dev/ultreon/devices/api/print/IPrint.java +++ b/common/src/main/java/dev/ultreon/devices/impl/print/IPrint.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.print; +package dev.ultreon.devices.impl.print; import com.mojang.blaze3d.vertex.PoseStack; import dev.ultreon.devices.init.DeviceBlocks; diff --git a/common/src/main/java/dev/ultreon/devices/api/print/PrintingManager.java b/common/src/main/java/dev/ultreon/devices/impl/print/PrintingManager.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/print/PrintingManager.java rename to common/src/main/java/dev/ultreon/devices/impl/print/PrintingManager.java index 79fa2065e..68ef57291 100644 --- a/common/src/main/java/dev/ultreon/devices/api/print/PrintingManager.java +++ b/common/src/main/java/dev/ultreon/devices/impl/print/PrintingManager.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.print; +package dev.ultreon.devices.impl.print; import com.google.common.collect.HashBiMap; import dev.ultreon.devices.UltreonDevicesMod; diff --git a/common/src/main/java/dev/ultreon/devices/api/storage/DataStorage.java b/common/src/main/java/dev/ultreon/devices/impl/storage/DataStorage.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/api/storage/DataStorage.java rename to common/src/main/java/dev/ultreon/devices/impl/storage/DataStorage.java index 0cf17f3fb..7fad8612b 100644 --- a/common/src/main/java/dev/ultreon/devices/api/storage/DataStorage.java +++ b/common/src/main/java/dev/ultreon/devices/impl/storage/DataStorage.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.storage; +package dev.ultreon.devices.impl.storage; import java.util.List; import java.util.ServiceLoader; diff --git a/common/src/main/java/dev/ultreon/devices/api/storage/FileHandle.java b/common/src/main/java/dev/ultreon/devices/impl/storage/FileHandle.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/storage/FileHandle.java rename to common/src/main/java/dev/ultreon/devices/impl/storage/FileHandle.java index c2ef0fd3d..6170a1242 100644 --- a/common/src/main/java/dev/ultreon/devices/api/storage/FileHandle.java +++ b/common/src/main/java/dev/ultreon/devices/impl/storage/FileHandle.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.storage; +package dev.ultreon.devices.impl.storage; import dev.ultreon.devices.UltreonDevicesMod; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorage.java b/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorage.java index c868d5604..140f1657d 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorage.java +++ b/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorage.java @@ -1,9 +1,5 @@ package dev.ultreon.devices.impl.storage; -import dev.ultreon.devices.impl.OsLoadContext; -import dev.ultreon.devices.api.storage.FileHandle; -import dev.ultreon.devices.api.storage.DataStorage; - import java.util.UUID; public class FileStorage implements DataStorage { diff --git a/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorageHandle.java b/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorageHandle.java index 0983bc095..3b0d7dd92 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorageHandle.java +++ b/common/src/main/java/dev/ultreon/devices/impl/storage/FileStorageHandle.java @@ -2,8 +2,7 @@ import com.google.gson.Gson; import net.minecraft.nbt.CompoundTag; -import dev.ultreon.devices.api.SystemException; -import dev.ultreon.devices.api.storage.FileHandle; +import dev.ultreon.devices.impl.SystemException; import net.minecraft.nbt.NbtAccounter; import net.minecraft.nbt.NbtIo; diff --git a/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceFileHandle.java b/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceFileHandle.java index 4924f5333..c372ded4a 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceFileHandle.java +++ b/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceFileHandle.java @@ -1,7 +1,6 @@ package dev.ultreon.devices.impl.storage; import net.minecraft.resources.ResourceLocation; -import dev.ultreon.devices.api.storage.FileHandle; import net.minecraft.client.Minecraft; import java.io.IOException; diff --git a/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceStorage.java b/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceStorage.java index fd3f1caec..ad9a534c3 100644 --- a/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceStorage.java +++ b/common/src/main/java/dev/ultreon/devices/impl/storage/ResourceStorage.java @@ -1,8 +1,6 @@ package dev.ultreon.devices.impl.storage; import net.minecraft.resources.ResourceLocation; -import dev.ultreon.devices.api.storage.FileHandle; -import dev.ultreon.devices.api.storage.DataStorage; public class ResourceStorage implements DataStorage { @Override diff --git a/common/src/main/java/dev/ultreon/devices/api/task/Callback.java b/common/src/main/java/dev/ultreon/devices/impl/task/Callback.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/api/task/Callback.java rename to common/src/main/java/dev/ultreon/devices/impl/task/Callback.java index 49ad7d197..8157f36c4 100644 --- a/common/src/main/java/dev/ultreon/devices/api/task/Callback.java +++ b/common/src/main/java/dev/ultreon/devices/impl/task/Callback.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.task; +package dev.ultreon.devices.impl.task; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/api/task/Task.java b/common/src/main/java/dev/ultreon/devices/impl/task/Task.java similarity index 99% rename from common/src/main/java/dev/ultreon/devices/api/task/Task.java rename to common/src/main/java/dev/ultreon/devices/impl/task/Task.java index 06c460e3a..8ea50c209 100644 --- a/common/src/main/java/dev/ultreon/devices/api/task/Task.java +++ b/common/src/main/java/dev/ultreon/devices/impl/task/Task.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.task; +package dev.ultreon.devices.impl.task; import dev.ultreon.devices.core.task.TaskInstallApp; import dev.ultreon.devices.debug.DebugLog; diff --git a/common/src/main/java/dev/ultreon/devices/api/task/TaskManager.java b/common/src/main/java/dev/ultreon/devices/impl/task/TaskManager.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/task/TaskManager.java rename to common/src/main/java/dev/ultreon/devices/impl/task/TaskManager.java index 3076a85e5..0adc5dfbf 100644 --- a/common/src/main/java/dev/ultreon/devices/api/task/TaskManager.java +++ b/common/src/main/java/dev/ultreon/devices/impl/task/TaskManager.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.task; +package dev.ultreon.devices.impl.task; import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.network.PacketHandler; diff --git a/common/src/main/java/dev/ultreon/devices/api/util/Color.java b/common/src/main/java/dev/ultreon/devices/impl/util/Color.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/util/Color.java rename to common/src/main/java/dev/ultreon/devices/impl/util/Color.java index b42a240b6..0fd1f3e41 100644 --- a/common/src/main/java/dev/ultreon/devices/api/util/Color.java +++ b/common/src/main/java/dev/ultreon/devices/impl/util/Color.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.util; +package dev.ultreon.devices.impl.util; public class Color { public static final Color WHITE = new Color(java.awt.Color.WHITE); diff --git a/common/src/main/java/dev/ultreon/devices/api/util/GuiHelper.java b/common/src/main/java/dev/ultreon/devices/impl/util/GuiHelper.java similarity index 91% rename from common/src/main/java/dev/ultreon/devices/api/util/GuiHelper.java rename to common/src/main/java/dev/ultreon/devices/impl/util/GuiHelper.java index c5f183bcb..9e8c9f4a6 100644 --- a/common/src/main/java/dev/ultreon/devices/api/util/GuiHelper.java +++ b/common/src/main/java/dev/ultreon/devices/impl/util/GuiHelper.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.util; +package dev.ultreon.devices.impl.util; public class GuiHelper { public static boolean isMouseInside(int mouseX, int mouseY, int x1, int y1, int x2, int y2) { diff --git a/common/src/main/java/dev/ultreon/devices/api/util/ImageLoader.java b/common/src/main/java/dev/ultreon/devices/impl/util/ImageLoader.java similarity index 72% rename from common/src/main/java/dev/ultreon/devices/api/util/ImageLoader.java rename to common/src/main/java/dev/ultreon/devices/impl/util/ImageLoader.java index df858e1d4..ac42992b7 100644 --- a/common/src/main/java/dev/ultreon/devices/api/util/ImageLoader.java +++ b/common/src/main/java/dev/ultreon/devices/impl/util/ImageLoader.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.util; +package dev.ultreon.devices.impl.util; -import dev.ultreon.devices.api.storage.FileHandle; +import dev.ultreon.devices.impl.storage.FileHandle; import java.util.List; import java.util.ServiceLoader; diff --git a/common/src/main/java/dev/ultreon/devices/api/util/ImageSource.java b/common/src/main/java/dev/ultreon/devices/impl/util/ImageSource.java similarity index 88% rename from common/src/main/java/dev/ultreon/devices/api/util/ImageSource.java rename to common/src/main/java/dev/ultreon/devices/impl/util/ImageSource.java index 8d4cbc673..4ee0ae4ac 100644 --- a/common/src/main/java/dev/ultreon/devices/api/util/ImageSource.java +++ b/common/src/main/java/dev/ultreon/devices/impl/util/ImageSource.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.util; +package dev.ultreon.devices.impl.util; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/api/util/Vulnerability.java b/common/src/main/java/dev/ultreon/devices/impl/util/Vulnerability.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/api/util/Vulnerability.java rename to common/src/main/java/dev/ultreon/devices/impl/util/Vulnerability.java index 0b5241b7a..1480b58ff 100644 --- a/common/src/main/java/dev/ultreon/devices/api/util/Vulnerability.java +++ b/common/src/main/java/dev/ultreon/devices/impl/util/Vulnerability.java @@ -1,12 +1,12 @@ -package dev.ultreon.devices.api.util; +package dev.ultreon.devices.impl.util; import com.jab125.version.VersionPredicate; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Icons; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.mineos.api.Icons; import dev.ultreon.devices.client.Display; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.object.TrayItem; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.object.TrayItem; import org.jetbrains.annotations.Nullable; import java.util.Collection; diff --git a/common/src/main/java/dev/ultreon/devices/api/utils/BankUtil.java b/common/src/main/java/dev/ultreon/devices/impl/utils/BankUtil.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/api/utils/BankUtil.java rename to common/src/main/java/dev/ultreon/devices/impl/utils/BankUtil.java index 2665f5e14..bec9574a1 100644 --- a/common/src/main/java/dev/ultreon/devices/api/utils/BankUtil.java +++ b/common/src/main/java/dev/ultreon/devices/impl/utils/BankUtil.java @@ -1,13 +1,13 @@ -package dev.ultreon.devices.api.utils; +package dev.ultreon.devices.impl.utils; -import dev.ultreon.devices.api.WorldSavedData; -import dev.ultreon.devices.api.task.Callback; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.mineos.apps.system.object.Account; -import dev.ultreon.devices.mineos.apps.system.task.TaskAdd; -import dev.ultreon.devices.mineos.apps.system.task.TaskGetBalance; -import dev.ultreon.devices.mineos.apps.system.task.TaskPay; -import dev.ultreon.devices.mineos.apps.system.task.TaskRemove; +import dev.ultreon.devices.impl.WorldSavedData; +import dev.ultreon.devices.impl.task.Callback; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.mineos.apps.system.object.Account; +import dev.ultreon.mineos.apps.system.task.TaskAdd; +import dev.ultreon.mineos.apps.system.task.TaskGetBalance; +import dev.ultreon.mineos.apps.system.task.TaskPay; +import dev.ultreon.mineos.apps.system.task.TaskRemove; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ultreon/devices/api/utils/OnlineRequest.java b/common/src/main/java/dev/ultreon/devices/impl/utils/OnlineRequest.java similarity index 99% rename from common/src/main/java/dev/ultreon/devices/api/utils/OnlineRequest.java rename to common/src/main/java/dev/ultreon/devices/impl/utils/OnlineRequest.java index 0de934e50..c6696b121 100644 --- a/common/src/main/java/dev/ultreon/devices/api/utils/OnlineRequest.java +++ b/common/src/main/java/dev/ultreon/devices/impl/utils/OnlineRequest.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.utils; +package dev.ultreon.devices.impl.utils; import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.util.StreamUtils; diff --git a/common/src/main/java/dev/ultreon/devices/api/utils/RenderUtil.java b/common/src/main/java/dev/ultreon/devices/impl/utils/RenderUtil.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/utils/RenderUtil.java rename to common/src/main/java/dev/ultreon/devices/impl/utils/RenderUtil.java index cbc0405e4..97b3b2f7b 100644 --- a/common/src/main/java/dev/ultreon/devices/api/utils/RenderUtil.java +++ b/common/src/main/java/dev/ultreon/devices/impl/utils/RenderUtil.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.api.utils; +package dev.ultreon.devices.impl.utils; import com.mojang.blaze3d.platform.Lighting; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.*; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; diff --git a/common/src/main/java/dev/ultreon/devices/impl/video/CustomResolution.java b/common/src/main/java/dev/ultreon/devices/impl/video/CustomResolution.java new file mode 100644 index 000000000..1330faa43 --- /dev/null +++ b/common/src/main/java/dev/ultreon/devices/impl/video/CustomResolution.java @@ -0,0 +1,6 @@ +package dev.ultreon.devices.impl.video; + +import dev.ultreon.mineos.apps.system.DisplayResolution; + +public record CustomResolution(int width, int height) implements DisplayResolution { +} diff --git a/common/src/main/java/dev/ultreon/devices/api/video/VideoInfo.java b/common/src/main/java/dev/ultreon/devices/impl/video/VideoInfo.java similarity index 80% rename from common/src/main/java/dev/ultreon/devices/api/video/VideoInfo.java rename to common/src/main/java/dev/ultreon/devices/impl/video/VideoInfo.java index 48d0db4d7..e7c5b37d3 100644 --- a/common/src/main/java/dev/ultreon/devices/api/video/VideoInfo.java +++ b/common/src/main/java/dev/ultreon/devices/impl/video/VideoInfo.java @@ -1,9 +1,9 @@ -package dev.ultreon.devices.api.video; +package dev.ultreon.devices.impl.video; import com.mojang.blaze3d.platform.Window; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.apps.system.DisplayResolution; -import dev.ultreon.devices.mineos.apps.system.PredefinedResolution; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.apps.system.DisplayResolution; +import dev.ultreon.mineos.apps.system.PredefinedResolution; import net.minecraft.client.Minecraft; import net.minecraft.nbt.CompoundTag; @@ -28,7 +28,7 @@ public Collection getResolutionList() { public void setResolution(DisplayResolution value) { this.resolution = value; - MineOS.getOpened().revalidateDisplay(); + MineOS.get().revalidateDisplay(); } public DisplayResolution getResolution() { diff --git a/common/src/main/java/dev/ultreon/devices/mineos/DriverManager.java b/common/src/main/java/dev/ultreon/devices/mineos/DriverManager.java deleted file mode 100644 index 9b3a34859..000000000 --- a/common/src/main/java/dev/ultreon/devices/mineos/DriverManager.java +++ /dev/null @@ -1,7 +0,0 @@ -package dev.ultreon.devices.mineos; - -public class DriverManager { - public void loadDrivers() { - - } -} diff --git a/common/src/main/java/dev/ultreon/devices/mineos/MineOSSystem.java b/common/src/main/java/dev/ultreon/devices/mineos/MineOSSystem.java deleted file mode 100644 index 8a637b628..000000000 --- a/common/src/main/java/dev/ultreon/devices/mineos/MineOSSystem.java +++ /dev/null @@ -1,13 +0,0 @@ -package dev.ultreon.devices.mineos; - -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.mineos.client.Settings; -import dev.ultreon.devices.object.AppInfo; - -public interface MineOSSystem { - Settings getSettings(); - - Iterable getInstalledApplications(); - - Application openApplication(AppInfo application); -} diff --git a/common/src/main/java/dev/ultreon/devices/mineos/client/MineOSKernel.java b/common/src/main/java/dev/ultreon/devices/mineos/client/MineOSKernel.java deleted file mode 100644 index b720aeb8d..000000000 --- a/common/src/main/java/dev/ultreon/devices/mineos/client/MineOSKernel.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.ultreon.devices.mineos.client; - -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.mineos.DriverManager; -import net.minecraft.client.Minecraft; -import net.minecraft.client.resources.sounds.SimpleSoundInstance; -import net.minecraft.sounds.SoundEvent; - -public class MineOSKernel { - private static final DriverManager driverManager = new DriverManager(); - - public void boot(MineOS mineOS, Bios bios) { - this.loadDrivers(mineOS, bios); - } - - private void loadDrivers(MineOS mineOS, Bios bios) { - - } - - public void playSound(SoundEvent sound) { - Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(sound, 1f, 1f)); - } -} diff --git a/common/src/main/java/dev/ultreon/devices/minephone/MinePhoneOS.java b/common/src/main/java/dev/ultreon/devices/minephone/MinePhoneOS.java index 164cc57a6..2b7f50417 100644 --- a/common/src/main/java/dev/ultreon/devices/minephone/MinePhoneOS.java +++ b/common/src/main/java/dev/ultreon/devices/minephone/MinePhoneOS.java @@ -1,8 +1,8 @@ package dev.ultreon.devices.minephone; -import dev.ultreon.devices.api.bios.Bios; -import dev.ultreon.devices.api.os.OSScreen; -import dev.ultreon.devices.api.video.CustomResolution; +import dev.ultreon.devices.impl.bios.Bios; +import dev.ultreon.devices.impl.os.OSScreen; +import dev.ultreon.devices.impl.video.CustomResolution; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.client.Display; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/network/task/NotificationPacket.java b/common/src/main/java/dev/ultreon/devices/network/task/NotificationPacket.java index 967328c67..84556219a 100644 --- a/common/src/main/java/dev/ultreon/devices/network/task/NotificationPacket.java +++ b/common/src/main/java/dev/ultreon/devices/network/task/NotificationPacket.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.network.task; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Notification; +import dev.ultreon.mineos.api.Notification; import dev.ultreon.devices.network.Packet; import dev.architectury.networking.NetworkManager; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/network/task/RequestPacket.java b/common/src/main/java/dev/ultreon/devices/network/task/RequestPacket.java index 27ddbf2ab..6be32b527 100644 --- a/common/src/main/java/dev/ultreon/devices/network/task/RequestPacket.java +++ b/common/src/main/java/dev/ultreon/devices/network/task/RequestPacket.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.network.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.task.TaskManager; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.task.TaskManager; import dev.ultreon.devices.network.Packet; import dev.ultreon.devices.network.PacketHandler; import dev.architectury.networking.NetworkManager; diff --git a/common/src/main/java/dev/ultreon/devices/network/task/ResponsePacket.java b/common/src/main/java/dev/ultreon/devices/network/task/ResponsePacket.java index f37ddc451..8668a2aef 100644 --- a/common/src/main/java/dev/ultreon/devices/network/task/ResponsePacket.java +++ b/common/src/main/java/dev/ultreon/devices/network/task/ResponsePacket.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.network.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.task.TaskManager; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.task.TaskManager; import dev.ultreon.devices.network.Packet; import dev.architectury.networking.NetworkManager; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/network/task/SyncApplicationPacket.java b/common/src/main/java/dev/ultreon/devices/network/task/SyncApplicationPacket.java index 0c76ac93f..4f63f1d71 100644 --- a/common/src/main/java/dev/ultreon/devices/network/task/SyncApplicationPacket.java +++ b/common/src/main/java/dev/ultreon/devices/network/task/SyncApplicationPacket.java @@ -2,9 +2,9 @@ import com.google.common.collect.ImmutableList; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.ApplicationManager; +import dev.ultreon.devices.impl.ApplicationManager; import dev.ultreon.devices.network.Packet; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.object.AppInfo; import dev.architectury.networking.NetworkManager; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/util/SiteRegistration.java b/common/src/main/java/dev/ultreon/devices/util/SiteRegistration.java index 910177e5a..672248032 100644 --- a/common/src/main/java/dev/ultreon/devices/util/SiteRegistration.java +++ b/common/src/main/java/dev/ultreon/devices/util/SiteRegistration.java @@ -1,7 +1,7 @@ package dev.ultreon.devices.util; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import org.slf4j.Marker; import org.slf4j.MarkerFactory; diff --git a/common/src/main/java/dev/ultreon/devices/util/VulnerabilityUtil.java b/common/src/main/java/dev/ultreon/devices/util/VulnerabilityUtil.java index 25541d33b..d840d036b 100644 --- a/common/src/main/java/dev/ultreon/devices/util/VulnerabilityUtil.java +++ b/common/src/main/java/dev/ultreon/devices/util/VulnerabilityUtil.java @@ -7,7 +7,7 @@ import com.jab125.version.Version; import com.jab125.version.VersionPredicate; import dev.ultreon.devices.Reference; -import dev.ultreon.devices.api.util.Vulnerability; +import dev.ultreon.devices.impl.util.Vulnerability; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; diff --git a/common/src/mineos/java/dev/ultreon/mineos/AppClassLoader.java b/common/src/mineos/java/dev/ultreon/mineos/AppClassLoader.java new file mode 100644 index 000000000..dd9be4575 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/AppClassLoader.java @@ -0,0 +1,41 @@ +package dev.ultreon.mineos; + +import java.io.IOError; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class AppClassLoader extends ClassLoader { + private final Executable executable; + + private final Map> classes = new HashMap<>(); + + public AppClassLoader(ClassLoader parent, Executable executable) { + super(parent); + this.executable = executable; + } + + @Override + protected Class findClass(String name) throws ClassNotFoundException { + if (name.startsWith("java.awt") || !name.startsWith("java.") && name.startsWith("dev.ultreon.devices.")) { + throw new ClassNotFoundException(name); + } + + if (classes.containsKey(name)) { + return classes.get(name); + } + + if (this.executable == null) { + throw new IOError(new IOException("Executable is null")); + } + + byte[] aClass = this.executable.getClass(name); + if (aClass == null) { + throw new ClassNotFoundException(name); + } + + Class definedClass = defineClass(name, aClass, 0, aClass.length); + classes.put(name, definedClass); + return definedClass; + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/BootLoader.java b/common/src/mineos/java/dev/ultreon/mineos/BootLoader.java new file mode 100644 index 000000000..809ea97dd --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/BootLoader.java @@ -0,0 +1,18 @@ +package dev.ultreon.mineos; + +import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.api.bios.VEFI_Executable; +import dev.ultreon.devices.api.bios.efi.VEFI_System; + +public class BootLoader implements VEFI_Executable { + private Object kernel; + + @Override + public void execute(Bios bios, VEFI_System system) { + kernel = system.runIsolated(BootLoader.class, "dev.ultreon.mineos.kernel.MineOSKernel", "dev.ultreon.devices.os.mineos"); + } + + public Object getKernel() { + return kernel; + } +} diff --git a/common/src/main/java/dev/ultreon/devices/mineos/DestFactor.java b/common/src/mineos/java/dev/ultreon/mineos/DestFactor.java similarity index 77% rename from common/src/main/java/dev/ultreon/devices/mineos/DestFactor.java rename to common/src/mineos/java/dev/ultreon/mineos/DestFactor.java index b8b730400..7b300cbb9 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/DestFactor.java +++ b/common/src/mineos/java/dev/ultreon/mineos/DestFactor.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos; +package dev.ultreon.mineos; public enum DestFactor { ZERO, diff --git a/common/src/mineos/java/dev/ultreon/mineos/DriverManager.java b/common/src/mineos/java/dev/ultreon/mineos/DriverManager.java new file mode 100644 index 000000000..281d08956 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/DriverManager.java @@ -0,0 +1,11 @@ +package dev.ultreon.mineos; + +import java.util.Collection; + +public interface DriverManager { + T getDriver(Class clazz); + + Collection getDrivers(Class clazz); + + T getDriver(Class clazz, String name); +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/DriverManagerImpl.java b/common/src/mineos/java/dev/ultreon/mineos/DriverManagerImpl.java new file mode 100644 index 000000000..fa5fc7ee1 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/DriverManagerImpl.java @@ -0,0 +1,44 @@ +package dev.ultreon.mineos; + +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class DriverManagerImpl implements DriverManager { + Map drivers = new ConcurrentHashMap<>(); + + public void register(String vga, T driver) { + this.drivers.put(vga, driver); + } + + @Override + public T getDriver(Class clazz) { + for (Map.Entry entry : drivers.entrySet()) { + if (clazz.isInstance(entry.getValue())) { + return clazz.cast(entry.getValue()); + } + } + return null; + } + + @Override + public Collection getDrivers(Class clazz) { + Collection list = new java.util.ArrayList<>(); + for (Map.Entry entry : drivers.entrySet()) { + if (clazz.isInstance(entry.getValue())) { + list.add(clazz.cast(entry.getValue())); + } + } + return list; + } + + @Override + public T getDriver(Class clazz, String name) { + T result = null; + Object obj = drivers.get(name); + if (clazz.isInstance(obj)) { + result = clazz.cast(obj); + } + return result; + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/Executable.java b/common/src/mineos/java/dev/ultreon/mineos/Executable.java new file mode 100644 index 000000000..5d2a02056 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/Executable.java @@ -0,0 +1,26 @@ +package dev.ultreon.mineos; + +import dev.ultreon.mineos.kernel.Kern; +import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; +import org.apache.commons.compress.archivers.zip.ZipFile; + +import java.io.IOException; +import java.nio.file.Path; + +public class Executable { + private final ZipFile zipFile; + + public Executable(Path path) throws IOException { + this.zipFile = ZipFile.builder().setSeekableByteChannel(Kern.get().openChannel(path)).get(); + } + + public byte[] getClass(String name) throws ClassNotFoundException { + ZipArchiveEntry entry = zipFile.getEntry(name.replace('.', '/') + ".class"); + if (entry == null) return null; + try { + return zipFile.getInputStream(entry).readAllBytes(); + } catch (IOException e) { + throw new ClassNotFoundException(name, e); + } + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/MineOSSystem.java b/common/src/mineos/java/dev/ultreon/mineos/MineOSSystem.java new file mode 100644 index 000000000..b794cf6b8 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/MineOSSystem.java @@ -0,0 +1,13 @@ +package dev.ultreon.mineos; + +import dev.ultreon.mineos.api.Application; +import dev.ultreon.mineos.userspace.Settings; +import dev.ultreon.mineos.object.AppInfo; + +public interface MineOSSystem { + Settings getSettings(); + + Iterable getInstalledApplications(); + + Application openApplication(AppInfo application); +} diff --git a/common/src/main/java/dev/ultreon/devices/mineos/SourceFactor.java b/common/src/mineos/java/dev/ultreon/mineos/SourceFactor.java similarity index 78% rename from common/src/main/java/dev/ultreon/devices/mineos/SourceFactor.java rename to common/src/mineos/java/dev/ultreon/mineos/SourceFactor.java index 1ec3fe7e2..78c710a5e 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/SourceFactor.java +++ b/common/src/mineos/java/dev/ultreon/mineos/SourceFactor.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos; +package dev.ultreon.mineos; public enum SourceFactor { ZERO, diff --git a/common/src/main/java/dev/ultreon/devices/api/app/Alphabet.java b/common/src/mineos/java/dev/ultreon/mineos/api/Alphabet.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/Alphabet.java rename to common/src/mineos/java/dev/ultreon/mineos/api/Alphabet.java index 7970e1cc0..ed4edcf5e 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/Alphabet.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/Alphabet.java @@ -1,7 +1,6 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/Application.java b/common/src/mineos/java/dev/ultreon/mineos/api/Application.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/app/Application.java rename to common/src/mineos/java/dev/ultreon/mineos/api/Application.java index aaff270d3..9668a1b00 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/Application.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/Application.java @@ -1,13 +1,13 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.client.Window; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.userspace.Window; import dev.ultreon.devices.core.Wrappable; import dev.ultreon.devices.core.io.FileSystem; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.object.AppInfo; import dev.ultreon.devices.util.DataHandler; import dev.ultreon.devices.util.GLHelper; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/Component.java b/common/src/mineos/java/dev/ultreon/mineos/api/Component.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/Component.java rename to common/src/mineos/java/dev/ultreon/mineos/api/Component.java index 58785faa0..293189e05 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/Component.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/Component.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.apps.system.object.ColorScheme; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.apps.system.object.ColorScheme; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.resources.ResourceLocation; @@ -244,7 +244,7 @@ public void setVisible(boolean visible) { * @return */ protected ColorScheme getColorScheme() { - return MineOS.getOpened().getSettings().getColorScheme(); + return MineOS.get().getSettings().getColorScheme(); } public void drawVerticalLine(GuiGraphics graphics, int x, int y1, int y2, int rgb) { diff --git a/common/src/main/java/dev/ultreon/devices/api/app/Dialog.java b/common/src/mineos/java/dev/ultreon/mineos/api/Dialog.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/api/app/Dialog.java rename to common/src/mineos/java/dev/ultreon/mineos/api/Dialog.java index 5cf42f72e..37af7f870 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/Dialog.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/Dialog.java @@ -1,27 +1,25 @@ -package dev.ultreon.devices.api.app; - -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.component.ItemList; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.Text; -import dev.ultreon.devices.api.app.component.TextField; -import dev.ultreon.devices.api.app.listener.ClickListener; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.utils.RenderUtil; +package dev.ultreon.mineos.api; + +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.ItemList; +import dev.ultreon.devices.impl.app.component.Text; +import dev.ultreon.devices.impl.app.component.TextField; +import dev.ultreon.devices.impl.app.listener.ClickListener; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.utils.RenderUtil; import dev.ultreon.devices.init.DeviceBlockEntities; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.Wrappable; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.network.NetworkDevice; import dev.ultreon.devices.core.network.task.TaskGetDevices; import dev.ultreon.devices.core.print.task.TaskPrint; -import dev.ultreon.devices.mineos.apps.system.component.FileBrowser; -import dev.ultreon.devices.mineos.apps.system.object.ColorScheme; +import dev.ultreon.mineos.apps.system.component.FileBrowser; +import dev.ultreon.mineos.apps.system.object.ColorScheme; import dev.ultreon.devices.util.GLHelper; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; @@ -49,7 +47,7 @@ public Dialog() { this.defaultLayout = new Layout(150, 40); } - protected final void addComponent(dev.ultreon.devices.api.app.Component c) { + protected final void addComponent(dev.ultreon.mineos.api.Component c) { if (c != null) { defaultLayout.addComponent(c); c.init(defaultLayout); @@ -244,8 +242,8 @@ public static class Confirmation extends Dialog { private ClickListener positiveListener; private ClickListener negativeListener; - private dev.ultreon.devices.api.app.component.Button buttonPositive; - private dev.ultreon.devices.api.app.component.Button buttonNegative; + private Button buttonPositive; + private Button buttonNegative; public Confirmation() { } @@ -269,7 +267,7 @@ public void init(@Nullable CompoundTag intent) { this.addComponent(message); int positiveWidth = Minecraft.getInstance().font.width(positiveText); - buttonPositive = new dev.ultreon.devices.api.app.component.Button(getWidth() - positiveWidth - DIVIDE_WIDTH, getHeight() - 20, positiveText); + buttonPositive = new Button(getWidth() - positiveWidth - DIVIDE_WIDTH, getHeight() - 20, positiveText); buttonPositive.setSize(positiveWidth + 10, 16); buttonPositive.setClickListener((mouseX, mouseY, mouseButton) -> { if (positiveListener != null) { @@ -280,7 +278,7 @@ public void init(@Nullable CompoundTag intent) { this.addComponent(buttonPositive); int negativeWidth = Math.max(20, Minecraft.getInstance().font.width(negativeText)); - buttonNegative = new dev.ultreon.devices.api.app.component.Button(getWidth() - DIVIDE_WIDTH - positiveWidth - DIVIDE_WIDTH - negativeWidth + 1, getHeight() - 20, negativeText); + buttonNegative = new Button(getWidth() - DIVIDE_WIDTH - positiveWidth - DIVIDE_WIDTH - negativeWidth + 1, getHeight() - 20, negativeText); buttonNegative.setSize(negativeWidth + 10, 16); buttonNegative.setClickListener((mouseX, mouseY, mouseButton) -> { if (negativeListener != null) { @@ -343,8 +341,8 @@ public static class Input extends Dialog { private ResponseHandler responseListener; private TextField textFieldInput; - private dev.ultreon.devices.api.app.component.Button buttonPositive; - private dev.ultreon.devices.api.app.component.Button buttonNegative; + private Button buttonPositive; + private Button buttonNegative; public Input() { } @@ -380,7 +378,7 @@ public void init(@Nullable CompoundTag intent) { this.addComponent(textFieldInput); int positiveWidth = Minecraft.getInstance().font.width(positiveText); - buttonPositive = new dev.ultreon.devices.api.app.component.Button(getWidth() - positiveWidth - DIVIDE_WIDTH, getHeight() - 20, positiveText); + buttonPositive = new Button(getWidth() - positiveWidth - DIVIDE_WIDTH, getHeight() - 20, positiveText); buttonPositive.setSize(positiveWidth + 10, 16); buttonPositive.setClickListener((mouseX, mouseY, mouseButton) -> { if (!textFieldInput.getText().isEmpty()) { @@ -394,7 +392,7 @@ public void init(@Nullable CompoundTag intent) { this.addComponent(buttonPositive); int negativeWidth = Minecraft.getInstance().font.width(negativeText); - buttonNegative = new dev.ultreon.devices.api.app.component.Button(getWidth() - DIVIDE_WIDTH - positiveWidth - DIVIDE_WIDTH - negativeWidth + 1, getHeight() - 20, negativeText); + buttonNegative = new Button(getWidth() - DIVIDE_WIDTH - positiveWidth - DIVIDE_WIDTH - negativeWidth + 1, getHeight() - 20, negativeText); buttonNegative.setSize(negativeWidth + 10, 16); buttonNegative.setClickListener((mouseX, mouseY, mouseButton) -> close()); this.addComponent(buttonNegative); @@ -470,8 +468,8 @@ public static class OpenFile extends Dialog { private Layout main; private FileBrowser browser; - private dev.ultreon.devices.api.app.component.Button buttonPositive; - private dev.ultreon.devices.api.app.component.Button buttonNegative; + private Button buttonPositive; + private Button buttonNegative; private ResponseHandler responseListener; private Predicate filter; @@ -500,7 +498,7 @@ public void init(@Nullable CompoundTag intent) { main.addComponent(browser); int positiveWidth = Minecraft.getInstance().font.width(positiveText); - buttonPositive = new dev.ultreon.devices.api.app.component.Button(172, 106, positiveText); + buttonPositive = new Button(172, 106, positiveText); buttonPositive.setSize(positiveWidth + 10, 16); buttonPositive.setEnabled(false); buttonPositive.setClickListener((mouseX, mouseY, mouseButton) -> { @@ -518,7 +516,7 @@ public void init(@Nullable CompoundTag intent) { main.addComponent(buttonPositive); int negativeWidth = Minecraft.getInstance().font.width(negativeText); - buttonNegative = new dev.ultreon.devices.api.app.component.Button(125, 106, negativeText); + buttonNegative = new Button(125, 106, negativeText); buttonNegative.setSize(negativeWidth + 10, 16); buttonNegative.setClickListener((mouseX, mouseY, mouseButton) -> close()); main.addComponent(buttonNegative); @@ -592,8 +590,8 @@ public static class SaveFile extends Dialog { private Layout main; private FileBrowser browser; private TextField textFieldFileName; - private dev.ultreon.devices.api.app.component.Button buttonPositive; - private dev.ultreon.devices.api.app.component.Button buttonNegative; + private Button buttonPositive; + private Button buttonNegative; private Predicate filter; private String path = FileSystem.DIR_HOME; @@ -621,7 +619,7 @@ public void init(@Nullable CompoundTag intent) { browser.openFolder(path); main.addComponent(browser); - buttonPositive = new dev.ultreon.devices.api.app.component.Button(172, 125, positiveText); + buttonPositive = new Button(172, 125, positiveText); buttonPositive.setClickListener((mouseX, mouseY, mouseButton) -> { if (mouseButton == 0) { if (!textFieldFileName.getText().isEmpty()) { @@ -665,7 +663,7 @@ public void init(@Nullable CompoundTag intent) { }); main.addComponent(buttonPositive); - buttonNegative = new dev.ultreon.devices.api.app.component.Button(126, 125, negativeText); + buttonNegative = new Button(126, 125, negativeText); buttonNegative.setClickListener((mouseX, mouseY, mouseButton) -> close()); main.addComponent(buttonNegative); @@ -748,12 +746,12 @@ public static class Print extends Dialog { private final IPrint print; private Layout layoutMain; - private Label labelMessage; - private dev.ultreon.devices.api.app.component.Button buttonRefresh; + private dev.ultreon.devices.impl.app.component.Label labelMessage; + private Button buttonRefresh; private ItemList itemListPrinters; - private dev.ultreon.devices.api.app.component.Button buttonPrint; - private dev.ultreon.devices.api.app.component.Button buttonCancel; - private dev.ultreon.devices.api.app.component.Button buttonInfo; + private Button buttonPrint; + private Button buttonCancel; + private Button buttonInfo; public Print(IPrint print) { this.print = print; @@ -766,10 +764,10 @@ public void init(@Nullable CompoundTag intent) { layoutMain = new Layout(150, 132); - labelMessage = new Label("Select a Printer", 5, 5); + labelMessage = new dev.ultreon.devices.impl.app.component.Label("Select a Printer", 5, 5); layoutMain.addComponent(labelMessage); - buttonRefresh = new dev.ultreon.devices.api.app.component.Button(131, 2, Icons.RELOAD); + buttonRefresh = new Button(131, 2, Icons.RELOAD); buttonRefresh.setPadding(2); buttonRefresh.setToolTip("Refresh", "Retrieve an updated list of printers"); buttonRefresh.setClickListener((mouseX, mouseY, mouseButton) -> { @@ -784,10 +782,10 @@ public void init(@Nullable CompoundTag intent) { itemListPrinters.setListItemRenderer(new ListItemRenderer<>(16) { @Override public void render(GuiGraphics graphics, NetworkDevice networkDevice, Minecraft mc, int x, int y, int width, int height, boolean selected) { - ColorScheme colorScheme = MineOS.getOpened().getSettings().getColorScheme(); + ColorScheme colorScheme = MineOS.get().getSettings().getColorScheme(); graphics.fill(x, y, x + width, y + height, selected ? colorScheme.getItemHighlightColor() : colorScheme.getItemBackgroundColor()); Icons.PRINTER.draw(graphics, mc, x + 3, y + 3); - RenderUtil.drawStringClipped(graphics, networkDevice.getName(), x + 18, y + 4, 118, MineOS.getOpened().getSettings().getColorScheme().getTextColor(), true); + RenderUtil.drawStringClipped(graphics, networkDevice.getName(), x + 18, y + 4, 118, MineOS.get().getSettings().getColorScheme().getTextColor(), true); } }); itemListPrinters.setItemClickListener((blockPos, index, mouseButton) -> { @@ -797,7 +795,7 @@ public void render(GuiGraphics graphics, NetworkDevice networkDevice, Minecraft } }); itemListPrinters.sortBy((o1, o2) -> { - BlockPos laptopPos = MineOS.getOpened().getPos(); + BlockPos laptopPos = MineOS.get().getPos(); assert laptopPos != null; BlockPos pos1 = o1.getPos(); @@ -812,14 +810,14 @@ public void render(GuiGraphics graphics, NetworkDevice networkDevice, Minecraft }); layoutMain.addComponent(itemListPrinters); - buttonPrint = new dev.ultreon.devices.api.app.component.Button(98, 108, "Print", Icons.CHECK); + buttonPrint = new Button(98, 108, "Print", Icons.CHECK); buttonPrint.setPadding(5); buttonPrint.setEnabled(false); buttonPrint.setClickListener((mouseX, mouseY, mouseButton) -> { if (mouseButton == 0) { NetworkDevice networkDevice = itemListPrinters.getSelectedItem(); if (networkDevice != null) { - TaskPrint task = new TaskPrint(MineOS.getOpened().getPos(), networkDevice, print); + TaskPrint task = new TaskPrint(MineOS.get().getPos(), networkDevice, print); task.setCallback((tag, success) -> { if (success) { close(); @@ -831,7 +829,7 @@ public void render(GuiGraphics graphics, NetworkDevice networkDevice, Minecraft }); layoutMain.addComponent(buttonPrint); - buttonCancel = new dev.ultreon.devices.api.app.component.Button(74, 108, Icons.CROSS); + buttonCancel = new Button(74, 108, Icons.CROSS); buttonCancel.setPadding(5); buttonCancel.setClickListener((mouseX, mouseY, mouseButton) -> { if (mouseButton == 0) { @@ -840,7 +838,7 @@ public void render(GuiGraphics graphics, NetworkDevice networkDevice, Minecraft }); layoutMain.addComponent(buttonCancel); - buttonInfo = new dev.ultreon.devices.api.app.component.Button(5, 108, Icons.HELP); + buttonInfo = new Button(5, 108, Icons.HELP); buttonInfo.setEnabled(false); buttonInfo.setPadding(5); buttonInfo.setClickListener((mouseX, mouseY, mouseButton) -> { @@ -862,7 +860,7 @@ public void render(GuiGraphics graphics, NetworkDevice networkDevice, Minecraft private void getPrinters(ItemList itemList) { itemList.removeAll(); itemList.setLoading(true); - Task task = new TaskGetDevices(MineOS.getOpened().getPos(), DeviceBlockEntities.PRINTER.get()); + Task task = new TaskGetDevices(MineOS.get().getPos(), DeviceBlockEntities.PRINTER.get()); task.setCallback((tag, success) -> { if (success) { assert tag != null; @@ -884,11 +882,11 @@ private static class Info extends Dialog { private final NetworkDevice entry; private Layout layoutMain; - private Label labelName; - private Image imagePaper; - private Label labelPaper; - private Label labelPosition; - private dev.ultreon.devices.api.app.component.Button buttonClose; + private dev.ultreon.devices.impl.app.component.Label labelName; + private dev.ultreon.devices.impl.app.component.Image imagePaper; + private dev.ultreon.devices.impl.app.component.Label labelPaper; + private dev.ultreon.devices.impl.app.component.Label labelPosition; + private Button buttonClose; private Info(NetworkDevice entry) { this.entry = entry; @@ -901,17 +899,17 @@ public void init(@Nullable CompoundTag intent) { layoutMain = new Layout(120, 70); - labelName = new Label(ChatFormatting.GOLD.toString() + ChatFormatting.BOLD + entry.getName(), 5, 5); + labelName = new dev.ultreon.devices.impl.app.component.Label(ChatFormatting.GOLD.toString() + ChatFormatting.BOLD + entry.getName(), 5, 5); layoutMain.addComponent(labelName); - labelPaper = new Label(ChatFormatting.DARK_GRAY + "Paper: " + ChatFormatting.RESET + 0, 5, 18); //TODO fix paper count + labelPaper = new dev.ultreon.devices.impl.app.component.Label(ChatFormatting.DARK_GRAY + "Paper: " + ChatFormatting.RESET + 0, 5, 18); //TODO fix paper count labelPaper.setAlignment(Component.ALIGN_LEFT); labelPaper.setShadow(false); layoutMain.addComponent(labelPaper); assert entry.getPos() != null; String position = ChatFormatting.DARK_GRAY + "X: " + ChatFormatting.RESET + entry.getPos().getX() + " " + ChatFormatting.DARK_GRAY + "Y: " + ChatFormatting.RESET + entry.getPos().getY() + " " + ChatFormatting.DARK_GRAY + "Z: " + ChatFormatting.RESET + entry.getPos().getZ(); - labelPosition = new Label(position, 5, 30); + labelPosition = new dev.ultreon.devices.impl.app.component.Label(position, 5, 30); labelPosition.setShadow(false); layoutMain.addComponent(labelPosition); diff --git a/common/src/main/java/dev/ultreon/devices/api/app/Icons.java b/common/src/mineos/java/dev/ultreon/mineos/api/Icons.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/api/app/Icons.java rename to common/src/mineos/java/dev/ultreon/mineos/api/Icons.java index aac1257a1..db4acf363 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/Icons.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/Icons.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/Layout.java b/common/src/mineos/java/dev/ultreon/mineos/api/Layout.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/Layout.java rename to common/src/mineos/java/dev/ultreon/mineos/api/Layout.java index 530bdfe97..7b805205b 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/Layout.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/Layout.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.listener.InitListener; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.listener.InitListener; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.Wrappable; import dev.ultreon.devices.util.GLHelper; import net.minecraft.client.Minecraft; @@ -29,11 +29,11 @@ * @author MrCrayfish */ @SuppressWarnings("unused") -public class Layout extends dev.ultreon.devices.api.app.Component { +public class Layout extends dev.ultreon.mineos.api.Component { /** * The list of components in the layout */ - public List components; + public List components; /** * The width of the layout diff --git a/common/src/main/java/dev/ultreon/devices/api/app/Notification.java b/common/src/mineos/java/dev/ultreon/mineos/api/Notification.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/api/app/Notification.java rename to common/src/mineos/java/dev/ultreon/mineos/api/Notification.java index dc06b6b52..3d5957293 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/Notification.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/Notification.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.core.client.ClientNotification; import dev.ultreon.devices.network.PacketHandler; import dev.ultreon.devices.network.task.NotificationPacket; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/ScrollableLayout.java b/common/src/mineos/java/dev/ultreon/mineos/api/ScrollableLayout.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/api/app/ScrollableLayout.java rename to common/src/mineos/java/dev/ultreon/mineos/api/ScrollableLayout.java index dcfd52ecf..6bab24444 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/ScrollableLayout.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/ScrollableLayout.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; -import dev.ultreon.devices.api.app.component.Text; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.component.Text; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GLHelper; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/api/app/System.java b/common/src/mineos/java/dev/ultreon/mineos/api/System.java similarity index 90% rename from common/src/main/java/dev/ultreon/devices/api/app/System.java rename to common/src/mineos/java/dev/ultreon/mineos/api/System.java index c04f974cc..aae530c74 100644 --- a/common/src/main/java/dev/ultreon/devices/api/app/System.java +++ b/common/src/mineos/java/dev/ultreon/mineos/api/System.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.api.app; +package dev.ultreon.mineos.api; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.mineos.client.Settings; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.mineos.userspace.Settings; +import dev.ultreon.mineos.object.AppInfo; import it.unimi.dsi.fastutil.Pair; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/mineos/java/dev/ultreon/mineos/api/SystemAccessor.java b/common/src/mineos/java/dev/ultreon/mineos/api/SystemAccessor.java new file mode 100644 index 000000000..a6088d987 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/api/SystemAccessor.java @@ -0,0 +1,7 @@ +package dev.ultreon.mineos.api; + +import dev.ultreon.mineos.MineOSSystem; + +public interface SystemAccessor { + void sendSystem(MineOSSystem system); +} diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/BoatRacersApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/BoatRacersApp.java similarity index 85% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/BoatRacersApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/BoatRacersApp.java index 8dddc32b4..e896a6fab 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/BoatRacersApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/BoatRacersApp.java @@ -1,18 +1,18 @@ -package dev.ultreon.devices.mineos.apps; +package dev.ultreon.mineos.apps; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.CheckBox; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.CheckBox; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.exception.WorldLessException; -import dev.ultreon.devices.object.Game; -import dev.ultreon.devices.object.TileGrid; -import dev.ultreon.devices.object.tiles.Tile; +import dev.ultreon.mineos.object.Game; +import dev.ultreon.mineos.object.TileGrid; +import dev.ultreon.mineos.object.tiles.Tile; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; @@ -101,7 +101,7 @@ public void onClose() { @Override public void onTick() { - if (MineOS.getOpened().isWorldLess()) { + if (MineOS.get().isWorldLess()) { return; } super.onTick(); diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/IconsApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/IconsApp.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/IconsApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/IconsApp.java index 6eba53434..1be78663e 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/IconsApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/IconsApp.java @@ -1,9 +1,8 @@ -package dev.ultreon.devices.mineos.apps; +package dev.ultreon.mineos.apps; -import dev.ultreon.devices.api.app.*; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.ComboBox; -import dev.ultreon.devices.mineos.apps.system.layout.StandardLayout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.ComboBox; +import dev.ultreon.mineos.apps.system.layout.StandardLayout; import net.minecraft.ChatFormatting; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/NoteStashApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/NoteStashApp.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/NoteStashApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/NoteStashApp.java index 30ad5a443..ca8106a58 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/NoteStashApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/NoteStashApp.java @@ -1,11 +1,10 @@ -package dev.ultreon.devices.mineos.apps; +package dev.ultreon.mineos.apps; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.*; -import dev.ultreon.devices.api.io.File; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.io.File; import dev.ultreon.devices.core.io.FileSystem; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/PixelPainterApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/PixelPainterApp.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/PixelPainterApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/PixelPainterApp.java index 25200dc8c..4afa8c18d 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/PixelPainterApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/PixelPainterApp.java @@ -1,28 +1,26 @@ -package dev.ultreon.devices.mineos.apps; +package dev.ultreon.mineos.apps; import com.mojang.blaze3d.platform.NativeImage; import com.mojang.blaze3d.platform.TextureUtil; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import dev.ultreon.devices.Reference; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.*; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.TextField; -import dev.ultreon.devices.api.app.component.*; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.apps.system.layout.StandardLayout; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.component.TextField; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.apps.system.layout.StandardLayout; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.object.Canvas; -import dev.ultreon.devices.object.ColorGrid; -import dev.ultreon.devices.object.Picture; +import dev.ultreon.mineos.object.Canvas; +import dev.ultreon.mineos.object.ColorGrid; +import dev.ultreon.mineos.object.Picture; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; @@ -69,7 +67,7 @@ public class PixelPainterApp extends Application { /* Drawing */ private Layout layoutDraw; - private dev.ultreon.devices.object.Canvas canvas; + private dev.ultreon.mineos.object.Canvas canvas; private ButtonToggle btnPencil; private ButtonToggle btnBucket; private ButtonToggle btnEraser; @@ -272,23 +270,23 @@ public void render(GuiGraphics graphics, Picture picture, Minecraft mc, int x, i layoutDraw = new Layout(213, 140); - canvas = new dev.ultreon.devices.object.Canvas(5, 5); + canvas = new dev.ultreon.mineos.object.Canvas(5, 5); layoutDraw.addComponent(canvas); RadioGroup toolGroup = new RadioGroup(); btnPencil = new ButtonToggle(138, 5, PIXEL_PAINTER_ICONS, 0, 0, 10, 10); - btnPencil.setClickListener((mouseX, mouseY, mouseButton) -> canvas.setCurrentTool(Canvas.PENCIL)); + btnPencil.setClickListener((mouseX, mouseY, mouseButton) -> canvas.setCurrentTool(dev.ultreon.mineos.object.Canvas.PENCIL)); btnPencil.setRadioGroup(toolGroup); layoutDraw.addComponent(btnPencil); btnBucket = new ButtonToggle(138, 24, PIXEL_PAINTER_ICONS, 10, 0, 10, 10); - btnBucket.setClickListener((mouseX, mouseY, mouseButton) -> canvas.setCurrentTool(Canvas.BUCKET)); + btnBucket.setClickListener((mouseX, mouseY, mouseButton) -> canvas.setCurrentTool(dev.ultreon.mineos.object.Canvas.BUCKET)); btnBucket.setRadioGroup(toolGroup); layoutDraw.addComponent(btnBucket); btnEraser = new ButtonToggle(138, 43, PIXEL_PAINTER_ICONS, 20, 0, 10, 10); - btnEraser.setClickListener((mouseX, mouseY, mouseButton) -> canvas.setCurrentTool(Canvas.ERASER)); + btnEraser.setClickListener((mouseX, mouseY, mouseButton) -> canvas.setCurrentTool(dev.ultreon.mineos.object.Canvas.ERASER)); btnEraser.setRadioGroup(toolGroup); layoutDraw.addComponent(btnEraser); diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/TestApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/TestApp.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/TestApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/TestApp.java index ed8dead6a..bc4704a19 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/TestApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/TestApp.java @@ -1,9 +1,9 @@ -package dev.ultreon.devices.mineos.apps; +package dev.ultreon.mineos.apps; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.component.Button; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.component.Button; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/AuctionManager.java b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/AuctionManager.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/auction/AuctionManager.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/auction/AuctionManager.java index 43ed121c9..2e8e45321 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/AuctionManager.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/AuctionManager.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.auction; +package dev.ultreon.mineos.apps.auction; -import dev.ultreon.devices.mineos.apps.auction.object.AuctionItem; +import dev.ultreon.mineos.apps.auction.object.AuctionItem; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/MineBayApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/MineBayApp.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/auction/MineBayApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/auction/MineBayApp.java index df648ab0e..22fa5b79d 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/MineBayApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/MineBayApp.java @@ -1,21 +1,20 @@ -package dev.ultreon.devices.mineos.apps.auction; +package dev.ultreon.mineos.apps.auction; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.*; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.apps.auction.object.AuctionItem; -import dev.ultreon.devices.mineos.apps.auction.task.TaskAddAuction; -import dev.ultreon.devices.mineos.apps.auction.task.TaskBuyItem; -import dev.ultreon.devices.mineos.apps.auction.task.TaskGetAuctions; -import dev.ultreon.devices.mineos.apps.system.layout.StandardLayout; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.apps.auction.object.AuctionItem; +import dev.ultreon.mineos.apps.auction.task.TaskAddAuction; +import dev.ultreon.mineos.apps.auction.task.TaskBuyItem; +import dev.ultreon.mineos.apps.auction.task.TaskGetAuctions; +import dev.ultreon.mineos.apps.system.layout.StandardLayout; import dev.ultreon.devices.util.TimeUtil; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/object/AuctionItem.java b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/object/AuctionItem.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/auction/object/AuctionItem.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/auction/object/AuctionItem.java index c708471d8..dfbea4ff8 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/object/AuctionItem.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/object/AuctionItem.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.auction.object; +package dev.ultreon.mineos.apps.auction.object; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskAddAuction.java b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskAddAuction.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskAddAuction.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskAddAuction.java index 3b75a202a..577aeed26 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskAddAuction.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskAddAuction.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.auction.task; +package dev.ultreon.mineos.apps.auction.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.auction.AuctionManager; -import dev.ultreon.devices.mineos.apps.auction.object.AuctionItem; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.auction.AuctionManager; +import dev.ultreon.mineos.apps.auction.object.AuctionItem; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskBuyItem.java b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskBuyItem.java similarity index 80% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskBuyItem.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskBuyItem.java index 3ebad2b73..03f9e7883 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskBuyItem.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskBuyItem.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.mineos.apps.auction.task; +package dev.ultreon.mineos.apps.auction.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.mineos.apps.auction.AuctionManager; -import dev.ultreon.devices.mineos.apps.auction.object.AuctionItem; -import dev.ultreon.devices.mineos.apps.system.object.Account; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.mineos.apps.auction.AuctionManager; +import dev.ultreon.mineos.apps.auction.object.AuctionItem; +import dev.ultreon.mineos.apps.system.object.Account; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskGetAuctions.java b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskGetAuctions.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskGetAuctions.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskGetAuctions.java index 73acb7447..62ff0f818 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/auction/task/TaskGetAuctions.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/auction/task/TaskGetAuctions.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.auction.task; +package dev.ultreon.mineos.apps.auction.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.auction.AuctionManager; -import dev.ultreon.devices.mineos.apps.auction.object.AuctionItem; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.auction.AuctionManager; +import dev.ultreon.mineos.apps.auction.object.AuctionItem; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/debug/TextAreaApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/debug/TextAreaApp.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/debug/TextAreaApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/debug/TextAreaApp.java index 8f47a1657..7cd1cabf4 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/debug/TextAreaApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/debug/TextAreaApp.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.mineos.apps.debug; - -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.ButtonToggle; -import dev.ultreon.devices.api.app.component.TextArea; -import dev.ultreon.devices.api.app.interfaces.IHighlight; +package dev.ultreon.mineos.apps.debug; + +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.ButtonToggle; +import dev.ultreon.devices.impl.app.component.TextArea; +import dev.ultreon.devices.impl.app.interfaces.IHighlight; import net.minecraft.ChatFormatting; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/EmailApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailApp.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/EmailApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailApp.java index 6f2c3e06c..750e39192 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/EmailApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailApp.java @@ -1,27 +1,25 @@ -package dev.ultreon.devices.mineos.apps.email; +package dev.ultreon.mineos.apps.email; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.Resources; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.*; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.TextArea; -import dev.ultreon.devices.api.app.component.TextField; -import dev.ultreon.devices.api.app.component.*; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.apps.email.task.TaskRegisterEmailAccount; -import dev.ultreon.devices.mineos.apps.email.task.*; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.email.object.Contact; -import dev.ultreon.devices.mineos.apps.email.object.Email; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.component.TextArea; +import dev.ultreon.devices.impl.app.component.TextField; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.apps.email.task.*; +import dev.ultreon.devices.os.mineos.apps.email.task.*; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.email.object.Contact; +import dev.ultreon.mineos.apps.email.object.Email; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -213,7 +211,7 @@ public void init(@Nullable CompoundTag intent) { RenderSystem.setShaderTexture(0, ENDER_MAIL_BACKGROUND); RenderUtil.drawRectWithTexture(ENDER_MAIL_BACKGROUND, graphics, x, y, 0, 0, width, height, 640, 360, 640, 360); - Color temp = new Color(MineOS.getOpened().getSettings().getColorScheme().getBackgroundColor()); + Color temp = new Color(MineOS.get().getSettings().getColorScheme().getBackgroundColor()); Color color = new Color(temp.getRed(), temp.getGreen(), temp.getBlue(), 150); graphics.fill(x, y, x + 125, y + height, color.getRGB()); graphics.fill(x + 125, y, x + 126, y + height, color.darker().getRGB()); diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/EmailManager.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailManager.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/EmailManager.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailManager.java index 1c0b7a4f4..2f0c5884a 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/EmailManager.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/EmailManager.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.mineos.apps.email; +package dev.ultreon.mineos.apps.email; import com.google.common.collect.HashBiMap; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.WorldSavedData; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Notification; -import dev.ultreon.devices.mineos.apps.email.object.Email; +import dev.ultreon.devices.impl.WorldSavedData; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Notification; +import dev.ultreon.mineos.apps.email.object.Email; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/object/Contact.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Contact.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/object/Contact.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Contact.java index 68757fb1e..68ef66ffe 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/object/Contact.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Contact.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.email.object; +package dev.ultreon.mineos.apps.email.object; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/object/Email.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Email.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/object/Email.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Email.java index 8ad75039c..499a89335 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/object/Email.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/object/Email.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.email.object; +package dev.ultreon.mineos.apps.email.object; -import dev.ultreon.devices.api.io.File; +import dev.ultreon.devices.impl.io.File; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskCheckEmailAccount.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskCheckEmailAccount.java similarity index 85% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskCheckEmailAccount.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskCheckEmailAccount.java index da729ac5c..836b3392b 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskCheckEmailAccount.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskCheckEmailAccount.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.email.task; +package dev.ultreon.mineos.apps.email.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.email.EmailManager; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.email.EmailManager; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskDeleteEmail.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskDeleteEmail.java similarity index 81% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskDeleteEmail.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskDeleteEmail.java index 2abbc40d2..4720b3fab 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskDeleteEmail.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskDeleteEmail.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.email.task; +package dev.ultreon.mineos.apps.email.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.email.EmailManager; -import dev.ultreon.devices.mineos.apps.email.object.Email; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.email.EmailManager; +import dev.ultreon.mineos.apps.email.object.Email; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskRegisterEmailAccount.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskRegisterEmailAccount.java similarity index 85% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskRegisterEmailAccount.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskRegisterEmailAccount.java index 66f1c83f8..19ffb68b0 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskRegisterEmailAccount.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskRegisterEmailAccount.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.email.task; +package dev.ultreon.mineos.apps.email.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.email.EmailManager; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.email.EmailManager; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskSendEmail.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskSendEmail.java similarity index 84% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskSendEmail.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskSendEmail.java index 1953adb6a..ad2132234 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskSendEmail.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskSendEmail.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.email.task; +package dev.ultreon.mineos.apps.email.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.email.EmailManager; -import dev.ultreon.devices.mineos.apps.email.object.Email; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.email.EmailManager; +import dev.ultreon.mineos.apps.email.object.Email; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskUpdateInbox.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskUpdateInbox.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskUpdateInbox.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskUpdateInbox.java index d9eb320db..28bf51a1e 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskUpdateInbox.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskUpdateInbox.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.email.task; +package dev.ultreon.mineos.apps.email.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.email.EmailManager; -import dev.ultreon.devices.mineos.apps.email.object.Email; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.email.EmailManager; +import dev.ultreon.mineos.apps.email.object.Email; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskViewEmail.java b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskViewEmail.java similarity index 82% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskViewEmail.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskViewEmail.java index 9fefd4c3f..44eca8778 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/email/task/TaskViewEmail.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/email/task/TaskViewEmail.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.email.task; +package dev.ultreon.mineos.apps.email.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.mineos.apps.email.EmailManager; -import dev.ultreon.devices.mineos.apps.email.object.Email; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.mineos.apps.email.EmailManager; +import dev.ultreon.mineos.apps.email.object.Email; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/example/ExampleApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/example/ExampleApp.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/example/ExampleApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/example/ExampleApp.java index 8fdb46959..da298ab47 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/example/ExampleApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/example/ExampleApp.java @@ -1,10 +1,9 @@ -package dev.ultreon.devices.mineos.apps.example; +package dev.ultreon.mineos.apps.example; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.component.*; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.mineos.apps.example.task.TaskNotificationTest; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.mineos.apps.example.task.TaskNotificationTest; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/example/task/TaskNotificationTest.java b/common/src/mineos/java/dev/ultreon/mineos/apps/example/task/TaskNotificationTest.java similarity index 84% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/example/task/TaskNotificationTest.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/example/task/TaskNotificationTest.java index 2dbd0f47b..7f8ff61b0 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/example/task/TaskNotificationTest.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/example/task/TaskNotificationTest.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.example.task; +package dev.ultreon.mineos.apps.example.task; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Notification; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Notification; +import dev.ultreon.devices.impl.task.Task; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/GitWebApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/GitWebApp.java similarity index 85% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/GitWebApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/GitWebApp.java index 82edfb514..2f83f2e52 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/GitWebApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/GitWebApp.java @@ -1,15 +1,14 @@ -package dev.ultreon.devices.mineos.apps.gitweb; - -import dev.ultreon.devices.api.app.*; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Spinner; -import dev.ultreon.devices.api.app.component.TextField; -import dev.ultreon.devices.mineos.apps.system.SettingsApp; -import dev.ultreon.devices.mineos.apps.system.layout.StandardLayout; -import dev.ultreon.devices.mineos.MineOSSystem; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; -import dev.ultreon.devices.mineos.apps.gitweb.layout.TextLayout; +package dev.ultreon.mineos.apps.gitweb; + +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Spinner; +import dev.ultreon.devices.impl.app.component.TextField; +import dev.ultreon.mineos.apps.system.SettingsApp; +import dev.ultreon.mineos.apps.system.layout.StandardLayout; +import dev.ultreon.mineos.MineOSSystem; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.mineos.apps.gitweb.layout.TextLayout; import dev.ultreon.devices.util.DataHandler; import net.minecraft.nbt.CompoundTag; @@ -44,7 +43,7 @@ public Optional getSystem() { public void init(@Nullable CompoundTag intent) { layoutBrowser = new StandardLayout(null, 362, 240, this, null); layoutBrowser.setBackground((graphics, mc, x, y, width, height, mouseX, mouseY, windowActive) -> { - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getItemBackgroundColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getItemBackgroundColor()); graphics.fill(x, y + 21, x + width, y + 164, color.getRGB()); }); diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/GitWebFrame.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/GitWebFrame.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/GitWebFrame.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/GitWebFrame.java index 1cc91d8f3..8cc4151d4 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/GitWebFrame.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/GitWebFrame.java @@ -1,18 +1,18 @@ -package dev.ultreon.devices.mineos.apps.gitweb.component; - -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.ScrollableLayout; -import dev.ultreon.devices.api.app.component.Text; -import dev.ultreon.devices.api.task.Callback; -import dev.ultreon.devices.api.utils.OnlineRequest; -import dev.ultreon.devices.mineos.apps.gitweb.layout.ModuleLayout; -import dev.ultreon.devices.mineos.apps.gitweb.module.LoomModule; -import dev.ultreon.devices.mineos.apps.gitweb.module.Module; +package dev.ultreon.mineos.apps.gitweb.component; + +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.ScrollableLayout; +import dev.ultreon.devices.impl.app.component.Text; +import dev.ultreon.devices.impl.task.Callback; +import dev.ultreon.devices.impl.utils.OnlineRequest; +import dev.ultreon.mineos.apps.gitweb.layout.ModuleLayout; +import dev.ultreon.mineos.apps.gitweb.module.*; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.mineos.apps.gitweb.module.*; +import dev.ultreon.devices.os.mineos.apps.gitweb.module.*; import dev.ultreon.devices.util.SiteRegistration; +import dev.ultreon.mineos.apps.gitweb.module.Module; import net.minecraft.client.Minecraft; import java.io.BufferedWriter; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/AnvilBox.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/AnvilBox.java similarity index 88% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/AnvilBox.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/AnvilBox.java index f477fcd97..04aa72185 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/AnvilBox.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/AnvilBox.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.gitweb.component.container; +package dev.ultreon.mineos.apps.gitweb.component.container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/BrewingBox.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/BrewingBox.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/BrewingBox.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/BrewingBox.java index 684aeca94..e0475e463 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/BrewingBox.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/BrewingBox.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.component.container; +package dev.ultreon.mineos.apps.gitweb.component.container; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.ItemStack; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/ContainerBox.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/ContainerBox.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/ContainerBox.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/ContainerBox.java index f7c23ad87..e3f14288a 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/ContainerBox.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/ContainerBox.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.mineos.apps.gitweb.component.container; +package dev.ultreon.mineos.apps.gitweb.component.container; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.Reference; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/CraftingBox.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/CraftingBox.java similarity index 91% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/CraftingBox.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/CraftingBox.java index 824ec3812..f7b9fd360 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/CraftingBox.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/CraftingBox.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.gitweb.component.container; +package dev.ultreon.mineos.apps.gitweb.component.container; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/FurnaceBox.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/FurnaceBox.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/FurnaceBox.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/FurnaceBox.java index 984269a02..fb86477d9 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/FurnaceBox.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/FurnaceBox.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.gitweb.component.container; +package dev.ultreon.mineos.apps.gitweb.component.container; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.ItemStack; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/LoomBox.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/LoomBox.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/LoomBox.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/LoomBox.java index 7df138de9..45d63dc36 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/component/container/LoomBox.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/component/container/LoomBox.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.gitweb.component.container; +package dev.ultreon.mineos.apps.gitweb.component.container; import com.mojang.blaze3d.platform.Lighting; import com.mojang.datafixers.util.Pair; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.model.geom.ModelLayers; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/layout/ModuleLayout.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/ModuleLayout.java similarity index 77% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/layout/ModuleLayout.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/ModuleLayout.java index 92841b4de..53bdfbc78 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/layout/ModuleLayout.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/ModuleLayout.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.gitweb.layout; +package dev.ultreon.mineos.apps.gitweb.layout; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.apps.gitweb.module.ModuleEntry; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.mineos.apps.gitweb.module.ModuleEntry; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; public class ModuleLayout extends Layout { public ModuleEntry entry; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/layout/TextLayout.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/TextLayout.java similarity index 79% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/layout/TextLayout.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/TextLayout.java index a3f346198..1f0a2d1c7 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/layout/TextLayout.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/layout/TextLayout.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.layout; +package dev.ultreon.mineos.apps.gitweb.layout; -import dev.ultreon.devices.api.app.ScrollableLayout; -import dev.ultreon.devices.api.app.component.Text; +import dev.ultreon.devices.impl.app.ScrollableLayout; +import dev.ultreon.devices.impl.app.component.Text; /** * @author MrCrayfish diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/AnvilModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AnvilModule.java similarity index 82% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/AnvilModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AnvilModule.java index 903426ae5..ead3d7939 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/AnvilModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AnvilModule.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.ContainerBox; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.AnvilBox; +import dev.ultreon.mineos.apps.gitweb.component.container.ContainerBox; +import dev.ultreon.mineos.apps.gitweb.component.container.AnvilBox; import net.minecraft.world.item.ItemStack; import java.util.ArrayList; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/AppLinkModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AppLinkModule.java similarity index 76% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/AppLinkModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AppLinkModule.java index e12f55a25..3a06e5c8d 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/AppLinkModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/AppLinkModule.java @@ -1,14 +1,14 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.mineos.apps.gitweb.GitWebApp; -import dev.ultreon.devices.mineos.apps.system.AppStore; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.mineos.apps.gitweb.GitWebApp; +import dev.ultreon.mineos.apps.system.AppStore; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import net.minecraft.resources.ResourceLocation; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BannerIIModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerIIModule.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BannerIIModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerIIModule.java index e39f44845..f01522ddf 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BannerIIModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerIIModule.java @@ -1,12 +1,12 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; import com.mojang.blaze3d.platform.Lighting; import com.mojang.datafixers.util.Pair; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.model.geom.ModelLayers; @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; -import static dev.ultreon.devices.mineos.apps.gitweb.module.ContainerModule.getItem; +import static dev.ultreon.mineos.apps.gitweb.module.ContainerModule.getItem; public class BannerIIModule extends Module { @Override diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BannerModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerModule.java similarity index 76% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BannerModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerModule.java index d777f0bb4..daa5a2328 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BannerModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BannerModule.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BrewingModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BrewingModule.java similarity index 84% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BrewingModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BrewingModule.java index de0cfb831..6917a5638 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/BrewingModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/BrewingModule.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.ContainerBox; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.BrewingBox; +import dev.ultreon.mineos.apps.gitweb.component.container.ContainerBox; +import dev.ultreon.mineos.apps.gitweb.component.container.BrewingBox; import net.minecraft.world.item.ItemStack; import java.util.ArrayList; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ContainerModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ContainerModule.java similarity index 85% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ContainerModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ContainerModule.java index 9d1802f68..fa142fe00 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ContainerModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ContainerModule.java @@ -1,12 +1,12 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.Text; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.ContainerBox; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.CraftingBox; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.component.Text; +import dev.ultreon.mineos.apps.gitweb.component.container.ContainerBox; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.mineos.apps.gitweb.component.container.CraftingBox; import net.minecraft.ChatFormatting; import net.minecraft.nbt.TagParser; import net.minecraft.world.item.ItemStack; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/CraftingModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/CraftingModule.java similarity index 83% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/CraftingModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/CraftingModule.java index d04b42d7a..389ea99d3 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/CraftingModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/CraftingModule.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.ContainerBox; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.CraftingBox; +import dev.ultreon.mineos.apps.gitweb.component.container.ContainerBox; +import dev.ultreon.mineos.apps.gitweb.component.container.CraftingBox; import net.minecraft.world.item.ItemStack; import java.util.ArrayList; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/DividerModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DividerModule.java similarity index 83% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/DividerModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DividerModule.java index 317bc5eaf..511835ca5 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/DividerModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DividerModule.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/DownloadModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DownloadModule.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/DownloadModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DownloadModule.java index 59514c6ab..b1662e757 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/DownloadModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/DownloadModule.java @@ -1,16 +1,16 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.TagParser; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/FooterModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FooterModule.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/FooterModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FooterModule.java index 5ee05831a..8b640f9e0 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/FooterModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FooterModule.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.awt.*; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/FurnaceModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FurnaceModule.java similarity index 82% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/FurnaceModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FurnaceModule.java index ed99b2484..81d56a14f 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/FurnaceModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/FurnaceModule.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.ContainerBox; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.FurnaceBox; +import dev.ultreon.mineos.apps.gitweb.component.container.ContainerBox; +import dev.ultreon.mineos.apps.gitweb.component.container.FurnaceBox; import net.minecraft.world.item.ItemStack; import java.util.ArrayList; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/HeaderModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/HeaderModule.java similarity index 84% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/HeaderModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/HeaderModule.java index 5a6fecd69..f5a58a3f7 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/HeaderModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/HeaderModule.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/LoomModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/LoomModule.java similarity index 75% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/LoomModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/LoomModule.java index eac828d8a..ee945b85b 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/LoomModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/LoomModule.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.ContainerBox; -import dev.ultreon.devices.mineos.apps.gitweb.component.container.LoomBox; +import dev.ultreon.mineos.apps.gitweb.component.container.ContainerBox; +import dev.ultreon.mineos.apps.gitweb.component.container.LoomBox; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/Module.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/Module.java similarity index 73% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/Module.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/Module.java index 123cf372f..881e95c81 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/Module.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/Module.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.apps.gitweb.layout.ModuleLayout; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.mineos.apps.gitweb.layout.ModuleLayout; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ModuleEntry.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ModuleEntry.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ModuleEntry.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ModuleEntry.java index 6785e7aca..ad5e01a92 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ModuleEntry.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ModuleEntry.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/NavigationModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/NavigationModule.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/NavigationModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/NavigationModule.java index b96b1f3da..6caf2c539 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/NavigationModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/NavigationModule.java @@ -1,9 +1,9 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import org.jetbrains.annotations.Nullable; import java.awt.*; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ParagraphModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ParagraphModule.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ParagraphModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ParagraphModule.java index 000255afa..c0e2c3546 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ParagraphModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ParagraphModule.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.component.Text; -import dev.ultreon.devices.mineos.apps.gitweb.layout.ModuleLayout; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.app.component.Text; +import dev.ultreon.mineos.apps.gitweb.layout.ModuleLayout; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/RedirectModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/RedirectModule.java similarity index 79% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/RedirectModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/RedirectModule.java index 0bd4650fc..f57f82351 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/RedirectModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/RedirectModule.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.apps.gitweb.layout.ModuleLayout; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.mineos.apps.gitweb.layout.ModuleLayout; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.util.ArrayList; import java.util.List; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ScriptModule.java b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ScriptModule.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ScriptModule.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ScriptModule.java index 8bec700d7..c87f7edcf 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/gitweb/module/ScriptModule.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/gitweb/module/ScriptModule.java @@ -1,9 +1,9 @@ -package dev.ultreon.devices.mineos.apps.gitweb.module; +package dev.ultreon.mineos.apps.gitweb.module; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.apps.gitweb.layout.ModuleLayout; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.mineos.apps.gitweb.layout.ModuleLayout; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; import java.util.Map; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/snake/SnakeApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/snake/SnakeApp.java similarity index 79% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/snake/SnakeApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/snake/SnakeApp.java index 8e55679bf..a914115b9 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/snake/SnakeApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/snake/SnakeApp.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.mineos.apps.snake; - -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.mineos.apps.snake.layout.SnakeLayout; -import dev.ultreon.devices.mineos.client.MineOS; +package dev.ultreon.mineos.apps.snake; + +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.mineos.apps.snake.layout.SnakeLayout; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/snake/layout/SnakeLayout.java b/common/src/mineos/java/dev/ultreon/mineos/apps/snake/layout/SnakeLayout.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/snake/layout/SnakeLayout.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/snake/layout/SnakeLayout.java index 4fd944257..a9a068559 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/snake/layout/SnakeLayout.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/snake/layout/SnakeLayout.java @@ -1,13 +1,13 @@ -package dev.ultreon.devices.mineos.apps.snake.layout; +package dev.ultreon.mineos.apps.snake.layout; import com.mojang.blaze3d.platform.InputConstants; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.mineos.apps.snake.SnakeApp; +import dev.ultreon.mineos.apps.snake.SnakeApp; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/AppStore.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/AppStore.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/AppStore.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/AppStore.java index 4c6f2e0e6..ebf8367b1 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/AppStore.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/AppStore.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; import com.google.gson.Gson; import com.google.gson.JsonArray; @@ -6,24 +6,24 @@ import com.google.gson.reflect.TypeToken; import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.Reference; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.ScrollableLayout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.Spinner; -import dev.ultreon.devices.api.utils.OnlineRequest; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.object.TrayItem; -import dev.ultreon.devices.mineos.apps.system.component.AppGrid; -import dev.ultreon.devices.mineos.apps.system.layout.LayoutAppPage; -import dev.ultreon.devices.mineos.apps.system.layout.LayoutSearchApps; -import dev.ultreon.devices.mineos.apps.system.object.AppEntry; -import dev.ultreon.devices.mineos.apps.system.object.RemoteEntry; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.ScrollableLayout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.component.Spinner; +import dev.ultreon.devices.impl.utils.OnlineRequest; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.object.TrayItem; +import dev.ultreon.mineos.apps.system.component.AppGrid; +import dev.ultreon.mineos.apps.system.layout.LayoutAppPage; +import dev.ultreon.mineos.apps.system.layout.LayoutSearchApps; +import dev.ultreon.mineos.apps.system.object.AppEntry; +import dev.ultreon.mineos.apps.system.object.RemoteEntry; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.nbt.CompoundTag; @@ -55,7 +55,7 @@ public void init(@Nullable CompoundTag intent) { ScrollableLayout homePageLayout = new ScrollableLayout(0, 0, LAYOUT_WIDTH, 368-160+80*rows, LAYOUT_HEIGHT); homePageLayout.setScrollSpeed(10); homePageLayout.setBackground((graphics, mc, x, y, width, height, mouseX, mouseY, windowActive) -> { - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getBackgroundColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getBackgroundColor()); int offset = 60; graphics.fill(x, y + offset, x + LAYOUT_WIDTH, y + offset + 1, color.brighter().getRGB()); graphics.fill(x, y + offset + 1, x + LAYOUT_WIDTH, y + offset + 19, color.getRGB()); @@ -197,7 +197,7 @@ public StoreTrayItem() { public void handleClick(int mouseX, int mouseY, int mouseButton) { AppInfo info = ApplicationManager.getApplication(UltreonDevicesMod.id("app_store")); if (info != null) { - MineOS.getOpened().openApplication(info); + MineOS.get().openApplication(info); } } } diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/BankApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/BankApp.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/BankApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/BankApp.java index 2738624c3..504b1d398 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/BankApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/BankApp.java @@ -1,20 +1,20 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.Tesselator; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.Text; -import dev.ultreon.devices.api.app.component.TextField; -import dev.ultreon.devices.api.task.Callback; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.apps.system.task.TaskDeposit; -import dev.ultreon.devices.mineos.apps.system.task.TaskWithdraw; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.component.Text; +import dev.ultreon.devices.impl.app.component.TextField; +import dev.ultreon.devices.impl.task.Callback; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.apps.system.task.TaskDeposit; +import dev.ultreon.mineos.apps.system.task.TaskWithdraw; import dev.ultreon.devices.util.InventoryUtil; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/DiagnosticsApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/DiagnosticsApp.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/DiagnosticsApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/DiagnosticsApp.java index 8c20f9127..9eb495962 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/DiagnosticsApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/DiagnosticsApp.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.mineos.apps.system; - -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Text; -import dev.ultreon.devices.api.app.listener.ClickListener; -import dev.ultreon.devices.object.AppInfo; +package dev.ultreon.mineos.apps.system; + +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Text; +import dev.ultreon.devices.impl.app.listener.ClickListener; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.client.Minecraft; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/DisplayResolution.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/DisplayResolution.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/DisplayResolution.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/DisplayResolution.java index 0250bd365..9c6cfdf41 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/DisplayResolution.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/DisplayResolution.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; -import dev.ultreon.devices.api.video.CustomResolution; +import dev.ultreon.devices.impl.video.CustomResolution; import net.minecraft.nbt.CompoundTag; public interface DisplayResolution { diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/FileBrowserApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/FileBrowserApp.java similarity index 74% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/FileBrowserApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/FileBrowserApp.java index 477902e70..2a0f54778 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/FileBrowserApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/FileBrowserApp.java @@ -1,14 +1,14 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.mineos.apps.system.component.FileBrowser; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.mineos.apps.system.component.FileBrowser; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.core.io.FileSystem; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.object.TrayItem; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.object.TrayItem; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; @@ -47,7 +47,7 @@ public FileBrowserTrayItem() { public void handleClick(int mouseX, int mouseY, int mouseButton) { AppInfo info = ApplicationManager.getApplication(UltreonDevicesMod.id("file_browser")); if (info != null) { - MineOS.getOpened().openApplication(info); + MineOS.get().openApplication(info); } } } diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/PredefinedResolution.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/PredefinedResolution.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/PredefinedResolution.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/PredefinedResolution.java index b7829e8c1..753b80a2e 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/PredefinedResolution.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/PredefinedResolution.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import java.util.Collection; @@ -39,7 +39,7 @@ public int height() { } public static PredefinedResolution[] getResolutionList() { - Collection resolutionList = MineOS.getOpened().getVideoInfo().getResolutionList(); + Collection resolutionList = MineOS.get().getVideoInfo().getResolutionList(); if (resolutionList == null) { return new PredefinedResolution[0]; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/SettingsApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/SettingsApp.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/SettingsApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/SettingsApp.java index b7583c6f7..39486fefa 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/SettingsApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/SettingsApp.java @@ -1,27 +1,26 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; import com.google.common.base.CaseFormat; import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.Reference; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.ScrollableLayout; -import dev.ultreon.devices.api.app.component.*; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.renderer.ItemRenderer; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.utils.OnlineRequest; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.client.Settings; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.object.TrayItem; -import dev.ultreon.devices.mineos.apps.system.component.Palette; -import dev.ultreon.devices.mineos.apps.system.object.ColorScheme; -import dev.ultreon.devices.mineos.apps.system.object.ColorSchemePresetRegistry; -import dev.ultreon.devices.mineos.apps.system.object.Preset; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.ScrollableLayout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.app.renderer.ItemRenderer; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.utils.OnlineRequest; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.userspace.Settings; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.object.TrayItem; +import dev.ultreon.mineos.apps.system.component.Palette; +import dev.ultreon.mineos.apps.system.object.ColorScheme; +import dev.ultreon.mineos.apps.system.object.ColorSchemePresetRegistry; +import dev.ultreon.mineos.apps.system.object.Preset; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; @@ -57,7 +56,7 @@ public class SettingsApp extends SystemApp { private void resetColorSchemeClick(int mouseX, int mouseY, int mouseButton) { if (mouseButton == 0) { - MineOS.getOpened().getSettings().getColorScheme().resetDefault(); + MineOS.get().getSettings().getColorScheme().resetDefault(); } } @@ -249,7 +248,7 @@ private Layout createColorSchemesLayout() { list.setItemClickListener((preset, index, button) -> { if (preset == custom) preset = null; - MineOS.getOpened().getSettings().setPreset(preset); + MineOS.get().getSettings().setPreset(preset); }); list.setListItemRenderer(new ListItemRenderer<>(20) { @@ -276,31 +275,31 @@ private Layout createColorSchemeLayout() { layoutColorScheme.addComponent(backBtn); ComboBox.Custom comboBoxTextColor = createColorPicker(145, 26); - comboBoxTextColor.setValue(MineOS.getOpened().getSettings().getColorScheme().getTextColor()); + comboBoxTextColor.setValue(MineOS.get().getSettings().getColorScheme().getTextColor()); layoutColorScheme.addComponent(comboBoxTextColor); ComboBox.Custom comboBoxTextSecondaryColor = createColorPicker(145, 44); - comboBoxTextSecondaryColor.setValue(MineOS.getOpened().getSettings().getColorScheme().getTextSecondaryColor()); + comboBoxTextSecondaryColor.setValue(MineOS.get().getSettings().getColorScheme().getTextSecondaryColor()); layoutColorScheme.addComponent(comboBoxTextSecondaryColor); ComboBox.Custom comboBoxHeaderColor = createColorPicker(145, 62); - comboBoxHeaderColor.setValue(MineOS.getOpened().getSettings().getColorScheme().getHeaderColor()); + comboBoxHeaderColor.setValue(MineOS.get().getSettings().getColorScheme().getHeaderColor()); layoutColorScheme.addComponent(comboBoxHeaderColor); ComboBox.Custom comboBoxBackgroundColor = createColorPicker(145, 80); - comboBoxBackgroundColor.setValue(MineOS.getOpened().getSettings().getColorScheme().getBackgroundColor()); + comboBoxBackgroundColor.setValue(MineOS.get().getSettings().getColorScheme().getBackgroundColor()); layoutColorScheme.addComponent(comboBoxBackgroundColor); ComboBox.Custom comboBoxBackgroundSecondaryColor = createColorPicker(145, 98); - comboBoxBackgroundSecondaryColor.setValue(MineOS.getOpened().getSettings().getColorScheme().getBackgroundSecondaryColor()); + comboBoxBackgroundSecondaryColor.setValue(MineOS.get().getSettings().getColorScheme().getBackgroundSecondaryColor()); layoutColorScheme.addComponent(comboBoxBackgroundSecondaryColor); ComboBox.Custom comboBoxItemBackgroundColor = createColorPicker(145, 116); - comboBoxItemBackgroundColor.setValue(MineOS.getOpened().getSettings().getColorScheme().getItemBackgroundColor()); + comboBoxItemBackgroundColor.setValue(MineOS.get().getSettings().getColorScheme().getItemBackgroundColor()); layoutColorScheme.addComponent(comboBoxItemBackgroundColor); ComboBox.Custom comboBoxItemHighlightColor = createColorPicker(145, 134); - comboBoxItemHighlightColor.setValue(MineOS.getOpened().getSettings().getColorScheme().getItemHighlightColor()); + comboBoxItemHighlightColor.setValue(MineOS.get().getSettings().getColorScheme().getItemHighlightColor()); layoutColorScheme.addComponent(comboBoxItemHighlightColor); buttonColorSchemeApply = new Button(5, 79, Icons.CHECK); @@ -309,7 +308,7 @@ private Layout createColorSchemeLayout() { buttonColorSchemeApply.setClickListener((mouseX, mouseY, mouseButton) -> { if (mouseButton == 0) { - ColorScheme colorScheme = MineOS.getOpened().getSettings().getColorScheme(); + ColorScheme colorScheme = MineOS.get().getSettings().getColorScheme(); colorScheme.setTextColor(comboBoxTextColor.getValue()); colorScheme.setTextSecondaryColor(comboBoxTextSecondaryColor.getValue()); colorScheme.setHeaderColor(comboBoxHeaderColor.getValue()); @@ -472,7 +471,7 @@ public Menu(String title) { @Override public void render(GuiGraphics graphics, MineOS laptop, Minecraft mc, int x, int y, int mouseX, int mouseY, boolean windowActive, float partialTicks) { - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getHeaderColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getHeaderColor()); graphics.fill(x, y, x + width, y + 20, color.getRGB()); graphics.fill(x, y + 20, x + width, y + 21, color.darker().getRGB()); graphics.drawString(mc.font, title, x + 22, y + 6, Color.WHITE.getRGB()); @@ -510,7 +509,7 @@ public SettingsTrayItem() { public void handleClick(int mouseX, int mouseY, int mouseButton) { AppInfo info = ApplicationManager.getApplication(UltreonDevicesMod.id("settings")); if (info != null) { - MineOS.getOpened().openApplication(info); + MineOS.get().openApplication(info); } } } diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/SystemApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/SystemApp.java similarity index 70% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/SystemApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/SystemApp.java index ad4e2cfe6..bfd58936f 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/SystemApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/SystemApp.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.mineos.userspace.MineOS; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/VulnerabilityApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/VulnerabilityApp.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/VulnerabilityApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/VulnerabilityApp.java index 37a820e09..ec3f3889f 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/VulnerabilityApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/VulnerabilityApp.java @@ -1,16 +1,15 @@ -package dev.ultreon.devices.mineos.apps.system; +package dev.ultreon.mineos.apps.system; import com.jab125.version.VersionPredicate; import com.jab125.version.VersionPredicateParser; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.*; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.ItemList; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.util.Vulnerability; -import dev.ultreon.devices.api.utils.RenderUtil; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.ItemList; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.util.Vulnerability; +import dev.ultreon.devices.impl.utils.RenderUtil; import net.minecraft.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/AppGrid.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/AppGrid.java similarity index 76% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/AppGrid.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/component/AppGrid.java index 8b15d6026..17bfd9b84 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/AppGrid.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/AppGrid.java @@ -1,18 +1,18 @@ -package dev.ultreon.devices.mineos.apps.system.component; - -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.apps.system.AppStore; -import dev.ultreon.devices.mineos.apps.system.object.AppEntry; -import dev.ultreon.devices.mineos.apps.system.object.LocalEntry; -import dev.ultreon.devices.mineos.apps.system.object.RemoteEntry; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.AppInfo; +package dev.ultreon.mineos.apps.system.component; + +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.apps.system.AppStore; +import dev.ultreon.mineos.apps.system.object.AppEntry; +import dev.ultreon.mineos.apps.system.object.LocalEntry; +import dev.ultreon.mineos.apps.system.object.RemoteEntry; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.AppInfo; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -70,7 +70,7 @@ protected void render(GuiGraphics graphics, MineOS laptop, Minecraft mc, int x, int itemY = y + (i / horizontalItems) * (itemHeight + padding) + padding; if (GuiHelper.isMouseWithin(mouseX, mouseY, itemX, itemY, itemWidth, itemHeight)) { graphics.fill(itemX, itemY, itemX + itemWidth, itemY + itemHeight, Color.GRAY.getRGB()); - graphics.fill(itemX + 1, itemY + 1, itemX + itemWidth - 1, itemY + itemHeight - 1, MineOS.getOpened().getSettings().getColorScheme().getItemBackgroundColor()); + graphics.fill(itemX + 1, itemY + 1, itemX + itemWidth - 1, itemY + itemHeight - 1, MineOS.get().getSettings().getColorScheme().getItemBackgroundColor()); } } } @@ -119,11 +119,11 @@ private Layout generateAppTile(AppEntry entry, int left, int top) { int iconOffset = (itemWidth - 14 * 3) / 2; if (entry instanceof LocalEntry localEntry) { Image.AppImage appImage = new Image.AppImage(iconOffset, padding, 14*3, 14*3, localEntry.info()); - // dev.ultreon.devices.api.app.component.Image image = new dev.ultreon.devices.api.app.component.Image(iconOffset, padding, 14 * 3, 14 * 3, localEntry.info().getIconU(), localEntry.info().getIconV(), 14, 14, 224, 224, MineOS.ICON_TEXTURES); + // dev.ultreon.devices.api.component.app.Image image = new dev.ultreon.devices.api.component.app.Image(iconOffset, padding, 14 * 3, 14 * 3, localEntry.info().getIconU(), localEntry.info().getIconV(), 14, 14, 224, 224, MineOS.ICON_TEXTURES); layout.addComponent(appImage); } else if (entry instanceof RemoteEntry remoteEntry) { ResourceLocation resource = new ResourceLocation(remoteEntry.id); - dev.ultreon.devices.api.app.component.Image image = new dev.ultreon.devices.api.app.component.Image(iconOffset, padding, 14 * 3, 14 * 3, AppStore.CERTIFICATES_BASE_URL + "/assets/" + resource.getNamespace() + "/" + resource.getPath() + "/icon.png"); + Image image = new Image(iconOffset, padding, 14 * 3, 14 * 3, AppStore.CERTIFICATES_BASE_URL + "/assets/" + resource.getNamespace() + "/" + resource.getPath() + "/icon.png"); layout.addComponent(image); } @@ -139,14 +139,14 @@ private Layout generateAppTile(AppEntry entry, int left, int top) { layout.addComponent(labelAuthor); if (store.certifiedApps.contains(entry)) { - dev.ultreon.devices.api.app.component.Image certifiedIcon = new dev.ultreon.devices.api.app.component.Image(15, 38, Icons.VERIFIED); + Image certifiedIcon = new Image(15, 38, Icons.VERIFIED); layout.addComponent(certifiedIcon); } if (entry instanceof LocalEntry) { AppInfo info = ((LocalEntry) entry).info(); - if (MineOS.getOpened().getInstalledApplications().contains(info)) { - dev.ultreon.devices.api.app.component.Image installedIcon = new dev.ultreon.devices.api.app.component.Image(itemWidth - 10 - 15, 38, Icons.CHECK); + if (MineOS.get().getInstalledApplications().contains(info)) { + Image installedIcon = new Image(itemWidth - 10 - 15, 38, Icons.CHECK); layout.addComponent(installedIcon); } } @@ -163,8 +163,8 @@ private void reloadIcons(Layout layout) { layout.components.forEach(component -> { if (component instanceof Layout) { reloadIcons((Layout) component); - } else if (component instanceof dev.ultreon.devices.api.app.component.Image) { - ((dev.ultreon.devices.api.app.component.Image) component).reload(); + } else if (component instanceof Image) { + ((Image) component).reload(); } }); } diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/FileBrowser.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/FileBrowser.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/FileBrowser.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/component/FileBrowser.java index 4b3231d4d..d5e2d9686 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/FileBrowser.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/FileBrowser.java @@ -1,32 +1,30 @@ -package dev.ultreon.devices.mineos.apps.system.component; +package dev.ultreon.mineos.apps.system.component; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.*; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.component.*; -import dev.ultreon.devices.api.app.listener.ItemClickListener; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.io.Drive; -import dev.ultreon.devices.api.io.File; -import dev.ultreon.devices.api.io.Folder; -import dev.ultreon.devices.api.task.Callback; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.mineos.client.Window; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.listener.ItemClickListener; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.io.Drive; +import dev.ultreon.devices.impl.io.File; +import dev.ultreon.devices.impl.io.Folder; +import dev.ultreon.devices.impl.task.Callback; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.userspace.Window; import dev.ultreon.devices.core.Wrappable; import dev.ultreon.devices.core.io.FileSystem; import dev.ultreon.devices.core.io.task.TaskGetFiles; import dev.ultreon.devices.core.io.task.TaskGetStructure; import dev.ultreon.devices.core.io.task.TaskSetupFileBrowser; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.system.SystemApp; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.system.SystemApp; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -57,7 +55,7 @@ public class FileBrowser extends Component { private static final ListItemRenderer ITEM_RENDERER = new ListItemRenderer<>(18) { @Override public void render(GuiGraphics graphics, File file, Minecraft mc, int x, int y, int width, int height, boolean selected) { - Color bgColor = new Color(MineOS.getOpened().getSettings().getColorScheme().getBackgroundColor()); + Color bgColor = new Color(MineOS.get().getSettings().getColorScheme().getBackgroundColor()); graphics.fill(x, y, x + width, y + height, selected ? bgColor.brighter().brighter().getRGB() : bgColor.brighter().getRGB()); RenderSystem.setShaderColor(1f, 1f, 1f, 1f); @@ -69,7 +67,7 @@ public void render(GuiGraphics graphics, File file, Minecraft mc, int x, int y, AppInfo info = ApplicationManager.getApplication(ResourceLocation.tryParse(file.getOpeningApp())); RenderUtil.drawApplicationIcon(graphics, info, x + 3, y + 2); } - graphics.drawString(Minecraft.getInstance().font, file.getName(), x + 22, y + 5, file.isProtected() ? PROTECTED_FILE.getRGB() : MineOS.getOpened().getSettings().getColorScheme().getTextColor()); + graphics.drawString(Minecraft.getInstance().font, file.getName(), x + 22, y + 5, file.isProtected() ? PROTECTED_FILE.getRGB() : MineOS.get().getSettings().getColorScheme().getTextColor()); } }; @@ -134,7 +132,7 @@ public FileBrowser(int left, int top, Wrappable wrappable, Mode mode) { public void init(Layout layout) { layoutMain = new Layout(mode.getWidth(), mode.getHeight()); layoutMain.setBackground((graphics, mc, x, y, width, height, mouseX, mouseY, windowActive) -> { - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getHeaderColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getHeaderColor()); graphics.fill(x, y, x + width, y + 20, color.getRGB()); graphics.fill(x, y + 20, x + width, y + 21, color.darker().getRGB()); }); @@ -311,22 +309,22 @@ public void render(GuiGraphics graphics, Drive drive, Minecraft mc, int x, int y public void handleLoad() { if (!loadedStructure) { setLoading(true); - Task task = new TaskSetupFileBrowser(MineOS.getOpened().getPos(), MineOS.getOpened().getMainDrive() == null); + Task task = new TaskSetupFileBrowser(MineOS.get().getPos(), MineOS.get().getMainDrive() == null); task.setCallback((tag, success) -> { if (success) { - if (MineOS.getOpened().getMainDrive() == null) { + if (MineOS.get().getMainDrive() == null) { assert tag != null; CompoundTag structureTag = tag.getCompound("structure"); Drive drive = new Drive(tag.getCompound("main_drive")); drive.syncRoot(Folder.fromTag(FileSystem.LAPTOP_DRIVE_NAME, structureTag)); drive.getRoot().validate(); - MineOS.getOpened().setMainDrive(drive); + MineOS.get().setMainDrive(drive); } assert tag != null; ListTag driveList = tag.getList("available_drives", Tag.TAG_COMPOUND); List drives = new ArrayList<>(driveList.size() + 1); - Drive mainDrive = MineOS.getOpened().getMainDrive(); + Drive mainDrive = MineOS.get().getMainDrive(); if (mainDrive != null) { currentDrive = mainDrive; drives.add(mainDrive); @@ -388,7 +386,7 @@ private void openDrive(Drive drive) { }); } else { setLoading(true); - TaskGetStructure task = new TaskGetStructure(drive, MineOS.getOpened().getPos()); + TaskGetStructure task = new TaskGetStructure(drive, MineOS.get().getPos()); task.setCallback((tag, success) -> { setLoading(false); if (success) { @@ -411,7 +409,7 @@ private void openDrive(Drive drive) { private void openFolder(Folder folder, boolean push, Callback callback) { DebugLog.log("Opening Folder"); if (!folder.isSynced()) { - BlockPos pos = MineOS.getOpened().getPos(); + BlockPos pos = MineOS.get().getPos(); DebugLog.log("Open Folder: " + pos); if (pos == null) { if (callback != null) { diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/Palette.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/Palette.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/Palette.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/component/Palette.java index 638482a2e..d61730d28 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/Palette.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/Palette.java @@ -1,14 +1,14 @@ -package dev.ultreon.devices.mineos.apps.system.component; +package dev.ultreon.mineos.apps.system.component; import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.platform.Lighting; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.*; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.ComboBox; -import dev.ultreon.devices.api.app.component.Slider; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.ComboBox; +import dev.ultreon.devices.impl.app.component.Slider; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GLHelper; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/SlideShow.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/SlideShow.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/SlideShow.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/component/SlideShow.java index c45f49269..90822f274 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/component/SlideShow.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/component/SlideShow.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.mineos.apps.system.component; - -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.mineos.apps.system.object.ImageEntry; -import dev.ultreon.devices.mineos.client.MineOS; +package dev.ultreon.mineos.apps.system.component; + +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.mineos.apps.system.object.ImageEntry; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/LayoutAppPage.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutAppPage.java similarity index 80% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/LayoutAppPage.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutAppPage.java index 782efae13..19478a0a4 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/LayoutAppPage.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutAppPage.java @@ -1,21 +1,21 @@ -package dev.ultreon.devices.mineos.apps.system.layout; +package dev.ultreon.mineos.apps.system.layout; import com.google.common.collect.Lists; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.ScrollableLayout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.mineos.apps.system.AppStore; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.ScrollableLayout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.mineos.apps.system.AppStore; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.debug.DebugLog; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.gitweb.component.GitWebFrame; -import dev.ultreon.devices.mineos.apps.system.component.SlideShow; -import dev.ultreon.devices.mineos.apps.system.object.AppEntry; -import dev.ultreon.devices.mineos.apps.system.object.LocalEntry; -import dev.ultreon.devices.mineos.apps.system.object.RemoteEntry; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.gitweb.component.GitWebFrame; +import dev.ultreon.mineos.apps.system.component.SlideShow; +import dev.ultreon.mineos.apps.system.object.AppEntry; +import dev.ultreon.mineos.apps.system.object.LocalEntry; +import dev.ultreon.mineos.apps.system.object.RemoteEntry; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.ChatFormatting; import net.minecraft.Util; @@ -34,8 +34,8 @@ public class LayoutAppPage extends Layout { private final AppEntry entry; private final AppStore store; - private dev.ultreon.devices.api.app.component.Image imageBanner; - private dev.ultreon.devices.api.app.Component imageIcon; + private Image imageBanner; + private dev.ultreon.devices.impl.app.Component imageIcon; private Label labelTitle; private Label labelVersion; @@ -51,12 +51,12 @@ public LayoutAppPage(MineOS laptop, AppEntry entry, AppStore store) { @Override public void init() { if (entry instanceof LocalEntry) { - installed = MineOS.getOpened().getInstalledApplications().contains(((LocalEntry) entry).info()); + installed = MineOS.get().getInstalledApplications().contains(((LocalEntry) entry).info()); } this.setBackground((graphics, mc, x, y, width, height, mouseX, mouseY, windowActive) -> { - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getBackgroundColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getBackgroundColor()); graphics.fill(x, y + 40, x + width, y + 41, color.brighter().getRGB()); graphics.fill(x, y + 41, x + width, y + 60, color.getRGB()); graphics.fill(x, y + 60, x + width, y + 61, color.darker().getRGB()); @@ -64,7 +64,7 @@ public void init() { ResourceLocation resource = new ResourceLocation(entry.id()); - imageBanner = new dev.ultreon.devices.api.app.component.Image(0, 0, 250, 40); + imageBanner = new Image(0, 0, 250, 40); imageBanner.setDrawFull(true); imageBanner.setBorderVisible(true); imageBanner.setBorderThickness(0); @@ -79,15 +79,15 @@ public void init() { LocalEntry localEntry = (LocalEntry) entry; AppInfo info = localEntry.info(); imageIcon = new Image.AppImage(5, 26, 28, 28, info); - // imageIcon = new dev.ultreon.devices.api.app.component.Image(5, 26, 28, 28, info.getIconU(), info.getIconV(), 14, 14, 224, 224, MineOS.ICON_TEXTURES); + // imageIcon = new dev.ultreon.devices.api.component.app.Image(5, 26, 28, 28, info.getIconU(), info.getIconV(), 14, 14, 224, 224, MineOS.ICON_TEXTURES); } else if (entry instanceof RemoteEntry) { - imageIcon = new dev.ultreon.devices.api.app.component.Image(5, 26, 28, 28, AppStore.CERTIFICATES_BASE_URL + "/assets/" + resource.getNamespace() + "/" + resource.getPath() + "/icon.png"); + imageIcon = new Image(5, 26, 28, 28, AppStore.CERTIFICATES_BASE_URL + "/assets/" + resource.getNamespace() + "/" + resource.getPath() + "/icon.png"); } this.addComponent(imageIcon); if (store.certifiedApps.contains(entry)) { int width = MineOS.getFont().width(entry.name()) * 2; - dev.ultreon.devices.api.app.component.Image certifiedIcon = new dev.ultreon.devices.api.app.component.Image(38 + width + 3, 29, 20, 20, Icons.VERIFIED); + Image certifiedIcon = new Image(38 + width + 3, 29, 20, 20, Icons.VERIFIED); this.addComponent(certifiedIcon); } labelTitle = new Label(entry.name(), 38, 32); diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/LayoutSearchApps.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutSearchApps.java similarity index 84% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/LayoutSearchApps.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutSearchApps.java index e1db719c6..d6dc75689 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/LayoutSearchApps.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/LayoutSearchApps.java @@ -1,17 +1,17 @@ -package dev.ultreon.devices.mineos.apps.system.layout; +package dev.ultreon.mineos.apps.system.layout; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.ApplicationManager; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.ItemList; -import dev.ultreon.devices.api.app.component.TextField; -import dev.ultreon.devices.api.app.renderer.ListItemRenderer; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.apps.system.AppStore; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.system.object.LocalEntry; +import dev.ultreon.devices.impl.ApplicationManager; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.ItemList; +import dev.ultreon.devices.impl.app.component.TextField; +import dev.ultreon.devices.impl.app.renderer.ListItemRenderer; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.apps.system.AppStore; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.system.object.LocalEntry; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/StandardLayout.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/StandardLayout.java similarity index 80% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/StandardLayout.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/StandardLayout.java index ba6ecb1d8..077cee70b 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/layout/StandardLayout.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/layout/StandardLayout.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.mineos.apps.system.layout; +package dev.ultreon.mineos.apps.system.layout; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.IIcon; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.IIcon; +import dev.ultreon.devices.impl.app.Icons; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -44,7 +44,7 @@ public void init() { @Override public void render(GuiGraphics graphics, MineOS laptop, Minecraft mc, int x, int y, int mouseX, int mouseY, boolean windowActive, float partialTicks) { - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getHeaderColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getHeaderColor()); graphics.fill(x, y, x + width, y + 20, color.getRGB()); graphics.fill(x, y + 20, x + width, y + 21, color.darker().getRGB()); diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/Account.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Account.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/Account.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Account.java index 3aaa5f580..a1802d4fb 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/Account.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Account.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; public class Account { private int balance; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/AppEntry.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/AppEntry.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/AppEntry.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/AppEntry.java index 4096db105..a107091d9 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/AppEntry.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/AppEntry.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.object.AppInfo; import org.jetbrains.annotations.Nullable; import java.util.Arrays; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorScheme.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorScheme.java similarity index 99% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorScheme.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorScheme.java index 9052611f1..3b1c80c8e 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorScheme.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorScheme.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorSchemePresetRegistry.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresetRegistry.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorSchemePresetRegistry.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresetRegistry.java index 306ac3dcf..705e67693 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorSchemePresetRegistry.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresetRegistry.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorSchemePresets.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresets.java similarity index 96% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorSchemePresets.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresets.java index 639f3831f..d411fdabe 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ColorSchemePresets.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ColorSchemePresets.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; import dev.ultreon.devices.UltreonDevicesMod; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ImageEntry.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ImageEntry.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ImageEntry.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ImageEntry.java index 155963360..41b32c4bf 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/ImageEntry.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/ImageEntry.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/LocalEntry.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/LocalEntry.java similarity index 91% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/LocalEntry.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/LocalEntry.java index b129d8f19..dcfa6a08e 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/LocalEntry.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/LocalEntry.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.object.AppInfo; /** * @author MrCrayfish diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/Preset.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Preset.java similarity index 90% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/Preset.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Preset.java index 042123d52..833cbdb1e 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/Preset.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/Preset.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/RemoteEntry.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/RemoteEntry.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/RemoteEntry.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/object/RemoteEntry.java index b0a308694..799d0297c 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/object/RemoteEntry.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/object/RemoteEntry.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.system.object; +package dev.ultreon.mineos.apps.system.object; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.mineos.object.AppInfo; import org.jetbrains.annotations.Nullable; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskAdd.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskAdd.java similarity index 81% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskAdd.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskAdd.java index 3378cfb9d..8d6da522f 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskAdd.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskAdd.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.mineos.apps.system.object.Account; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.mineos.apps.system.object.Account; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskDeposit.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskDeposit.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskDeposit.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskDeposit.java index ba3ccee20..f53cc6522 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskDeposit.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskDeposit.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.mineos.apps.system.object.Account; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.mineos.apps.system.object.Account; import dev.ultreon.devices.util.InventoryUtil; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskGetBalance.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskGetBalance.java similarity index 79% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskGetBalance.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskGetBalance.java index 98c71f665..ca998e682 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskGetBalance.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskGetBalance.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.mineos.apps.system.object.Account; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.mineos.apps.system.object.Account; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskPay.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskPay.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskPay.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskPay.java index 5771a7c48..e70e6004c 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskPay.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskPay.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.mineos.apps.system.object.Account; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.mineos.apps.system.object.Account; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskRemove.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskRemove.java similarity index 83% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskRemove.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskRemove.java index 16da6c68d..44ad4a7ee 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskRemove.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskRemove.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.mineos.apps.system.object.Account; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.mineos.apps.system.object.Account; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskUpdateApplicationData.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateApplicationData.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskUpdateApplicationData.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateApplicationData.java index bee910245..35abde48b 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskUpdateApplicationData.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateApplicationData.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskUpdateSystemData.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateSystemData.java similarity index 93% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskUpdateSystemData.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateSystemData.java index 842d0978e..864025122 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskUpdateSystemData.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskUpdateSystemData.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; +import dev.ultreon.devices.impl.task.Task; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskWithdraw.java b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskWithdraw.java similarity index 88% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskWithdraw.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskWithdraw.java index cfb94ed3a..809ae4689 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/system/task/TaskWithdraw.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/system/task/TaskWithdraw.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.apps.system.task; +package dev.ultreon.mineos.apps.system.task; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.utils.BankUtil; -import dev.ultreon.devices.mineos.apps.system.object.Account; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.utils.BankUtil; +import dev.ultreon.mineos.apps.system.object.Account; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/apps/themes/ThemesApp.java b/common/src/mineos/java/dev/ultreon/mineos/apps/themes/ThemesApp.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/mineos/apps/themes/ThemesApp.java rename to common/src/mineos/java/dev/ultreon/mineos/apps/themes/ThemesApp.java index ca24e0aa5..cf55604ef 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/apps/themes/ThemesApp.java +++ b/common/src/mineos/java/dev/ultreon/mineos/apps/themes/ThemesApp.java @@ -1,15 +1,14 @@ -package dev.ultreon.devices.mineos.apps.themes; +package dev.ultreon.mineos.apps.themes; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.*; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Dialog; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.TextField; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.MineOSSystem; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.AppInfo; +import dev.ultreon.devices.impl.app.Component; +import dev.ultreon.devices.impl.app.Dialog; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.TextField; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.MineOSSystem; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.AppInfo; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/mineos/java/dev/ultreon/mineos/impl/DevicePermission.java b/common/src/mineos/java/dev/ultreon/mineos/impl/DevicePermission.java new file mode 100644 index 000000000..abd279199 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/impl/DevicePermission.java @@ -0,0 +1,9 @@ +package dev.ultreon.mineos.impl; + +import dev.ultreon.mineos.kernel.Device; + +public class DevicePermission extends Permission { + public DevicePermission(Device device, String name) { + super(name); + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/impl/Permission.java b/common/src/mineos/java/dev/ultreon/mineos/impl/Permission.java new file mode 100644 index 000000000..5de224aeb --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/impl/Permission.java @@ -0,0 +1,13 @@ +package dev.ultreon.mineos.impl; + +public class Permission { + private final String name; + + public Permission(String name) { + this.name = name; + } + + public String name() { + return name; + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/Device.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/Device.java new file mode 100644 index 000000000..e0866c881 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/kernel/Device.java @@ -0,0 +1,5 @@ +package dev.ultreon.mineos.kernel; + +public interface Device { + +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/Driver.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/Driver.java new file mode 100644 index 000000000..08d9fb590 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/kernel/Driver.java @@ -0,0 +1,15 @@ +package dev.ultreon.mineos.kernel; + +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceInfo; +import dev.ultreon.devices.api.bios.efi.VEFI_System; + +public interface Driver { + void init(VEFI_System system, VEFI_DeviceID deviceID, VEFI_DeviceInfo deviceInfo); + + void load(); + + void unload(); + + String name(); +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/FrameBuffer.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/FrameBuffer.java new file mode 100644 index 000000000..4f36d18bd --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/kernel/FrameBuffer.java @@ -0,0 +1,85 @@ +package dev.ultreon.mineos.kernel; + +import dev.ultreon.devices.api.bios.BiosCallType; +import dev.ultreon.devices.api.bios.FrameBufferCall; +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; +import dev.ultreon.devices.api.bios.efi.VEFI_System; + +import java.util.UUID; + +public class FrameBuffer { + private VEFI_DeviceID deviceID = null; + private VEFI_System system = null; + private int width = 0; + private int height = 0; + private int bitsPerPixel = 0; + + public void init(VEFI_DeviceID deviceID, VEFI_System system, int width, int height, int bitsPerPixel) { + this.deviceID = deviceID; + this.system = system; + this.width = width; + this.height = height; + this.bitsPerPixel = bitsPerPixel; + } + + public int readPixel(int x, int y) { + return (int) system.getBios().call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.READ_PIXEL, new Object[]{x, y}}); + } + + public void writePixel(int x, int y, int color) { + system.getBios().call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.WRITE_PIXEL, new Object[]{x, y, color}}); + } + + public void clear(int color) { + system.getBios().call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.CLEAR, new Object[]{color}}); + } + + public void fill(int x1, int y1, int x2, int y2, int color) { + system.getBios().call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.FILL_RECT, new Object[]{x1, y1, x2, y2, color}}); + } + + public void renderOutline(int x1, int y1, int x2, int y2, int color) { + system.getBios().call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.DRAW_RECT, new Object[]{x1, y1, x2, y2, color}}); + } + + public void blit(String id, int x, int y, int width, int height) { + this.blit(id, x, y, width, height, 0, 0, width, height, 256, 256); + } + + public void blit(String id, int x, int y, int width, int height, int srcX, int srcY) { + this.blit(id, x, y, width, height, srcX, srcY, width, height, 256, 256); + } + + public void blit(String id, int x, int y, int width, int height, int srcX, int srcY, int srcWidth, int srcHeight) { + this.blit(id, x, y, width, height, srcX, srcY, srcWidth, srcHeight, 256, 256); + } + + public void blit(String id, int x, int y, int width, int height, int srcX, int srcY, int srcWidth, int srcHeight, int texWidth, int texHeight) { + system.getBios().call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.BLIT, new Object[]{id, x, y, width, height, srcX, srcY, srcWidth, srcHeight, texWidth, texHeight}}); + } + + public void renderItemStack(String id, int count, int x, int y) { + system.getBios().call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.DRAW_ITEM, new Object[]{id, count, x, y}}); + } + + public UUID getDeviceID() { + return deviceID.id(); + } + + public int getWidth() { + return width; + } + + public int getHeight() { + return height; + } + + public int getBitsPerPixel() { + return bitsPerPixel; + } + + public void resize(int width, int height) { + this.width = width; + this.height = height; + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/Kern.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/Kern.java new file mode 100644 index 000000000..67ab53b9b --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/kernel/Kern.java @@ -0,0 +1,22 @@ +package dev.ultreon.mineos.kernel; + +import dev.ultreon.mineos.impl.Permission; + +import java.nio.channels.SeekableByteChannel; +import java.nio.file.Path; + +public interface Kern { + static Kern get() { + + } + + void requestShutdown() throws SecurityException; + + void requestReboot() throws SecurityException; + + void requestHalt() throws SecurityException; + + void askPermission(Permission permission, Mono callback) throws SecurityException; + + SeekableByteChannel openChannel(Path path); +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/MineOSKernel.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/MineOSKernel.java new file mode 100644 index 000000000..a80954beb --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/kernel/MineOSKernel.java @@ -0,0 +1,50 @@ +package dev.ultreon.mineos.kernel; + +import dev.ultreon.devices.api.bios.Bios; +import dev.ultreon.devices.api.bios.BiosCallType; +import dev.ultreon.devices.api.bios.FrameBufferCall; +import dev.ultreon.devices.api.bios.FrameBufferInfo; +import dev.ultreon.devices.impl.bios.Bios; +import dev.ultreon.mineos.DriverManagerImpl; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.sounds.SimpleSoundInstance; +import net.minecraft.sounds.SoundEvent; +import org.intellij.lang.annotations.Language; + +public class MineOSKernel implements Kern { + private static final DriverManagerImpl driverManager = new DriverManagerImpl(); + + public void boot(Bios bios) { + bios.enableInterrupts(); + + this.loadDrivers(bios); + + this.enterUserspace(bios); + } + + private void loadDrivers(Bios bios) { + FrameBufferInfo call = (FrameBufferInfo) bios.call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.GET_INFO, new Object[0]}); + + if (call != null) { + VGADriver driver = new VGADriver(); + driverManager.register("vga", driver); + + driver.load(); + driver.init(bios.getVEFISystem(), call.width, call.height, call.bpp); + } + } + + private void enterUserspace(Bios bios) { + @Language("jvm-class-name") final String className = "dev.ultreon.mineos.userspace.MineOS"; + + try { + bios.call(BiosCallType.ENTER_USERSPACE, new Object[] { className }); + } catch (Exception e) { + throw new RuntimeException("Failed to enter userspace", e); + } + } + + public void playSound(SoundEvent sound) { + Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(sound, 1f, 1f)); + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/VGADriver.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/VGADriver.java new file mode 100644 index 000000000..379b2be60 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/kernel/VGADriver.java @@ -0,0 +1,52 @@ +package dev.ultreon.mineos.kernel; + +import dev.ultreon.devices.api.bios.*; +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceInfo; +import dev.ultreon.devices.api.bios.efi.VEFI_System; + +public class VGADriver extends VideoDriver { + private int width; + private int height; + private int bitsPerPixel; + private FrameBuffer fb; + + public VGADriver() { + + } + + @Override + public void init(VEFI_System system, VEFI_DeviceID deviceID, VEFI_DeviceInfo deviceInfo) { + Bios bios = system.getBios(); + FrameBufferInfo call = (FrameBufferInfo) bios.call(BiosCallType.FRAMEBUFFER_CALL, new Object[]{FrameBufferCall.GET_INFO, new Object[0]}); + + bios.registerInterrupt(BiosInterruptType.FRAMEBUFFER_INTERRUPT, this::interrupt); + + this.width = call.width(); + this.height = call.height(); + this.bitsPerPixel = call.bpp(); + + this.fb.init(deviceID, width, height, bitsPerPixel); + } + + private void interrupt(InterruptData interruptData) { + if ((int) interruptData.getField("type") == 0) { + this.fb.resize(interruptData.getField("width"), interruptData.getField("height")); + } + } + + @Override + public void load() { + this.fb = new FrameBuffer(); + } + + @Override + public void unload() { + + } + + @Override + public String name() { + return ""; + } +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/kernel/VideoDriver.java b/common/src/mineos/java/dev/ultreon/mineos/kernel/VideoDriver.java new file mode 100644 index 000000000..14a46b5b5 --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/kernel/VideoDriver.java @@ -0,0 +1,5 @@ +package dev.ultreon.mineos.kernel; + +public abstract class VideoDriver implements Driver { + +} diff --git a/common/src/main/java/dev/ultreon/devices/object/AppInfo.java b/common/src/mineos/java/dev/ultreon/mineos/object/AppInfo.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/object/AppInfo.java rename to common/src/mineos/java/dev/ultreon/mineos/object/AppInfo.java index 7767c50c1..a4dade8e8 100644 --- a/common/src/main/java/dev/ultreon/devices/object/AppInfo.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/AppInfo.java @@ -1,11 +1,11 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; import com.google.gson.*; import com.google.gson.reflect.TypeToken; import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.Reference; import dev.ultreon.devices.client.Display; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.language.I18n; import net.minecraft.nbt.CompoundTag; @@ -28,7 +28,7 @@ public class AppInfo { public static final Comparator SORT_NAME = Comparator.comparing(AppInfo::getName); - private transient final ResourceLocation APP_ID; + private transient final ApplicationID APP_ID; private final transient boolean systemApp; @@ -36,8 +36,8 @@ public class AppInfo { @Override public int getTintColor(AppInfo info, int o) { return switch (o) { - case 1 -> ((MineOS) Display.get().getOS()).getSettings().getColorScheme().getBackgroundColor(); - case 2 -> ((MineOS) Display.get().getOS()).getSettings().getColorScheme().getBackgroundSecondaryColor(); + case 1 -> MineOS.get().getSettings().getColorScheme().getBackgroundColor(); + case 2 -> MineOS.get().getSettings().getColorScheme().getBackgroundSecondaryColor(); default -> new Color(255, 255, 255).getRGB(); }; } @@ -191,11 +191,11 @@ public int getType() { } private Icon(AppInfo info) { - this.base = Glyph.of(new ResourceLocation(info.APP_ID.getNamespace(), "textures/app/icon/base/" + info.APP_ID.getPath() + ".png")); + this.base = Glyph.of(new ResourceLocation(info.APP_ID.namespace(), "textures/app/icon/base/" + info.APP_ID.getPath() + ".png")); this.base.type = 0; - this.overlay0 = Glyph.of(new ResourceLocation(info.APP_ID.getNamespace(), "textures/app/icon/overlay0/" + info.APP_ID.getPath() + ".png")); + this.overlay0 = Glyph.of(new ResourceLocation(info.APP_ID.namespace(), "textures/app/icon/overlay0/" + info.APP_ID.getPath() + ".png")); this.overlay0.type = 1; - this.overlay1 = Glyph.of(new ResourceLocation(info.APP_ID.getNamespace(), "textures/app/icon/overlay1/" + info.APP_ID.getPath() + ".png")); + this.overlay1 = Glyph.of(new ResourceLocation(info.APP_ID.namespace(), "textures/app/icon/overlay1/" + info.APP_ID.getPath() + ".png")); this.overlay1.type = 2; } @@ -242,7 +242,7 @@ public void reload() { resetInfo(); if (Minecraft.getInstance().getResourceManager() == null) return; // TODO "Check if the resource manager can be used on client side." - Resource resource = Minecraft.getInstance().getResourceManager().getResource(new ResourceLocation(APP_ID.getNamespace(), "/apps/" + APP_ID.getPath() + ".json")).orElse(null); + Resource resource = Minecraft.getInstance().getResourceManager().getResource(new ResourceLocation(APP_ID.namespace(), "/apps/" + APP_ID.getPath() + ".json")).orElse(null); if (resource == null) throw new RuntimeException("Missing app info json for '" + APP_ID + "'"); @@ -318,9 +318,9 @@ private void deserializeSchemaVersion0(JsonElement json, JsonDeserializationCont info.icon = new Icon(); info.icon.base = Icon.Glyph.of(new ResourceLocation(json.getAsJsonObject().get("icon").getAsString())); info.icon.base.type = 0; - info.icon.overlay0 = Icon.Glyph.of(new ResourceLocation(info.APP_ID.getNamespace(), "textures/app/icon/overlay0/empty.png")); + info.icon.overlay0 = Icon.Glyph.of(new ResourceLocation(info.APP_ID.namespace(), "textures/app/icon/overlay0/empty.png")); info.icon.overlay0.type = 1; - info.icon.overlay1 = Icon.Glyph.of(new ResourceLocation(info.APP_ID.getNamespace(), "textures/app/icon/overlay1/empty.png")); + info.icon.overlay1 = Icon.Glyph.of(new ResourceLocation(info.APP_ID.namespace(), "textures/app/icon/overlay1/empty.png")); info.icon.overlay1.type = 2; } diff --git a/common/src/mineos/java/dev/ultreon/mineos/object/ApplicationID.java b/common/src/mineos/java/dev/ultreon/mineos/object/ApplicationID.java new file mode 100644 index 000000000..277824d4e --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/object/ApplicationID.java @@ -0,0 +1,21 @@ +package dev.ultreon.mineos.object; + +import java.util.regex.Pattern; + +public record ApplicationID(String namespace, String name) { + public static final Pattern NAMESPACE = Pattern.compile("[a-zA-Z0-9_]{2,}(\\.[a-zA-Z0-9_]+)+"); + public static final Pattern NAME = Pattern.compile("[a-zA-Z0-9_]{3,}"); + + public ApplicationID { + this.validate(namespace, name); + } + + private void validate(String namespace, String name) { + if (!NAMESPACE.matcher(namespace).matches()) { + throw new IllegalArgumentException("Invalid namespace: " + namespace); + } + if (!NAME.matcher(name).matches()) { + throw new IllegalArgumentException("Invalid name: " + name); + } + } +} diff --git a/common/src/main/java/dev/ultreon/devices/object/Canvas.java b/common/src/mineos/java/dev/ultreon/mineos/object/Canvas.java similarity index 94% rename from common/src/main/java/dev/ultreon/devices/object/Canvas.java rename to common/src/mineos/java/dev/ultreon/mineos/object/Canvas.java index df152db4a..7a6161c9a 100644 --- a/common/src/main/java/dev/ultreon/devices/object/Canvas.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/Canvas.java @@ -1,12 +1,12 @@ -package dev.ultreon.devices.object; - -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.tools.ToolBucket; -import dev.ultreon.devices.object.tools.ToolEraser; -import dev.ultreon.devices.object.tools.ToolEyeDropper; -import dev.ultreon.devices.object.tools.ToolPencil; +package dev.ultreon.mineos.object; + +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.api.Layout; +import dev.ultreon.mineos.object.tools.ToolEraser; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.tools.ToolBucket; +import dev.ultreon.mineos.object.tools.ToolEyeDropper; +import dev.ultreon.mineos.object.tools.ToolPencil; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/object/ColorGrid.java b/common/src/mineos/java/dev/ultreon/mineos/object/ColorGrid.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/object/ColorGrid.java rename to common/src/mineos/java/dev/ultreon/mineos/object/ColorGrid.java index 80e85390d..54b394b75 100644 --- a/common/src/main/java/dev/ultreon/devices/object/ColorGrid.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/ColorGrid.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.component.Slider; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.devices.impl.app.component.Slider; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -14,7 +14,7 @@ public class ColorGrid extends Component { private final int hoverColor = new Color(255, 255, 255, 100).getRGB(); - private final dev.ultreon.devices.object.Canvas canvas; + private final Canvas canvas; private final Slider redSlider; private final Slider greenSlider; private final Slider blueSlider; diff --git a/common/src/main/java/dev/ultreon/devices/object/Game.java b/common/src/mineos/java/dev/ultreon/mineos/object/Game.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/object/Game.java rename to common/src/mineos/java/dev/ultreon/mineos/object/Game.java index 8188150a3..9b04bf8b3 100644 --- a/common/src/main/java/dev/ultreon/devices/object/Game.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/Game.java @@ -1,12 +1,12 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; import com.mojang.blaze3d.systems.RenderSystem; -import dev.ultreon.devices.api.app.Component; +import dev.ultreon.mineos.api.Component; import dev.ultreon.devices.client.Display; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.mineos.userspace.MineOS; import dev.ultreon.devices.exception.WorldLessException; -import dev.ultreon.devices.object.tiles.Tile; +import dev.ultreon.mineos.object.tiles.Tile; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/object/Picture.java b/common/src/mineos/java/dev/ultreon/mineos/object/Picture.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/object/Picture.java rename to common/src/mineos/java/dev/ultreon/mineos/object/Picture.java index ffda32ea5..7c090d319 100644 --- a/common/src/main/java/dev/ultreon/devices/object/Picture.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/Picture.java @@ -1,6 +1,6 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; -import dev.ultreon.devices.api.io.File; +import dev.ultreon.devices.impl.io.File; import net.minecraft.nbt.CompoundTag; import java.awt.*; diff --git a/common/src/main/java/dev/ultreon/devices/object/Player.java b/common/src/mineos/java/dev/ultreon/mineos/object/Player.java similarity index 98% rename from common/src/main/java/dev/ultreon/devices/object/Player.java rename to common/src/mineos/java/dev/ultreon/mineos/object/Player.java index 1f1cd60f4..5a1fdbd6b 100644 --- a/common/src/main/java/dev/ultreon/devices/object/Player.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/Player.java @@ -1,10 +1,10 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; import com.mojang.blaze3d.platform.InputConstants; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.Tesselator; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.tiles.Tile; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.tiles.Tile; import dev.ultreon.devices.util.KeyboardHelper; import dev.ultreon.devices.util.Vec2d; import net.minecraft.client.Minecraft; @@ -50,7 +50,7 @@ public Player(Game game) { this.boatModel = new BoatRenderer(createEntityRendererContext(), false); assert Minecraft.getInstance().player != null; boolean slim = Minecraft.getInstance().player.getSkin().model() == PlayerSkin.Model.SLIM; - if (!MineOS.getOpened().isWorldLess()) { + if (!MineOS.get().isWorldLess()) { boat = new Boat(Objects.requireNonNull(Minecraft.getInstance().level), 0, 0, 0); } // this.playerModel = new ModelDummyPlayer(0f, slim); diff --git a/common/src/main/java/dev/ultreon/devices/object/TileGrid.java b/common/src/mineos/java/dev/ultreon/mineos/object/TileGrid.java similarity index 89% rename from common/src/main/java/dev/ultreon/devices/object/TileGrid.java rename to common/src/mineos/java/dev/ultreon/mineos/object/TileGrid.java index 8656e4144..406390afc 100644 --- a/common/src/main/java/dev/ultreon/devices/object/TileGrid.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/TileGrid.java @@ -1,16 +1,16 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.Tesselator; -import dev.ultreon.devices.api.app.Component; -import dev.ultreon.devices.api.app.Icons; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Button; -import dev.ultreon.devices.api.app.component.Label; -import dev.ultreon.devices.api.app.listener.ClickListener; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.object.tiles.Tile; +import dev.ultreon.mineos.api.Component; +import dev.ultreon.mineos.api.Icons; +import dev.ultreon.mineos.api.Layout; +import dev.ultreon.devices.impl.app.component.Button; +import dev.ultreon.devices.impl.app.component.Label; +import dev.ultreon.devices.impl.app.listener.ClickListener; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.userspace.MineOS; +import dev.ultreon.mineos.object.tiles.Tile; import dev.ultreon.devices.util.GuiHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; diff --git a/common/src/main/java/dev/ultreon/devices/object/Tool.java b/common/src/mineos/java/dev/ultreon/mineos/object/Tool.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/object/Tool.java rename to common/src/mineos/java/dev/ultreon/mineos/object/Tool.java index f1368f1cc..b8e973f1b 100644 --- a/common/src/main/java/dev/ultreon/devices/object/Tool.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/Tool.java @@ -1,4 +1,4 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; public abstract class Tool { public abstract void handleClick(Canvas canvas, int x, int y); diff --git a/common/src/main/java/dev/ultreon/devices/object/TrayItem.java b/common/src/mineos/java/dev/ultreon/mineos/object/TrayItem.java similarity index 88% rename from common/src/main/java/dev/ultreon/devices/object/TrayItem.java rename to common/src/mineos/java/dev/ultreon/mineos/object/TrayItem.java index 459fb6c0b..221c2c390 100644 --- a/common/src/main/java/dev/ultreon/devices/object/TrayItem.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/TrayItem.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.object; +package dev.ultreon.mineos.object; -import dev.ultreon.devices.api.app.IIcon; -import dev.ultreon.devices.api.app.listener.ClickListener; +import dev.ultreon.devices.impl.app.IIcon; +import dev.ultreon.devices.impl.app.listener.ClickListener; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; diff --git a/common/src/main/java/dev/ultreon/devices/object/tiles/Tile.java b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/Tile.java similarity index 95% rename from common/src/main/java/dev/ultreon/devices/object/tiles/Tile.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tiles/Tile.java index 5e9253e97..948abb38e 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tiles/Tile.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/Tile.java @@ -1,8 +1,7 @@ -package dev.ultreon.devices.object.tiles; +package dev.ultreon.mineos.object.tiles; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.Game; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.Game; import net.minecraft.client.gui.GuiGraphics; public class Tile diff --git a/common/src/main/java/dev/ultreon/devices/object/tiles/TileBlock.java b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileBlock.java similarity index 91% rename from common/src/main/java/dev/ultreon/devices/object/tiles/TileBlock.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileBlock.java index 73f8dd48f..892ec9cfd 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tiles/TileBlock.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileBlock.java @@ -1,9 +1,8 @@ -package dev.ultreon.devices.object.tiles; +package dev.ultreon.mineos.object.tiles; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.Game; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.Game; import net.minecraft.client.gui.GuiGraphics; public class TileBlock extends Tile diff --git a/common/src/main/java/dev/ultreon/devices/object/tiles/TileCactus.java b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileCactus.java similarity index 86% rename from common/src/main/java/dev/ultreon/devices/object/tiles/TileCactus.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileCactus.java index 2ad2bc23e..b98029f6a 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tiles/TileCactus.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileCactus.java @@ -1,9 +1,8 @@ -package dev.ultreon.devices.object.tiles; +package dev.ultreon.mineos.object.tiles; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.Game; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.Game; import net.minecraft.client.gui.GuiGraphics; public class TileCactus extends Tile diff --git a/common/src/main/java/dev/ultreon/devices/object/tiles/TileEnchantmentTable.java b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileEnchantmentTable.java similarity index 84% rename from common/src/main/java/dev/ultreon/devices/object/tiles/TileEnchantmentTable.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileEnchantmentTable.java index c8bb88b30..527696d74 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tiles/TileEnchantmentTable.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileEnchantmentTable.java @@ -1,9 +1,8 @@ -package dev.ultreon.devices.object.tiles; +package dev.ultreon.mineos.object.tiles; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.Game; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.Game; import net.minecraft.client.gui.GuiGraphics; public class TileEnchantmentTable extends Tile diff --git a/common/src/main/java/dev/ultreon/devices/object/tiles/TileFlower.java b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileFlower.java similarity index 73% rename from common/src/main/java/dev/ultreon/devices/object/tiles/TileFlower.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileFlower.java index 8227887b7..8deda49f0 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tiles/TileFlower.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileFlower.java @@ -1,8 +1,7 @@ -package dev.ultreon.devices.object.tiles; +package dev.ultreon.mineos.object.tiles; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.Game; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.Game; import net.minecraft.client.gui.GuiGraphics; public class TileFlower extends Tile diff --git a/common/src/main/java/dev/ultreon/devices/object/tiles/TileGrass.java b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileGrass.java similarity index 90% rename from common/src/main/java/dev/ultreon/devices/object/tiles/TileGrass.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileGrass.java index f9637ab31..8ed5a6130 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tiles/TileGrass.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileGrass.java @@ -1,9 +1,8 @@ -package dev.ultreon.devices.object.tiles; +package dev.ultreon.mineos.object.tiles; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.Game; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.Game; import net.minecraft.client.gui.GuiGraphics; public class TileGrass extends Tile diff --git a/common/src/main/java/dev/ultreon/devices/object/tiles/TileWheat.java b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileWheat.java similarity index 79% rename from common/src/main/java/dev/ultreon/devices/object/tiles/TileWheat.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileWheat.java index 021d6855c..37b0f2f90 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tiles/TileWheat.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tiles/TileWheat.java @@ -1,9 +1,8 @@ -package dev.ultreon.devices.object.tiles; +package dev.ultreon.mineos.object.tiles; -import com.mojang.blaze3d.vertex.PoseStack; -import dev.ultreon.devices.api.utils.RenderUtil; -import dev.ultreon.devices.object.Game; +import dev.ultreon.devices.impl.utils.RenderUtil; +import dev.ultreon.mineos.object.Game; import net.minecraft.client.gui.GuiGraphics; public class TileWheat extends Tile diff --git a/common/src/main/java/dev/ultreon/devices/object/tools/ToolBucket.java b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolBucket.java similarity index 88% rename from common/src/main/java/dev/ultreon/devices/object/tools/ToolBucket.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolBucket.java index 6f813d407..a4af9ffeb 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tools/ToolBucket.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolBucket.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.object.tools; +package dev.ultreon.mineos.object.tools; -import dev.ultreon.devices.object.Canvas; -import dev.ultreon.devices.object.Tool; +import dev.ultreon.mineos.object.Canvas; +import dev.ultreon.mineos.object.Tool; public class ToolBucket extends Tool { diff --git a/common/src/main/java/dev/ultreon/devices/object/tools/ToolEraser.java b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEraser.java similarity index 71% rename from common/src/main/java/dev/ultreon/devices/object/tools/ToolEraser.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEraser.java index 7bde34e23..4e9befe15 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tools/ToolEraser.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEraser.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.object.tools; +package dev.ultreon.mineos.object.tools; -import dev.ultreon.devices.object.Canvas; -import dev.ultreon.devices.object.Tool; +import dev.ultreon.mineos.object.Canvas; +import dev.ultreon.mineos.object.Tool; public class ToolEraser extends Tool { diff --git a/common/src/main/java/dev/ultreon/devices/object/tools/ToolEyeDropper.java b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEyeDropper.java similarity index 71% rename from common/src/main/java/dev/ultreon/devices/object/tools/ToolEyeDropper.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEyeDropper.java index a0d083058..05952ffff 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tools/ToolEyeDropper.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolEyeDropper.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.object.tools; +package dev.ultreon.mineos.object.tools; -import dev.ultreon.devices.object.Canvas; -import dev.ultreon.devices.object.Tool; +import dev.ultreon.mineos.object.Canvas; +import dev.ultreon.mineos.object.Tool; public class ToolEyeDropper extends Tool { diff --git a/common/src/main/java/dev/ultreon/devices/object/tools/ToolPencil.java b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolPencil.java similarity index 74% rename from common/src/main/java/dev/ultreon/devices/object/tools/ToolPencil.java rename to common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolPencil.java index 8297a067b..70fd39dcc 100644 --- a/common/src/main/java/dev/ultreon/devices/object/tools/ToolPencil.java +++ b/common/src/mineos/java/dev/ultreon/mineos/object/tools/ToolPencil.java @@ -1,7 +1,7 @@ -package dev.ultreon.devices.object.tools; +package dev.ultreon.mineos.object.tools; -import dev.ultreon.devices.object.Canvas; -import dev.ultreon.devices.object.Tool; +import dev.ultreon.mineos.object.Canvas; +import dev.ultreon.mineos.object.Tool; public class ToolPencil extends Tool { diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/Font.java b/common/src/mineos/java/dev/ultreon/mineos/userspace/Font.java new file mode 100644 index 000000000..18a23008b --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/userspace/Font.java @@ -0,0 +1,5 @@ +package dev.ultreon.mineos.userspace; + +public class Font { + +} diff --git a/common/src/mineos/java/dev/ultreon/mineos/userspace/GuiGraphics.java b/common/src/mineos/java/dev/ultreon/mineos/userspace/GuiGraphics.java new file mode 100644 index 000000000..f2187d45a --- /dev/null +++ b/common/src/mineos/java/dev/ultreon/mineos/userspace/GuiGraphics.java @@ -0,0 +1,5 @@ +package dev.ultreon.mineos.userspace; + +public class GuiGraphics { + +} diff --git a/common/src/main/java/dev/ultreon/devices/mineos/client/MineOS.java b/common/src/mineos/java/dev/ultreon/mineos/userspace/MineOS.java similarity index 87% rename from common/src/main/java/dev/ultreon/devices/mineos/client/MineOS.java rename to common/src/mineos/java/dev/ultreon/mineos/userspace/MineOS.java index 63a67f17e..b6e37c685 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/client/MineOS.java +++ b/common/src/mineos/java/dev/ultreon/mineos/userspace/MineOS.java @@ -1,42 +1,37 @@ -package dev.ultreon.devices.mineos.client; +package dev.ultreon.mineos.userspace; import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.datafixers.util.Pair; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.Layout; -import dev.ultreon.devices.api.app.component.Image; -import dev.ultreon.devices.api.io.Drive; -import dev.ultreon.devices.api.task.Callback; -import dev.ultreon.devices.api.task.Task; -import dev.ultreon.devices.api.task.TaskManager; -import dev.ultreon.devices.api.video.VideoInfo; +import dev.ultreon.devices.api.bios.*; +import dev.ultreon.devices.api.bios.efi.VEFI_DeviceID; +import dev.ultreon.devices.api.bios.efi.VEFI_System; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.Layout; +import dev.ultreon.devices.impl.app.component.Image; +import dev.ultreon.devices.impl.io.Drive; +import dev.ultreon.devices.impl.task.Callback; +import dev.ultreon.devices.impl.task.Task; +import dev.ultreon.devices.impl.task.TaskManager; +import dev.ultreon.devices.impl.video.VideoInfo; import dev.ultreon.devices.block.entity.ComputerBlockEntity; import dev.ultreon.devices.client.Display; import dev.ultreon.devices.core.task.TaskInstallApp; -import dev.ultreon.devices.api.bios.InterruptData; -import dev.ultreon.devices.api.util.Color; -import dev.ultreon.devices.mineos.MineOSSystem; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.system.DiagnosticsApp; -import dev.ultreon.devices.mineos.apps.system.DisplayResolution; -import dev.ultreon.devices.mineos.apps.system.PredefinedResolution; -import dev.ultreon.devices.mineos.apps.system.SystemApp; -import dev.ultreon.devices.mineos.apps.system.component.FileBrowser; -import dev.ultreon.devices.mineos.apps.system.task.TaskUpdateApplicationData; -import dev.ultreon.devices.mineos.apps.system.task.TaskUpdateSystemData; -import dev.ultreon.devices.util.FrameBuffer; +import dev.ultreon.devices.impl.bios.InterruptData; +import dev.ultreon.devices.impl.util.Color; +import dev.ultreon.mineos.api.Application; +import dev.ultreon.mineos.kernel.MineOSKernel; +import dev.ultreon.mineos.MineOSSystem; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.system.DiagnosticsApp; +import dev.ultreon.mineos.apps.system.PredefinedResolution; +import dev.ultreon.mineos.apps.system.SystemApp; +import dev.ultreon.mineos.apps.system.component.FileBrowser; +import dev.ultreon.mineos.apps.system.task.TaskUpdateApplicationData; +import dev.ultreon.mineos.apps.system.task.TaskUpdateSystemData; import dev.ultreon.devices.util.GLHelper; -import dev.architectury.injectables.annotations.PlatformOnly; -import dev.architectury.platform.Mod; -import it.unimi.dsi.fastutil.ints.IntArraySet; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Font; -import net.minecraft.client.gui.screens.Screen; -import net.minecraft.core.BlockPos; -import net.minecraft.nbt.CompoundTag; import dev.ultreon.devices.api.bios.Bios; import dev.ultreon.devices.api.ApplicationManager; import dev.ultreon.devices.api.app.Dialog; @@ -72,28 +67,149 @@ * * @author MrCrayfish, XyperCode */ -public class MineOS extends Screen implements OperatingSystem, MineOSSystem { +public class MineOS implements MineOSSystem { public static final int ID = 1; public static final ResourceLocation ICON_TEXTURES = UltreonDevicesMod.res("textures/atlas/app_icons.png"); public static final int ICON_SIZE = 14; private static final List APPLICATIONS = new ArrayList<>(); - private static final List WALLPAPERS = new ArrayList<>(); + private static final List WALLPAPERS = new ArrayList<>(); private static final List tasks = new CopyOnWriteArrayList<>(); private static final Map instances = new HashMap<>(); + + // Mouse Type + public static final int + MT_MOVE = 0, + MT_CLICK = 1, + MT_SCROLL = 2; + + // Mouse Button + public static final int + MB_LEFT = 0, + MB_MIDDLE = 1, + MB_RIGHT = 2; + + // Keyboard Type + public static final int + KT_PRESS = 0, + KT_RELEASE = 1; + + // Keyboard Key + public static final int + KK_A = 'a', + KK_B = 'b', + KK_C = 'c', + KK_D = 'd', + KK_E = 'e', + KK_F = 'f', + KK_G = 'g', + KK_H = 'h', + KK_I = 'i', + KK_J = 'j', + KK_K = 'k', + KK_L = 'l', + KK_M = 'm', + KK_N = 'n', + KK_O = 'o', + KK_P = 'p', + KK_Q = 'q', + KK_R = 'r', + KK_S = 's', + KK_T = 't', + KK_U = 'u', + KK_V = 'v', + KK_W = 'w', + KK_X = 'x', + KK_Y = 'y', + KK_Z = 'z', + KK_0 = '0', + KK_1 = '1', + KK_2 = '2', + KK_3 = '3', + KK_4 = '4', + KK_5 = '5', + KK_6 = '6', + KK_7 = '7', + KK_8 = '8', + KK_9 = '9', + KK_SPACE = ' ', + KK_TAB = '\t', + KK_ENTER = '\n', + KK_BACKSPACE = 8, + KK_DELETE = 127, + KK_ESCAPE = 27, + KK_F1 = 256, + KK_F2 = 257, + KK_F3 = 258, + KK_F4 = 259, + KK_F5 = 260, + KK_F6 = 261, + KK_F7 = 262, + KK_F8 = 263, + KK_F9 = 264, + KK_F10 = 265, + KK_F11 = 266, + KK_F12 = 267, + KK_F13 = 268, + KK_F14 = 269, + KK_F15 = 270, + KK_F16 = 271, + KK_F17 = 272, + KK_F18 = 273, + KK_F19 = 274, + KK_F20 = 275, + KK_F21 = 276, + KK_F22 = 277, + KK_F23 = 278, + KK_F24 = 279, + KK_UP = 273, + KK_DOWN = 274, + KK_LEFT = 275, + KK_RIGHT = 276, + KK_HOME = 278, + KK_END = 279, + KK_INSERT = 277, + KK_PAGE_UP = 280, + KK_PAGE_DOWN = 281, + KK_SHIFT_LEFT = 340, + KK_SHIFT_RIGHT = 340, + KK_CTRL_LEFT = 341, + KK_CTRL_RIGHT = 341, + KK_ALT_LEFT = 342, + KK_ALT_RIGHT = 342, + KK_PRINTSCREEN = 283, + KK_PAUSE = 285, + KK_NUM_LOCK = 282, + KK_CAPS_LOCK = 283, + KK_SCROLL_LOCK = 284, + KK_META_LEFT = 343, + KK_META_RIGHT = 343, + KK_COMMAND_LEFT = 344, + KK_COMMAND_RIGHT = 344, + KK_MENU = 345, + KK_POWER = 1024, + KK_SEMICOLON = 59, + KK_EQUALS = 61, + KK_COMMA = 44, + KK_MINUS = 45, + KK_PERIOD = 46, + KK_SLASH = 47, + KK_GRAVE_ACCENT = 96, + KK_BACKSLASH = 92, + KK_BRACKET_LEFT = 91, + KK_BRACKET_RIGHT = 93, + KK_BACKTICK = 96; + private static MineOS instance = null; private static Font font; + private final MineOSKernel kernel = new MineOSKernel(); private final boolean worldLess; - private final ComputerBlockEntity computer; - private final IntArraySet pressed = new IntArraySet(); - private final Bios bios; + private Bios bios; private Double dragWindowFromX; private Double dragWindowFromY; - private VideoInfo videoInfo; + private VEFI_VideoSize videoInfo; - private MineOSSystem system; - private BlockPos pos; - private Drive mainDrive; + private VEFI_System system; private Settings settings; private TaskBar bar; CopyOnWriteArrayList> windows; @@ -107,31 +223,24 @@ public class MineOS extends Screen implements OperatingSystem, MineOSSystem { private Image wallpaper; private Layout wallpaperLayout; private BSOD bsod; - private Display display; + private VEFI_Handle display; + private VEFI_DeviceID bootDeviceId; + private int mouseX; + private int mouseY; /** * Creates a new laptop GUI. */ - public MineOS(@Nullable ComputerBlockEntity computer, Bios bios) { - this(computer, bios, computer == null); + public MineOS() { + this(false); } /** * Creates a new laptop GUI. */ - public MineOS(@Nullable ComputerBlockEntity computer, Bios bios, boolean worldLess) { - super(Component.literal("MineOS")); - this.minecraft = Minecraft.getInstance(); - - this.computer = computer; - this.bios = bios; + public MineOS(boolean worldLess) { + MineOS.instance = this; this.worldLess = worldLess; - - this.boot(bios); - - if (computer != null) { - MineOS.instances.put(bios.getDeviceId(), this); - } } @PlatformOnly("fabric") @@ -139,13 +248,13 @@ public static List getApplicationsForFabric() { return APPLICATIONS; } - public static List getWallpapers() { - return ImmutableList.copyOf(WALLPAPERS); + public static List getWallpapers() { + return Collections.unmodifiableList(WALLPAPERS); } public static Font getFont() { if (font == null) { - font = Minecraft.getInstance().font; + font = new Font(); } return font; } @@ -154,47 +263,20 @@ public static MineOS get(UUID id) { return instances.get(id); } - public static MineOS getOpened() { - OperatingSystem os = Display.get().getOS(); - if (os instanceof MineOS mineOS) { - return mineOS; - } - - throw new ClassCastException("Cannot cast " + os.getClass().getName() + " to " + MineOS.class.getName()); + public static MineOS get() { + return instance; } public int getScreenWidth() { - return videoInfo.getResolution().width(); + return videoInfo.width(); } public int getScreenHeight() { - return videoInfo.getResolution().height(); - } - - public DisplayResolution getResolution() { - return videoInfo.getResolution(); - } - - public CompoundTag getModSystemTag(Mod mod) { - return getModSystemTag(mod.getModId()); - } - - public CompoundTag getModSystemTag(String modId) { - CompoundTag mods = systemData.getCompound("Mods"); - systemData.put("Mods", mods); - CompoundTag mod = mods.getCompound(modId); - mods.put(modId, mod); - return mod; + return videoInfo.height(); } - @Override public boolean isWorldLess() { - return worldLess; - } - - @Override - public Screen getScreen() { - return this; + return false; } /** @@ -641,6 +723,11 @@ public void disconnectDisplay() { this.display = null; } + @Override + public VEFI_DeviceID getDeviceId() { + return bootDeviceId; + } + public UUID generateWindowId() { UUID id; int attempts = 0; @@ -660,6 +747,26 @@ public UUID generateWindowId() { return id; } + @Override + public void execute(Bios bios, VEFI_System system) { + this.bios = bios; + this.system = system; + this.videoInfo = (VEFI_VideoSize) bios.call(BiosCallType.GET_VIDEO_INFO, new Object[0]); + this.display = (VEFI_Handle) bios.call(BiosCallType.OPEN_DISPLAY, new Object[0]); + this.bootDeviceId = (VEFI_DeviceID) bios.call(BiosCallType.GET_BOOT_DEVICE_ID, new Object[0]); + + bios.registerInterrupt(BiosInterruptType.MOUSE, this::handleMouseData); + } + + private void handleMouseData(InterruptData interruptData) { + int type = interruptData.getField("type"); + + if (type == MT_MOVE) { + this.mouseX = interruptData.getField("x"); + this.mouseY = interruptData.getField("y"); + } + } + private static final class BSOD { private final Throwable throwable; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/client/Settings.java b/common/src/mineos/java/dev/ultreon/mineos/userspace/Settings.java similarity index 85% rename from common/src/main/java/dev/ultreon/devices/mineos/client/Settings.java rename to common/src/mineos/java/dev/ultreon/mineos/userspace/Settings.java index b4583268e..8901e3fac 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/client/Settings.java +++ b/common/src/mineos/java/dev/ultreon/mineos/userspace/Settings.java @@ -1,8 +1,8 @@ -package dev.ultreon.devices.mineos.client; +package dev.ultreon.mineos.userspace; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.mineos.apps.system.object.ColorScheme; -import dev.ultreon.devices.mineos.apps.system.object.Preset; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.apps.system.object.ColorScheme; +import dev.ultreon.mineos.apps.system.object.Preset; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; @@ -51,7 +51,7 @@ public CompoundTag toTag() { private CompoundTag appTintInfo() { var ct = new CompoundTag(); - for (AppInfo installedApplication : MineOS.getOpened().getInstalledApplications()) { + for (AppInfo installedApplication : MineOS.get().getInstalledApplications()) { ct.put(installedApplication.getId().toString(), installedApplication.getTintProvider().toTag()); } return ct; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/client/TaskBar.java b/common/src/mineos/java/dev/ultreon/mineos/userspace/TaskBar.java similarity index 92% rename from common/src/main/java/dev/ultreon/devices/mineos/client/TaskBar.java rename to common/src/mineos/java/dev/ultreon/mineos/userspace/TaskBar.java index 75499f6e7..a8af8f9bc 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/client/TaskBar.java +++ b/common/src/mineos/java/dev/ultreon/mineos/userspace/TaskBar.java @@ -1,19 +1,19 @@ -package dev.ultreon.devices.mineos.client; +package dev.ultreon.mineos.userspace; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.DebugLog; -import dev.ultreon.devices.api.TrayItemAdder; -import dev.ultreon.devices.api.event.LaptopEvent; -import dev.ultreon.devices.api.utils.RenderUtil; +import dev.ultreon.devices.impl.DebugLog; +import dev.ultreon.devices.impl.TrayItemAdder; +import dev.ultreon.devices.impl.event.LaptopEvent; +import dev.ultreon.devices.impl.utils.RenderUtil; import dev.ultreon.devices.core.network.TrayItemWifi; -import dev.ultreon.devices.api.util.Color; -import dev.ultreon.devices.api.util.Vulnerability; -import dev.ultreon.devices.object.AppInfo; -import dev.ultreon.devices.object.TrayItem; -import dev.ultreon.devices.mineos.apps.system.AppStore; -import dev.ultreon.devices.mineos.apps.system.FileBrowserApp; -import dev.ultreon.devices.mineos.apps.system.SettingsApp; +import dev.ultreon.devices.impl.util.Color; +import dev.ultreon.devices.impl.util.Vulnerability; +import dev.ultreon.mineos.object.AppInfo; +import dev.ultreon.mineos.object.TrayItem; +import dev.ultreon.mineos.apps.system.AppStore; +import dev.ultreon.mineos.apps.system.FileBrowserApp; +import dev.ultreon.mineos.apps.system.SettingsApp; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; diff --git a/common/src/main/java/dev/ultreon/devices/mineos/client/Window.java b/common/src/mineos/java/dev/ultreon/mineos/userspace/Window.java similarity index 97% rename from common/src/main/java/dev/ultreon/devices/mineos/client/Window.java rename to common/src/mineos/java/dev/ultreon/mineos/userspace/Window.java index 12d5e5a61..8f62a4bb0 100644 --- a/common/src/main/java/dev/ultreon/devices/mineos/client/Window.java +++ b/common/src/mineos/java/dev/ultreon/mineos/userspace/Window.java @@ -1,17 +1,17 @@ -package dev.ultreon.devices.mineos.client; +package dev.ultreon.mineos.userspace; import com.mojang.blaze3d.systems.RenderSystem; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.api.app.Dialog; +import dev.ultreon.devices.impl.app.Dialog; import dev.ultreon.devices.core.Wrappable; import dev.ultreon.devices.gui.GuiButtonClose; -import dev.ultreon.devices.api.app.Application; +import dev.ultreon.devices.impl.app.Application; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; -import dev.ultreon.devices.api.util.Color; +import dev.ultreon.devices.impl.util.Color; import org.jetbrains.annotations.Nullable; import java.util.UUID; @@ -92,7 +92,7 @@ public void render(GuiGraphics graphics, MineOS mineOS, Minecraft minecraft, int graphics.pose().pushPose(); - Color color = new Color(MineOS.getOpened().getSettings().getColorScheme().getWindowBackgroundColor()); + Color color = new Color(MineOS.get().getSettings().getColorScheme().getWindowBackgroundColor()); RenderSystem.enableBlend(); RenderSystem.setShaderTexture(0, WINDOW_GUI); RenderSystem.setShaderColor(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1); diff --git a/fabric-datagen-helper/src/main/java/com/jab125/clientint/ClientInit.java b/fabric-datagen-helper/src/main/java/dev/jab125/clientint/ClientInit.java similarity index 99% rename from fabric-datagen-helper/src/main/java/com/jab125/clientint/ClientInit.java rename to fabric-datagen-helper/src/main/java/dev/jab125/clientint/ClientInit.java index e20b9b6a2..f94065070 100644 --- a/fabric-datagen-helper/src/main/java/com/jab125/clientint/ClientInit.java +++ b/fabric-datagen-helper/src/main/java/dev/jab125/clientint/ClientInit.java @@ -1,4 +1,4 @@ -package com.jab125.clientint; +package dev.jab125.clientint; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; diff --git a/fabric-datagen-helper/src/main/java/com/jab125/clientint/mixin/LanguageManagerAccessor.java b/fabric-datagen-helper/src/main/java/dev/jab125/clientint/mixin/LanguageManagerAccessor.java similarity index 91% rename from fabric-datagen-helper/src/main/java/com/jab125/clientint/mixin/LanguageManagerAccessor.java rename to fabric-datagen-helper/src/main/java/dev/jab125/clientint/mixin/LanguageManagerAccessor.java index ade5f37b7..7d4080b86 100644 --- a/fabric-datagen-helper/src/main/java/com/jab125/clientint/mixin/LanguageManagerAccessor.java +++ b/fabric-datagen-helper/src/main/java/dev/jab125/clientint/mixin/LanguageManagerAccessor.java @@ -1,4 +1,4 @@ -package com.jab125.clientint.mixin; +package dev.jab125.clientint.mixin; import net.minecraft.client.resources.language.LanguageInfo; import net.minecraft.client.resources.language.LanguageManager; diff --git a/fabric-datagen-helper/src/main/resources/datahelp.mixins.json b/fabric-datagen-helper/src/main/resources/datahelp.mixins.json index ced26abdb..c89229792 100644 --- a/fabric-datagen-helper/src/main/resources/datahelp.mixins.json +++ b/fabric-datagen-helper/src/main/resources/datahelp.mixins.json @@ -6,7 +6,7 @@ "mixins": [ ], "client": [ - "LanguageManagerAccessor" + "dev.jab125.clientint.mixin.LanguageManagerAccessor" ], "injectors": { "defaultRequire": 1 diff --git a/fabric-datagen-helper/src/main/resources/fabric.mod.json b/fabric-datagen-helper/src/main/resources/fabric.mod.json index bc965a84e..b7349e6b7 100644 --- a/fabric-datagen-helper/src/main/resources/fabric.mod.json +++ b/fabric-datagen-helper/src/main/resources/fabric.mod.json @@ -4,7 +4,7 @@ "version": "1.0.0", "entrypoints": { "client": [ - "com.jab125.clientint.ClientInit" + "dev.jab125.clientint.ClientInit" ] }, "custom": { diff --git a/fabric-testmod/src/main/java/com/jab125/testmod/ClientInit.java b/fabric-testmod/src/main/java/dev/jab125/testmod/ClientInit.java similarity index 86% rename from fabric-testmod/src/main/java/com/jab125/testmod/ClientInit.java rename to fabric-testmod/src/main/java/dev/jab125/testmod/ClientInit.java index 495f47076..d92825816 100644 --- a/fabric-testmod/src/main/java/com/jab125/testmod/ClientInit.java +++ b/fabric-testmod/src/main/java/dev/jab125/testmod/ClientInit.java @@ -1,6 +1,6 @@ -package com.jab125.testmod; +package dev.jab125.testmod; -import dev.ultreon.devices.api.ApplicationManager; +import dev.ultreon.devices.impl.ApplicationManager; import dev.ultreon.devices.fabric.FabricApplicationRegistration; import net.fabricmc.api.ClientModInitializer; import net.minecraft.resources.ResourceLocation; diff --git a/fabric-testmod/src/main/java/com/jab125/testmod/TestApp.java b/fabric-testmod/src/main/java/dev/jab125/testmod/TestApp.java similarity index 75% rename from fabric-testmod/src/main/java/com/jab125/testmod/TestApp.java rename to fabric-testmod/src/main/java/dev/jab125/testmod/TestApp.java index 41bdd3492..58aaa40b7 100644 --- a/fabric-testmod/src/main/java/com/jab125/testmod/TestApp.java +++ b/fabric-testmod/src/main/java/dev/jab125/testmod/TestApp.java @@ -1,7 +1,7 @@ -package com.jab125.testmod; +package dev.jab125.testmod; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.app.component.Text; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.app.component.Text; import net.minecraft.nbt.CompoundTag; import org.jetbrains.annotations.Nullable; diff --git a/fabric-testmod/src/main/resources/fabric.mod.json b/fabric-testmod/src/main/resources/fabric.mod.json index e13939f02..0cca23bde 100644 --- a/fabric-testmod/src/main/resources/fabric.mod.json +++ b/fabric-testmod/src/main/resources/fabric.mod.json @@ -4,10 +4,10 @@ "version": "1.0.0", "entrypoints": { "client": [ - "com.jab125.testmod.ClientInit" + "dev.jab125.testmod.ClientInit" ], "devices:application_registration": [ - "com.jab125.testmod.ClientInit" + "dev.jab125.testmod.ClientInit" ] }, "custom": { diff --git a/fabric/src/main/java/dev/ultreon/devices/fabric/UltreonDevicesModFabric.java b/fabric/src/main/java/dev/ultreon/devices/fabric/UltreonDevicesModFabric.java index e18b34c46..41314aa7a 100644 --- a/fabric/src/main/java/dev/ultreon/devices/fabric/UltreonDevicesModFabric.java +++ b/fabric/src/main/java/dev/ultreon/devices/fabric/UltreonDevicesModFabric.java @@ -2,10 +2,10 @@ import dev.ultreon.devices.DeviceConfig; import dev.ultreon.devices.UltreonDevicesMod; -import dev.ultreon.devices.mineos.client.MineOS; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.print.PrintingManager; +import dev.ultreon.devices.os.mineos.userspace.MineOS; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.print.PrintingManager; import dev.ultreon.devices.init.RegistrationHandler; import fuzs.forgeconfigapiport.fabric.api.neoforge.v4.NeoForgeConfigRegistry; import net.fabricmc.api.ModInitializer; diff --git a/forge/build.gradle b/forge/build.gradle index 540ecb878..5c2128df0 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -40,6 +40,8 @@ dependencies { include forgeRuntimeLibrary("io.github.ultreon:ubo:1.3.0") include forgeRuntimeLibrary("io.github.ultreon.corelibs:commons-v0:0.2.0") + include forgeRuntimeLibrary("de.waldheinz:fat32-lib:0.6.5") + common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } diff --git a/forge/src/main/java/dev/ultreon/devices/forge/DevicesForge.java b/forge/src/main/java/dev/ultreon/devices/forge/DevicesForge.java index 0172c58e2..576bb24e3 100644 --- a/forge/src/main/java/dev/ultreon/devices/forge/DevicesForge.java +++ b/forge/src/main/java/dev/ultreon/devices/forge/DevicesForge.java @@ -5,10 +5,10 @@ import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.LaunchException; import dev.ultreon.devices.Reference; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.print.PrintingManager; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.print.PrintingManager; +import dev.ultreon.devices.os.mineos.userspace.MineOS; import dev.ultreon.devices.event.WorldDataHandler; import dev.ultreon.devices.init.RegistrationHandler; import dev.architectury.platform.forge.EventBuses; diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 2c424d4cf..046cce0dd 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -35,6 +35,8 @@ dependencies { include forgeRuntimeLibrary("io.github.ultreon:ubo:1.3.0") include forgeRuntimeLibrary("io.github.ultreon.corelibs:commons-v0:0.2.0") + include forgeRuntimeLibrary("de.waldheinz:fat32-lib:0.6.5") + forgeRuntimeLibrary project(":api") common(project(path: ":common", configuration: "namedElements")) { transitive false } diff --git a/neoforge/src/main/java/dev/ultreon/devices/forge/DevicesNeoForge.java b/neoforge/src/main/java/dev/ultreon/devices/forge/DevicesNeoForge.java index 2d40f2bcf..3740421d9 100644 --- a/neoforge/src/main/java/dev/ultreon/devices/forge/DevicesNeoForge.java +++ b/neoforge/src/main/java/dev/ultreon/devices/forge/DevicesNeoForge.java @@ -5,10 +5,10 @@ import dev.ultreon.devices.UltreonDevicesMod; import dev.ultreon.devices.LaunchException; import dev.ultreon.devices.Reference; -import dev.ultreon.devices.api.app.Application; -import dev.ultreon.devices.api.print.IPrint; -import dev.ultreon.devices.api.print.PrintingManager; -import dev.ultreon.devices.mineos.client.MineOS; +import dev.ultreon.devices.impl.app.Application; +import dev.ultreon.devices.impl.print.IPrint; +import dev.ultreon.devices.impl.print.PrintingManager; +import dev.ultreon.devices.os.mineos.userspace.MineOS; import dev.ultreon.devices.event.WorldDataHandler; import dev.ultreon.devices.init.RegistrationHandler; import net.minecraft.world.item.ItemStack;