diff options
author | nea <nea@nea.moe> | 2023-05-16 01:23:43 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-05-16 01:23:43 +0200 |
commit | ead6762eb1c005914b05f9d3c29f334989c67513 (patch) | |
tree | cd1409756be2bc4a93195c31d432fef053afe002 /src/main/kotlin/moe/nea | |
parent | 96c546cc73880a7c502c17aadda6ca84c847692d (diff) | |
download | Firmament-ead6762eb1c005914b05f9d3c29f334989c67513.tar.gz Firmament-ead6762eb1c005914b05f9d3c29f334989c67513.tar.bz2 Firmament-ead6762eb1c005914b05f9d3c29f334989c67513.zip |
Replace references to NEU with Firmament
Diffstat (limited to 'src/main/kotlin/moe/nea')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/Firmament.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt) | 36 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/commands/dsl.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/commands/dsl.kt) | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/commands/rome.kt | 66 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/dbus/FirmamentDbusInterface.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/dbus/NEUDbusInterface.kt) | 6 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/dbus/FirmamentDbusObject.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/dbus/NEUDbusObject.kt) | 10 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/NEUEvent.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/NEUEvent.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/NEUEventBus.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/NEUEventBus.kt) | 6 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/ParticleSpawnEvent.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/ParticleSpawnEvent.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/ScreenOpenEvent.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/ScreenOpenEvent.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/ServerChatLineReceivedEvent.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/ServerChatLineReceivedEvent.kt) | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/SkyblockServerUpdateEvent.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/SkyblockServerUpdateEvent.kt) | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/WorldReadyEvent.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/WorldReadyEvent.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/events/WorldRenderLastEvent.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/events/WorldRenderLastEvent.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/FeatureManager.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/features/FeatureManager.kt) | 12 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/NEUFeature.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/features/NEUFeature.kt) | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/fishing/FishingWarning.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/features/fishing/FishingWarning.kt) | 18 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/world/FairySouls.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/features/world/FairySouls.kt) | 26 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/ConfigGui.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/gui/ConfigGui.kt) | 8 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/WGridPanelWithPadding.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt) | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/gui/repogui.kt | 36 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/hud/RepoDownloadProgress.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/recipes/SBCraftingRecipe.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/recipes/SBCraftingRecipe.kt) | 8 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/recipes/SBForgeRecipe.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/recipes/SBForgeRecipe.kt) | 8 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/recipes/SBRecipe.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/recipes/SBRecipe.kt) | 6 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/rei/FirmamentReiPlugin.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt) | 16 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt) | 4 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/rei/NEUItemEntrySerializer.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt) | 6 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt) | 14 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/rei/SkyblockCraftingRecipeDynamicGenerator.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/rei/SkyblockCraftingRecipeDynamicGenerator.kt) | 10 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/rei/SkyblockItemIdFocusedStackProvider.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/rei/SkyblockItemIdFocusedStackProvider.kt) | 8 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/repo/ItemCache.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt) | 18 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/repo/RepoDownloadManager.kt) | 18 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/repo/RepoManager.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt) | 14 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/Locraw.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/Locraw.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/MC.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/MinecraftDispatcher.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/SBData.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/SBData.kt) | 14 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/ScreenUtil.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt) | 6 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/SequenceUtil.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/SequenceUtil.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/SkyblockId.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/TimeMark.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/TimeMark.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/Timer.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/Timer.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/config/ManagedConfig.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/config/ManagedConfig.kt) | 26 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/data/DataHolder.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/data/DataHolder.kt) | 12 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/data/IDataHolder.kt) | 10 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/data/ProfileSpecificDataHolder.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/data/ProfileSpecificDataHolder.kt) | 14 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/render/block.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt) | 2 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/textutil.kt (renamed from src/main/kotlin/moe/nea/notenoughupdates/util/textutil.kt) | 6 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/commands/rome.kt | 66 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt | 36 |
52 files changed, 296 insertions, 300 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt b/src/main/kotlin/moe/nea/firmament/Firmament.kt index 7563a7a..ec6cd3e 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt +++ b/src/main/kotlin/moe/nea/firmament/Firmament.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates +package moe.nea.firmament import com.mojang.brigadier.CommandDispatcher import io.ktor.client.* @@ -21,20 +21,20 @@ import kotlinx.coroutines.* import kotlinx.serialization.json.Json import kotlin.coroutines.EmptyCoroutineContext import net.minecraft.command.CommandRegistryAccess -import moe.nea.notenoughupdates.commands.registerNeuCommand -import moe.nea.notenoughupdates.dbus.NEUDbusObject -import moe.nea.notenoughupdates.features.FeatureManager -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.SBData -import moe.nea.notenoughupdates.util.data.IDataHolder +import moe.nea.firmament.commands.registerFirmamentCommand +import moe.nea.firmament.dbus.FirmamentDbusObject +import moe.nea.firmament.features.FeatureManager +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.data.IDataHolder -object NotEnoughUpdates : ModInitializer, ClientModInitializer { - const val MOD_ID = "notenoughupdates" +object Firmament : ModInitializer, ClientModInitializer { + const val MOD_ID = "firmament" - val DEBUG = System.getProperty("notenoughupdates.debug") == "true" - val DATA_DIR: Path = Path.of(".notenoughupdates").also { Files.createDirectories(it) } - val CONFIG_DIR: Path = Path.of("config/notenoughupdates").also { Files.createDirectories(it) } - val logger = LogManager.getLogger("NotEnoughUpdates") + val DEBUG = System.getProperty("firmament.debug") == "true" + val DATA_DIR: Path = Path.of(".firmament").also { Files.createDirectories(it) } + val CONFIG_DIR: Path = Path.of("config/firmament").also { Files.createDirectories(it) } + val logger = LogManager.getLogger("Firmament") val metadata: ModMetadata by lazy { FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow().metadata } val version: Version by lazy { metadata.version } @@ -50,7 +50,7 @@ object NotEnoughUpdates : ModInitializer, ClientModInitializer { json(json) } install(UserAgent) { - agent = "NotEnoughUpdates1.19/$version" + agent = "Firmament/$version" } } } @@ -59,20 +59,20 @@ object NotEnoughUpdates : ModInitializer, ClientModInitializer { val dbusConnection = DBusConnectionBuilder.forSessionBus() .build() val coroutineScope = - CoroutineScope(EmptyCoroutineContext + CoroutineName("NotEnoughUpdates")) + SupervisorJob(globalJob) + CoroutineScope(EmptyCoroutineContext + CoroutineName("Firmament")) + SupervisorJob(globalJob) private fun registerCommands( dispatcher: CommandDispatcher<FabricClientCommandSource>, @Suppress("UNUSED_PARAMETER") ctx: CommandRegistryAccess ) { - registerNeuCommand(dispatcher) + registerFirmamentCommand(dispatcher) } override fun onInitialize() { - dbusConnection.requestBusName("moe.nea.notenoughupdates") - dbusConnection.exportObject(NEUDbusObject) + dbusConnection.requestBusName("moe.nea.firmament") + dbusConnection.exportObject(FirmamentDbusObject) IDataHolder.registerEvents() RepoManager.initialize() SBData.init() diff --git a/src/main/kotlin/moe/nea/notenoughupdates/commands/dsl.kt b/src/main/kotlin/moe/nea/firmament/commands/dsl.kt index 6190d88..5ead624 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/commands/dsl.kt +++ b/src/main/kotlin/moe/nea/firmament/commands/dsl.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.commands +package moe.nea.firmament.commands import com.mojang.brigadier.arguments.ArgumentType import com.mojang.brigadier.builder.ArgumentBuilder @@ -7,7 +7,7 @@ import com.mojang.brigadier.builder.RequiredArgumentBuilder import com.mojang.brigadier.context.CommandContext import java.lang.reflect.ParameterizedType import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource -import moe.nea.notenoughupdates.util.iterate +import moe.nea.firmament.util.iterate typealias DefaultSource = FabricClientCommandSource diff --git a/src/main/kotlin/moe/nea/firmament/commands/rome.kt b/src/main/kotlin/moe/nea/firmament/commands/rome.kt new file mode 100644 index 0000000..bdbaa3f --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/commands/rome.kt @@ -0,0 +1,66 @@ +package moe.nea.firmament.commands + +import com.mojang.brigadier.CommandDispatcher +import io.github.cottonmc.cotton.gui.client.CottonClientScreen +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource +import net.minecraft.text.Text +import moe.nea.firmament.features.world.FairySouls +import moe.nea.firmament.gui.repoGui +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.ScreenUtil.setScreenLater + + +fun firmamentCommand() = literal("firmament") { + thenLiteral("repo") { + thenLiteral("reload") { + thenLiteral("fetch") { + thenExecute { + source.sendFeedback(Text.translatable("firmament.repo.reload.network")) // TODO better reporting + RepoManager.launchAsyncUpdate() + } + } + thenExecute { + source.sendFeedback(Text.translatable("firmament.repo.reload.disk")) + RepoManager.reload() + } + } + thenExecute { + setScreenLater(CottonClientScreen(repoGui())) + } + } + thenLiteral("dev") { + thenLiteral("config") { + thenExecute { + FairySouls.TConfig.showConfigEditor() + } + } + thenLiteral("sbdata") { + thenExecute { + source.sendFeedback(Text.translatable("firmament.sbinfo.profile", SBData.profileCuteName)) + val locrawInfo = SBData.locraw + if (locrawInfo == null) { + source.sendFeedback(Text.translatable("firmament.sbinfo.nolocraw")) + } else { + source.sendFeedback(Text.translatable("firmament.sbinfo.server", locrawInfo.server)) + source.sendFeedback(Text.translatable("firmament.sbinfo.gametype", locrawInfo.gametype)) + source.sendFeedback(Text.translatable("firmament.sbinfo.mode", locrawInfo.mode)) + source.sendFeedback(Text.translatable("firmament.sbinfo.map", locrawInfo.map)) + } + + } + } + } +} + + +fun registerFirmamentCommand(dispatcher: CommandDispatcher<FabricClientCommandSource>) { + val firmament = dispatcher.register(firmamentCommand()) + dispatcher.register(literal("firm") { + redirect(firmament) + }) +} + + + + diff --git a/src/main/kotlin/moe/nea/notenoughupdates/dbus/NEUDbusInterface.kt b/src/main/kotlin/moe/nea/firmament/dbus/FirmamentDbusInterface.kt index 28ff370..24b7dc8 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/dbus/NEUDbusInterface.kt +++ b/src/main/kotlin/moe/nea/firmament/dbus/FirmamentDbusInterface.kt @@ -1,10 +1,10 @@ -package moe.nea.notenoughupdates.dbus +package moe.nea.firmament.dbus import org.freedesktop.dbus.annotations.DBusInterfaceName import org.freedesktop.dbus.interfaces.DBusInterface -@DBusInterfaceName("moe.nea.NotEnoughUpdates") -interface NEUDbusInterface : DBusInterface { +@DBusInterfaceName("moe.nea.Firmament") +interface FirmamentDbusInterface : DBusInterface { fun sayHello(): String fun getCurrentRepoCommit(): String fun requestRepoReDownload() diff --git a/src/main/kotlin/moe/nea/notenoughupdates/dbus/NEUDbusObject.kt b/src/main/kotlin/moe/nea/firmament/dbus/FirmamentDbusObject.kt index 4e3d362..48d4cf7 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/dbus/NEUDbusObject.kt +++ b/src/main/kotlin/moe/nea/firmament/dbus/FirmamentDbusObject.kt @@ -1,10 +1,10 @@ -package moe.nea.notenoughupdates.dbus +package moe.nea.firmament.dbus -import moe.nea.notenoughupdates.repo.RepoManager +import moe.nea.firmament.repo.RepoManager -object NEUDbusObject : NEUDbusInterface { +object FirmamentDbusObject : FirmamentDbusInterface { override fun sayHello(): String { - return "Hello from NEU" + return "Hello from Firmanet" } override fun getCurrentRepoCommit(): String { @@ -16,6 +16,6 @@ object NEUDbusObject : NEUDbusInterface { } override fun getObjectPath(): String { - return "/moe/nea/NotEnoughUpdates" + return "/moe/nea/Firmament" } } diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/NEUEvent.kt b/src/main/kotlin/moe/nea/firmament/events/NEUEvent.kt index 81dc6fc..722ea64 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/NEUEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/NEUEvent.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events /** * An event that can be fired by a [NEUEventBus]. diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/NEUEventBus.kt b/src/main/kotlin/moe/nea/firmament/events/NEUEventBus.kt index 7eb0ecd..b3b9152 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/NEUEventBus.kt +++ b/src/main/kotlin/moe/nea/firmament/events/NEUEventBus.kt @@ -1,7 +1,7 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events import java.util.concurrent.CopyOnWriteArrayList -import moe.nea.notenoughupdates.NotEnoughUpdates +import moe.nea.firmament.Firmament /** * A pubsub event bus. @@ -27,7 +27,7 @@ open class NEUEventBus<T : NEUEvent> { try { function.invocation(event) } catch (e: Exception) { - NotEnoughUpdates.logger.error("Caught exception during processing event $event", e) + Firmament.logger.error("Caught exception during processing event $event", e) } } } diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/ParticleSpawnEvent.kt b/src/main/kotlin/moe/nea/firmament/events/ParticleSpawnEvent.kt index 23c67a0..bbf7289 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/ParticleSpawnEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/ParticleSpawnEvent.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events import net.minecraft.particle.ParticleEffect import net.minecraft.util.math.Vec3d diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/ScreenOpenEvent.kt b/src/main/kotlin/moe/nea/firmament/events/ScreenOpenEvent.kt index 793f066..ee162ab 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/ScreenOpenEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/ScreenOpenEvent.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events import net.minecraft.client.gui.screen.Screen diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/ServerChatLineReceivedEvent.kt b/src/main/kotlin/moe/nea/firmament/events/ServerChatLineReceivedEvent.kt index 681ec6c..7e8531c 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/ServerChatLineReceivedEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/ServerChatLineReceivedEvent.kt @@ -1,7 +1,7 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events import net.minecraft.text.Text -import moe.nea.notenoughupdates.util.unformattedString +import moe.nea.firmament.util.unformattedString /** * This event gets published whenever the client receives a chat message from the server. diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/SkyblockServerUpdateEvent.kt b/src/main/kotlin/moe/nea/firmament/events/SkyblockServerUpdateEvent.kt index 541b4c6..ae3227f 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/SkyblockServerUpdateEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/SkyblockServerUpdateEvent.kt @@ -1,6 +1,6 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events -import moe.nea.notenoughupdates.util.Locraw +import moe.nea.firmament.util.Locraw /** * This event gets published whenever `/locraw` is queried and HyPixel returns a location different to the old one. diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/WorldReadyEvent.kt b/src/main/kotlin/moe/nea/firmament/events/WorldReadyEvent.kt index 5f305f1..5b01258 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/WorldReadyEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/WorldReadyEvent.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events class WorldReadyEvent : NEUEvent() { companion object : NEUEventBus<WorldReadyEvent>() diff --git a/src/main/kotlin/moe/nea/notenoughupdates/events/WorldRenderLastEvent.kt b/src/main/kotlin/moe/nea/firmament/events/WorldRenderLastEvent.kt index 60b7e06..c23d923 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/events/WorldRenderLastEvent.kt +++ b/src/main/kotlin/moe/nea/firmament/events/WorldRenderLastEvent.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.events +package moe.nea.firmament.events import org.joml.Matrix4f import net.minecraft.client.render.Camera diff --git a/src/main/kotlin/moe/nea/notenoughupdates/features/FeatureManager.kt b/src/main/kotlin/moe/nea/firmament/features/FeatureManager.kt index 2512992..68205f4 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/features/FeatureManager.kt +++ b/src/main/kotlin/moe/nea/firmament/features/FeatureManager.kt @@ -1,11 +1,11 @@ -package moe.nea.notenoughupdates.features +package moe.nea.firmament.features import kotlinx.serialization.Serializable import kotlinx.serialization.serializer -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.features.fishing.FishingWarning -import moe.nea.notenoughupdates.features.world.FairySouls -import moe.nea.notenoughupdates.util.data.DataHolder +import moe.nea.firmament.Firmament +import moe.nea.firmament.features.fishing.FishingWarning +import moe.nea.firmament.features.world.FairySouls +import moe.nea.firmament.util.data.DataHolder object FeatureManager : DataHolder<FeatureManager.Config>(serializer(), "features", ::Config) { @Serializable @@ -33,7 +33,7 @@ object FeatureManager : DataHolder<FeatureManager.Config>(serializer(), "feature fun loadFeature(feature: NEUFeature) { synchronized(features) { if (feature.identifier in features) { - NotEnoughUpdates.logger.error("Double registering feature ${feature.identifier}. Ignoring second instance $feature") + Firmament.logger.error("Double registering feature ${feature.identifier}. Ignoring second instance $feature") return } features[feature.identifier] = feature diff --git a/src/main/kotlin/moe/nea/notenoughupdates/features/NEUFeature.kt b/src/main/kotlin/moe/nea/firmament/features/NEUFeature.kt index 39cfb35..f231003 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/features/NEUFeature.kt +++ b/src/main/kotlin/moe/nea/firmament/features/NEUFeature.kt @@ -1,6 +1,6 @@ -package moe.nea.notenoughupdates.features +package moe.nea.firmament.features -import moe.nea.notenoughupdates.util.config.ManagedConfig +import moe.nea.firmament.util.config.ManagedConfig interface NEUFeature { val name: String diff --git a/src/main/kotlin/moe/nea/notenoughupdates/features/fishing/FishingWarning.kt b/src/main/kotlin/moe/nea/firmament/features/fishing/FishingWarning.kt index c44201c..cdeb24c 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/features/fishing/FishingWarning.kt +++ b/src/main/kotlin/moe/nea/firmament/features/fishing/FishingWarning.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.features.fishing +package moe.nea.firmament.features.fishing import kotlin.math.abs import kotlin.math.absoluteValue @@ -10,14 +10,14 @@ import kotlin.time.Duration.Companion.seconds import net.minecraft.entity.projectile.FishingBobberEntity import net.minecraft.particle.ParticleTypes import net.minecraft.util.math.Vec3d -import moe.nea.notenoughupdates.events.ParticleSpawnEvent -import moe.nea.notenoughupdates.events.WorldReadyEvent -import moe.nea.notenoughupdates.events.WorldRenderLastEvent -import moe.nea.notenoughupdates.features.NEUFeature -import moe.nea.notenoughupdates.util.MC -import moe.nea.notenoughupdates.util.TimeMark -import moe.nea.notenoughupdates.util.config.ManagedConfig -import moe.nea.notenoughupdates.util.render.RenderBlockContext.Companion.renderBlocks +import moe.nea.firmament.events.ParticleSpawnEvent +import moe.nea.firmament.events.WorldReadyEvent +import moe.nea.firmament.events.WorldRenderLastEvent +import moe.nea.firmament.features.NEUFeature +import moe.nea.firmament.util.MC +import moe.nea.firmament.util.TimeMark +import moe.nea.firmament.util.config.ManagedConfig +import moe.nea.firmament.util.render.RenderBlockContext.Companion.renderBlocks object FishingWarning : NEUFeature { override val name: String diff --git a/src/main/kotlin/moe/nea/notenoughupdates/features/world/FairySouls.kt b/src/main/kotlin/moe/nea/firmament/features/world/FairySouls.kt index ae045c0..f752963 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/features/world/FairySouls.kt +++ b/src/main/kotlin/moe/nea/firmament/features/world/FairySouls.kt @@ -1,20 +1,20 @@ -package moe.nea.notenoughupdates.features.world +package moe.nea.firmament.features.world import io.github.moulberry.repo.data.Coordinate import kotlinx.serialization.Serializable import kotlinx.serialization.serializer -import moe.nea.notenoughupdates.events.ServerChatLineReceivedEvent -import moe.nea.notenoughupdates.events.SkyblockServerUpdateEvent -import moe.nea.notenoughupdates.events.WorldRenderLastEvent -import moe.nea.notenoughupdates.features.NEUFeature -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.MC -import moe.nea.notenoughupdates.util.SBData -import moe.nea.notenoughupdates.util.blockPos -import moe.nea.notenoughupdates.util.config.ManagedConfig -import moe.nea.notenoughupdates.util.data.ProfileSpecificDataHolder -import moe.nea.notenoughupdates.util.render.RenderBlockContext.Companion.renderBlocks -import moe.nea.notenoughupdates.util.unformattedString +import moe.nea.firmament.events.ServerChatLineReceivedEvent +import moe.nea.firmament.events.SkyblockServerUpdateEvent +import moe.nea.firmament.events.WorldRenderLastEvent +import moe.nea.firmament.features.NEUFeature +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.MC +import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.blockPos +import moe.nea.firmament.util.config.ManagedConfig +import moe.nea.firmament.util.data.ProfileSpecificDataHolder +import moe.nea.firmament.util.render.RenderBlockContext.Companion.renderBlocks +import moe.nea.firmament.util.unformattedString object FairySouls : NEUFeature { diff --git a/src/main/kotlin/moe/nea/notenoughupdates/gui/ConfigGui.kt b/src/main/kotlin/moe/nea/firmament/gui/ConfigGui.kt index 06d0ad0..6acf68a 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/gui/ConfigGui.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/ConfigGui.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.gui +package moe.nea.firmament.gui import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription import io.github.cottonmc.cotton.gui.widget.WButton @@ -8,8 +8,8 @@ import io.github.cottonmc.cotton.gui.widget.WToggleButton import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment import io.github.cottonmc.cotton.gui.widget.data.Insets import io.github.cottonmc.cotton.gui.widget.data.VerticalAlignment -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.util.data.DataHolder +import moe.nea.firmament.Firmament +import moe.nea.firmament.util.data.DataHolder import net.minecraft.text.Text import kotlin.reflect.KMutableProperty1 @@ -26,7 +26,7 @@ class ConfigGui<K>(val holder: DataHolder<K>, val build: ConfigGui<K>.() -> Unit fun title(text: Text) { if (col != 0) { - NotEnoughUpdates.logger.warn("Set title not at the top of the ConfigGui") + Firmament.logger.warn("Set title not at the top of the ConfigGui") } val label = WLabel(text) label.verticalAlignment = VerticalAlignment.TOP diff --git a/src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt b/src/main/kotlin/moe/nea/firmament/gui/WGridPanelWithPadding.kt index 287483e..255b80d 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/gui/WGridPanelWithPadding.kt +++ b/src/main/kotlin/moe/nea/firmament/gui/WGridPanelWithPadding.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.gui +package moe.nea.firmament.gui import io.github.cottonmc.cotton.gui.widget.WPanelWithInsets import io.github.cottonmc.cotton.gui.widget.WWidget @@ -30,4 +30,4 @@ class WGridPanelWithPadding( return this } -}
\ No newline at end of file +} diff --git a/src/main/kotlin/moe/nea/firmament/gui/repogui.kt b/src/main/kotlin/moe/nea/firmament/gui/repogui.kt new file mode 100644 index 0000000..da681e4 --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/gui/repogui.kt @@ -0,0 +1,36 @@ +package moe.nea.firmament.gui + +import net.minecraft.text.Text +import moe.nea.firmament.repo.RepoManager + +fun repoGui(): ConfigGui<RepoManager.Config> { + return ConfigGui(RepoManager) { + title(Text.translatable("firmament.gui.repo.title")) + toggle(Text.translatable("firmament.gui.repo.autoupdate"), RepoManager.Config::autoUpdate) + textfield( + Text.translatable("firmament.gui.repo.username"), + Text.translatable("firmament.gui.repo.hint.username"), + RepoManager.Config::user, + maxLength = 255 + ) + textfield( + Text.translatable("firmament.gui.repo.reponame"), + Text.translatable("firmament.gui.repo.hint.reponame"), + RepoManager.Config::repo + ) + textfield( + Text.translatable("firmament.gui.repo.branch"), + Text.translatable("firmament.gui.repo.hint.branch"), + RepoManager.Config::branch + ) + button( + Text.translatable("firmament.gui.repo.reset.label"), + Text.translatable("firmament.gui.repo.reset"), + ) { + RepoManager.data.user = "NotEnoughUpdates" + RepoManager.data.repo = "NotEnoughUpdates-REPO" + RepoManager.data.branch = "dangerous" + reload() + } + } +} diff --git a/src/main/kotlin/moe/nea/notenoughupdates/hud/RepoDownloadProgress.kt b/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt index 5ef6c5b..315230b 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/hud/RepoDownloadProgress.kt +++ b/src/main/kotlin/moe/nea/firmament/hud/RepoDownloadProgress.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.hud +package moe.nea.firmament.hud import io.github.cottonmc.cotton.gui.client.ScreenDrawing import io.github.cottonmc.cotton.gui.widget.WWidget diff --git a/src/main/kotlin/moe/nea/notenoughupdates/recipes/SBCraftingRecipe.kt b/src/main/kotlin/moe/nea/firmament/recipes/SBCraftingRecipe.kt index 9d7e9cc..0cf63fc 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/recipes/SBCraftingRecipe.kt +++ b/src/main/kotlin/moe/nea/firmament/recipes/SBCraftingRecipe.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.recipes +package moe.nea.firmament.recipes import io.github.moulberry.repo.data.NEUCraftingRecipe import io.github.moulberry.repo.data.NEUIngredient @@ -12,14 +12,14 @@ import me.shedaniel.rei.api.common.category.CategoryIdentifier import me.shedaniel.rei.api.common.util.EntryStacks import net.minecraft.block.Blocks import net.minecraft.text.Text -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.rei.SBItemEntryDefinition +import moe.nea.firmament.Firmament +import moe.nea.firmament.rei.SBItemEntryDefinition class SBCraftingRecipe(override val neuRecipe: NEUCraftingRecipe) : SBRecipe() { override fun getCategoryIdentifier(): CategoryIdentifier<*> = Category.catIdentifier object Category : DisplayCategory<SBCraftingRecipe> { - val catIdentifier = CategoryIdentifier.of<SBCraftingRecipe>(NotEnoughUpdates.MOD_ID, "crafing_recipe") + val catIdentifier = CategoryIdentifier.of<SBCraftingRecipe>(Firmament.MOD_ID, "crafing_recipe") override fun getCategoryIdentifier(): CategoryIdentifier<out SBCraftingRecipe> = catIdentifier override fun getTitle(): Text = Text.literal("SkyBlock Crafting") diff --git a/src/main/kotlin/moe/nea/notenoughupdates/recipes/SBForgeRecipe.kt b/src/main/kotlin/moe/nea/firmament/recipes/SBForgeRecipe.kt index a9301ac..b00005f 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/recipes/SBForgeRecipe.kt +++ b/src/main/kotlin/moe/nea/firmament/recipes/SBForgeRecipe.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.recipes +package moe.nea.firmament.recipes import io.github.moulberry.repo.data.NEUForgeRecipe import me.shedaniel.math.Point @@ -11,15 +11,15 @@ import me.shedaniel.rei.api.common.category.CategoryIdentifier import me.shedaniel.rei.api.common.util.EntryStacks import net.minecraft.block.Blocks import net.minecraft.text.Text -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.rei.SBItemEntryDefinition +import moe.nea.firmament.Firmament +import moe.nea.firmament.rei.SBItemEntryDefinition class SBForgeRecipe(override val neuRecipe: NEUForgeRecipe) : SBRecipe() { override fun getCategoryIdentifier(): CategoryIdentifier<*> = Category.categoryIdentifier object Category : DisplayCategory<SBForgeRecipe> { override fun getCategoryIdentifier(): CategoryIdentifier<SBForgeRecipe> = - CategoryIdentifier.of(NotEnoughUpdates.MOD_ID, "forge_recipe") + CategoryIdentifier.of(Firmament.MOD_ID, "forge_recipe") override fun getTitle(): Text = Text.literal("Forge Recipes") override fun getDisplayHeight(): Int { diff --git a/src/main/kotlin/moe/nea/notenoughupdates/recipes/SBRecipe.kt b/src/main/kotlin/moe/nea/firmament/recipes/SBRecipe.kt index 2e39d7e..ed982bd 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/recipes/SBRecipe.kt +++ b/src/main/kotlin/moe/nea/firmament/recipes/SBRecipe.kt @@ -1,10 +1,10 @@ -package moe.nea.notenoughupdates.recipes +package moe.nea.firmament.recipes import io.github.moulberry.repo.data.NEURecipe import me.shedaniel.rei.api.common.display.Display import me.shedaniel.rei.api.common.entry.EntryIngredient -import moe.nea.notenoughupdates.rei.SBItemEntryDefinition -import moe.nea.notenoughupdates.util.SkyblockId +import moe.nea.firmament.rei.SBItemEntryDefinition +import moe.nea.firmament.util.SkyblockId abstract class SBRecipe() : Display { abstract val neuRecipe: NEURecipe diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt b/src/main/kotlin/moe/nea/firmament/rei/FirmamentReiPlugin.kt index 34d98fa..992b104 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/FirmamentReiPlugin.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.rei +package moe.nea.firmament.rei import io.github.moulberry.repo.data.NEUItem import me.shedaniel.rei.api.client.plugins.REIClientPlugin @@ -13,21 +13,21 @@ import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes import net.minecraft.item.ItemStack import net.minecraft.text.Text import net.minecraft.util.Identifier -import moe.nea.notenoughupdates.recipes.SBCraftingRecipe -import moe.nea.notenoughupdates.recipes.SBForgeRecipe -import moe.nea.notenoughupdates.repo.ItemCache.asItemStack -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.SkyblockId +import moe.nea.firmament.recipes.SBCraftingRecipe +import moe.nea.firmament.recipes.SBForgeRecipe +import moe.nea.firmament.repo.ItemCache.asItemStack +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.SkyblockId -class NEUReiPlugin : REIClientPlugin { +class FirmamentReiPlugin : REIClientPlugin { companion object { fun EntryStack<NEUItem>.asItemEntry(): EntryStack<ItemStack> { return EntryStack.of(VanillaEntryTypes.ITEM, value.asItemStack()) } - val SKYBLOCK_ITEM_TYPE_ID = Identifier("notenoughupdates", "skyblockitems") + val SKYBLOCK_ITEM_TYPE_ID = Identifier("firmament", "skyblockitems") } override fun registerEntryTypes(registry: EntryTypeRegistry) { diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt b/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt index 111aaf7..8253c96 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntryRenderer.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntryRenderer.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.rei +package moe.nea.firmament.rei import io.github.moulberry.repo.data.NEUItem import me.shedaniel.math.Rectangle @@ -7,7 +7,7 @@ import me.shedaniel.rei.api.client.gui.widgets.Tooltip import me.shedaniel.rei.api.client.gui.widgets.TooltipContext import me.shedaniel.rei.api.common.entry.EntryStack import net.minecraft.client.util.math.MatrixStack -import moe.nea.notenoughupdates.rei.NEUReiPlugin.Companion.asItemEntry +import moe.nea.firmament.rei.FirmamentReiPlugin.Companion.asItemEntry object NEUItemEntryRenderer : EntryRenderer<NEUItem> { override fun render( diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt b/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntrySerializer.kt index b6c81a7..15731cb 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUItemEntrySerializer.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/NEUItemEntrySerializer.kt @@ -1,11 +1,11 @@ -package moe.nea.notenoughupdates.rei +package moe.nea.firmament.rei import io.github.moulberry.repo.data.NEUItem import me.shedaniel.rei.api.common.entry.EntrySerializer import me.shedaniel.rei.api.common.entry.EntryStack import net.minecraft.nbt.NbtCompound -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.SkyblockId +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.SkyblockId object NEUItemEntrySerializer : EntrySerializer<NEUItem?> { const val SKYBLOCK_ID_ENTRY = "SKYBLOCK_ID" diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt b/src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt index 0b43407..f8dbce7 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.rei +package moe.nea.firmament.rei import io.github.moulberry.repo.data.NEUIngredient import io.github.moulberry.repo.data.NEUItem @@ -14,11 +14,11 @@ import net.minecraft.item.ItemStack import net.minecraft.registry.tag.TagKey import net.minecraft.text.Text import net.minecraft.util.Identifier -import moe.nea.notenoughupdates.rei.NEUReiPlugin.Companion.asItemEntry -import moe.nea.notenoughupdates.repo.ItemCache.asItemStack -import moe.nea.notenoughupdates.repo.ItemCache.getIdentifier -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.SkyblockId +import moe.nea.firmament.rei.FirmamentReiPlugin.Companion.asItemEntry +import moe.nea.firmament.repo.ItemCache.asItemStack +import moe.nea.firmament.repo.ItemCache.getIdentifier +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.SkyblockId // TODO: allow stackable entries object SBItemEntryDefinition : EntryDefinition<NEUItem> { @@ -31,7 +31,7 @@ object SBItemEntryDefinition : EntryDefinition<NEUItem> { } override fun getValueType(): Class<NEUItem> = NEUItem::class.java - override fun getType(): EntryType<NEUItem> = EntryType.deferred(NEUReiPlugin.SKYBLOCK_ITEM_TYPE_ID) + override fun getType(): EntryType<NEUItem> = EntryType.deferred(FirmamentReiPlugin.SKYBLOCK_ITEM_TYPE_ID) override fun getRenderer(): EntryRenderer<NEUItem> = NEUItemEntryRenderer diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/SkyblockCraftingRecipeDynamicGenerator.kt b/src/main/kotlin/moe/nea/firmament/rei/SkyblockCraftingRecipeDynamicGenerator.kt index cc31427..c806ea0 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/rei/SkyblockCraftingRecipeDynamicGenerator.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/SkyblockCraftingRecipeDynamicGenerator.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.rei +package moe.nea.firmament.rei import io.github.moulberry.repo.data.NEUCraftingRecipe import io.github.moulberry.repo.data.NEUForgeRecipe @@ -9,10 +9,10 @@ import me.shedaniel.rei.api.client.registry.display.DynamicDisplayGenerator import me.shedaniel.rei.api.client.view.ViewSearchBuilder import me.shedaniel.rei.api.common.display.Display import me.shedaniel.rei.api.common.entry.EntryStack -import moe.nea.notenoughupdates.recipes.SBCraftingRecipe -import moe.nea.notenoughupdates.recipes.SBForgeRecipe -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.skyblockId +import moe.nea.firmament.recipes.SBCraftingRecipe +import moe.nea.firmament.recipes.SBForgeRecipe +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.skyblockId val SkyblockCraftingRecipeDynamicGenerator = neuDisplayGenerator<SBCraftingRecipe, NEUCraftingRecipe> { diff --git a/src/main/kotlin/moe/nea/notenoughupdates/rei/SkyblockItemIdFocusedStackProvider.kt b/src/main/kotlin/moe/nea/firmament/rei/SkyblockItemIdFocusedStackProvider.kt index 8592126..c874fc3 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/rei/SkyblockItemIdFocusedStackProvider.kt +++ b/src/main/kotlin/moe/nea/firmament/rei/SkyblockItemIdFocusedStackProvider.kt @@ -1,12 +1,12 @@ -package moe.nea.notenoughupdates.rei +package moe.nea.firmament.rei import dev.architectury.event.CompoundEventResult import me.shedaniel.math.Point import me.shedaniel.rei.api.client.registry.screen.FocusedStackProvider import me.shedaniel.rei.api.common.entry.EntryStack -import moe.nea.notenoughupdates.mixins.accessor.AccessorHandledScreen -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.skyBlockId +import moe.nea.firmament.mixins.accessor.AccessorHandledScreen +import moe.nea.firmament.repo.RepoManager +import moe.nea.firmament.util.skyBlockId import net.minecraft.client.gui.screen.Screen import net.minecraft.client.gui.screen.ingame.HandledScreen diff --git a/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt b/src/main/kotlin/moe/nea/firmament/repo/ItemCache.kt index ae2b7d2..bd624b6 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt +++ b/src/main/kotlin/moe/nea/firmament/repo/ItemCache.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.repo +package moe.nea.firmament.repo import com.mojang.serialization.Dynamic import io.github.cottonmc.cotton.gui.client.CottonHud @@ -21,10 +21,10 @@ import net.minecraft.item.Items import net.minecraft.nbt.NbtCompound import net.minecraft.nbt.NbtOps import net.minecraft.text.Text -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.util.LegacyTagParser -import moe.nea.notenoughupdates.util.appendLore -import moe.nea.notenoughupdates.util.skyblockId +import moe.nea.firmament.Firmament +import moe.nea.firmament.util.LegacyTagParser +import moe.nea.firmament.util.appendLore +import moe.nea.firmament.util.skyblockId object ItemCache : IReloadable { val dfuLog = Path.of("logs/dfulog.txt") @@ -51,7 +51,7 @@ object ItemCache : IReloadable { ).value as NbtCompound } catch (e: Exception) { if (isFlawless) - NotEnoughUpdates.logger.error("Failed to run data fixer an item. Check ${dfuLog.absolutePathString()} for more information") + Firmament.logger.error("Failed to run data fixer an item. Check ${dfuLog.absolutePathString()} for more information") isFlawless = false e.printStackTrace(dfuHandle) null @@ -60,7 +60,7 @@ object ItemCache : IReloadable { fun brokenItemStack(neuItem: NEUItem?): ItemStack { return ItemStack(Items.PAINTING).apply { setCustomName(Text.literal(neuItem?.displayName ?: "null")) - appendLore(listOf(Text.translatable("notenoughupdates.repo.brokenitem", neuItem?.skyblockItemId))) + appendLore(listOf(Text.translatable("firmament.repo.brokenitem", neuItem?.skyblockItemId))) } } @@ -103,13 +103,13 @@ object ItemCache : IReloadable { cache.clear() isFlawless = true - job = NotEnoughUpdates.coroutineScope.launch { + job = Firmament.coroutineScope.launch { val items = repository.items?.items if (items == null) { CottonHud.remove(RepoManager.progressBar) return@launch } - val recacheItems = I18n.translate("notenoughupdates.repo.cache") + val recacheItems = I18n.translate("firmament.repo.cache") RepoManager.progressBar.reportProgress(recacheItems, 0, items.size) CottonHud.add(RepoManager.progressBar) var i = 0 diff --git a/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoDownloadManager.kt b/src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt index 34b49e7..09b246a 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoDownloadManager.kt +++ b/src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.repo +package moe.nea.firmament.repo import io.ktor.client.call.* import io.ktor.client.request.* @@ -8,9 +8,9 @@ import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.withContext import kotlinx.serialization.Serializable -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.NotEnoughUpdates.logger -import moe.nea.notenoughupdates.util.iterate +import moe.nea.firmament.Firmament +import moe.nea.firmament.Firmament.logger +import moe.nea.firmament.util.iterate import java.io.IOException import java.nio.file.Files import java.nio.file.Path @@ -21,8 +21,8 @@ import kotlin.io.path.* object RepoDownloadManager { - val repoSavedLocation = NotEnoughUpdates.DATA_DIR.resolve("repo-extracted") - val repoMetadataLocation = NotEnoughUpdates.DATA_DIR.resolve("loaded-repo-sha.txt") + val repoSavedLocation = Firmament.DATA_DIR.resolve("repo-extracted") + val repoMetadataLocation = Firmament.DATA_DIR.resolve("loaded-repo-sha.txt") private fun loadSavedVersionHash(): String? = if (repoSavedLocation.exists()) { @@ -50,7 +50,7 @@ object RepoDownloadManager { private suspend fun requestLatestGithubSha(): String? { val response = - NotEnoughUpdates.httpClient.get("https://api.github.com/repos/${RepoManager.data.user}/${RepoManager.data.repo}/commits/${RepoManager.data.branch}") + Firmament.httpClient.get("https://api.github.com/repos/${RepoManager.data.user}/${RepoManager.data.repo}/commits/${RepoManager.data.branch}") if (response.status.value != 200) { return null } @@ -58,8 +58,8 @@ object RepoDownloadManager { } private suspend fun downloadGithubArchive(url: String): Path = withContext(IO) { - val response = NotEnoughUpdates.httpClient.get(url) - val targetFile = Files.createTempFile("notenoughupdates-repo", ".zip") + val response = Firmament.httpClient.get(url) + val targetFile = Files.createTempFile("firmament-repo", ".zip") val outputChannel = Files.newByteChannel(targetFile, StandardOpenOption.CREATE, StandardOpenOption.WRITE) response.bodyAsChannel().copyTo(outputChannel) targetFile diff --git a/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt b/src/main/kotlin/moe/nea/firmament/repo/RepoManager.kt index acaaacd..ac880b5 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt +++ b/src/main/kotlin/moe/nea/firmament/repo/RepoManager.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.repo +package moe.nea.firmament.repo import io.github.cottonmc.cotton.gui.client.CottonHud import io.github.moulberry.repo.NEURecipeCache @@ -12,11 +12,11 @@ import kotlinx.serialization.serializer import net.minecraft.client.MinecraftClient import net.minecraft.network.packet.s2c.play.SynchronizeRecipesS2CPacket import net.minecraft.text.Text -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.NotEnoughUpdates.logger -import moe.nea.notenoughupdates.hud.ProgressBar -import moe.nea.notenoughupdates.util.SkyblockId -import moe.nea.notenoughupdates.util.data.DataHolder +import moe.nea.firmament.Firmament +import moe.nea.firmament.Firmament.logger +import moe.nea.firmament.hud.ProgressBar +import moe.nea.firmament.util.SkyblockId +import moe.nea.firmament.util.data.DataHolder object RepoManager : DataHolder<RepoManager.Config>(serializer(), "repo", ::Config) { @Serializable @@ -68,7 +68,7 @@ object RepoManager : DataHolder<RepoManager.Config>(serializer(), "repo", ::Conf fun getNEUItem(skyblockId: SkyblockId) = neuRepo.items.getItemBySkyblockId(skyblockId.neuItem) fun launchAsyncUpdate(force: Boolean = false) { - NotEnoughUpdates.coroutineScope.launch { + Firmament.coroutineScope.launch { progressBar.reportProgress("Downloading", 0, null) CottonHud.add(progressBar) RepoDownloadManager.downloadUpdate(force) diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt b/src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt index 2fbff87..4419245 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/ItemUtil.kt +++ b/src/main/kotlin/moe/nea/firmament/util/ItemUtil.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import net.minecraft.item.ItemStack import net.minecraft.nbt.NbtCompound diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt b/src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt index 9f3379b..2d54b97 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/LegacyTagParser.kt +++ b/src/main/kotlin/moe/nea/firmament/util/LegacyTagParser.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import java.util.* import net.minecraft.nbt.AbstractNbtNumber diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/Locraw.kt b/src/main/kotlin/moe/nea/firmament/util/Locraw.kt index 400842f..afbacef 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/Locraw.kt +++ b/src/main/kotlin/moe/nea/firmament/util/Locraw.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt b/src/main/kotlin/moe/nea/firmament/util/MC.kt index 956a330..ab35f0e 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt +++ b/src/main/kotlin/moe/nea/firmament/util/MC.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import io.github.moulberry.repo.data.Coordinate import net.minecraft.client.MinecraftClient diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt b/src/main/kotlin/moe/nea/firmament/util/MinecraftDispatcher.kt index 366b81a..1e7fba2 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/MinecraftDispatcher.kt +++ b/src/main/kotlin/moe/nea/firmament/util/MinecraftDispatcher.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/SBData.kt b/src/main/kotlin/moe/nea/firmament/util/SBData.kt index 393cdbb..6e866f8 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/SBData.kt +++ b/src/main/kotlin/moe/nea/firmament/util/SBData.kt @@ -1,15 +1,13 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import kotlinx.serialization.SerializationException import kotlinx.serialization.decodeFromString import kotlin.time.Duration import kotlin.time.Duration.Companion.seconds -import kotlin.time.ExperimentalTime -import kotlin.time.TimeSource -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.events.ServerChatLineReceivedEvent -import moe.nea.notenoughupdates.events.SkyblockServerUpdateEvent -import moe.nea.notenoughupdates.events.WorldReadyEvent +import moe.nea.firmament.Firmament +import moe.nea.firmament.events.ServerChatLineReceivedEvent +import moe.nea.firmament.events.SkyblockServerUpdateEvent +import moe.nea.firmament.events.WorldReadyEvent object SBData { val profileRegex = "(?:Your profile was changed to: |You are playing on profile: )(.+)".toRegex() @@ -43,7 +41,7 @@ object SBData { private fun tryReceiveLocraw(unformattedString: String): Boolean = try { val lastLocraw = locraw - locraw = NotEnoughUpdates.json.decodeFromString<Locraw>(unformattedString) + locraw = Firmament.json.decodeFromString<Locraw>(unformattedString) SkyblockServerUpdateEvent.publish(SkyblockServerUpdateEvent(lastLocraw, locraw)) true } catch (e: SerializationException) { diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt b/src/main/kotlin/moe/nea/firmament/util/ScreenUtil.kt index 6c86c41..74b750b 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/ScreenUtil.kt +++ b/src/main/kotlin/moe/nea/firmament/util/ScreenUtil.kt @@ -1,6 +1,6 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util -import moe.nea.notenoughupdates.NotEnoughUpdates +import moe.nea.firmament.Firmament import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents import net.minecraft.client.MinecraftClient import net.minecraft.client.gui.screen.Screen @@ -26,7 +26,7 @@ object ScreenUtil { fun setScreenLater(nextScreen: Screen) { val nog = nextOpenedGui if (nog != null) { - NotEnoughUpdates.logger.warn("Setting screen ${nextScreen::class.qualifiedName} to be opened later, but ${nog::class.qualifiedName} is already queued.") + Firmament.logger.warn("Setting screen ${nextScreen::class.qualifiedName} to be opened later, but ${nog::class.qualifiedName} is already queued.") return } nextOpenedGui = nextScreen diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/SequenceUtil.kt b/src/main/kotlin/moe/nea/firmament/util/SequenceUtil.kt index 3e338bd..b30744d 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/SequenceUtil.kt +++ b/src/main/kotlin/moe/nea/firmament/util/SequenceUtil.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util fun <T : Any> T.iterate(iterator: (T) -> T?): Sequence<T> = sequence { var x: T? = this@iterate diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/SkyblockId.kt b/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt index 7c6c391..70d511c 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/SkyblockId.kt +++ b/src/main/kotlin/moe/nea/firmament/util/SkyblockId.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import io.github.moulberry.repo.data.NEUItem import io.github.moulberry.repo.data.Rarity diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/TimeMark.kt b/src/main/kotlin/moe/nea/firmament/util/TimeMark.kt index 5196606..4068bda 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/TimeMark.kt +++ b/src/main/kotlin/moe/nea/firmament/util/TimeMark.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import kotlin.time.Duration import kotlin.time.ExperimentalTime diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/Timer.kt b/src/main/kotlin/moe/nea/firmament/util/Timer.kt index 14f76f7..bfdc9d1 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/Timer.kt +++ b/src/main/kotlin/moe/nea/firmament/util/Timer.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import kotlin.time.Duration import kotlin.time.ExperimentalTime diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/config/ManagedConfig.kt b/src/main/kotlin/moe/nea/firmament/util/config/ManagedConfig.kt index a149bf2..bc06064 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/config/ManagedConfig.kt +++ b/src/main/kotlin/moe/nea/firmament/util/config/ManagedConfig.kt @@ -1,7 +1,6 @@ -package moe.nea.notenoughupdates.util.config +package moe.nea.firmament.util.config import io.github.cottonmc.cotton.gui.client.CottonClientScreen -import io.github.cottonmc.cotton.gui.client.LibGui import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription import io.github.cottonmc.cotton.gui.widget.WButton import io.github.cottonmc.cotton.gui.widget.WLabel @@ -20,11 +19,10 @@ import kotlin.io.path.readText import kotlin.io.path.writeText import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty -import net.minecraft.client.MinecraftClient import net.minecraft.text.Text -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.gui.WGridPanelWithPadding -import moe.nea.notenoughupdates.util.ScreenUtil.setScreenLater +import moe.nea.firmament.Firmament +import moe.nea.firmament.gui.WGridPanelWithPadding +import moe.nea.firmament.util.ScreenUtil.setScreenLater abstract class ManagedConfig(val name: String) { @@ -92,7 +90,7 @@ abstract class ManagedConfig(val name: String) { try { value = handler.fromJson(data[propertyName]!!) } catch (e: Exception) { - NotEnoughUpdates.logger.error( + Firmament.logger.error( "Exception during loading of config file $name. This will reset this config.", e ) @@ -110,14 +108,14 @@ abstract class ManagedConfig(val name: String) { } } - val file = NotEnoughUpdates.CONFIG_DIR.resolve("$name.json") + val file = Firmament.CONFIG_DIR.resolve("$name.json") val data: JsonObject by lazy { try { - NotEnoughUpdates.json.decodeFromString( + Firmament.json.decodeFromString( file.readText() ) } catch (e: Exception) { - NotEnoughUpdates.logger.info("Could not read config $name. Loading empty config.") + Firmament.logger.info("Could not read config $name. Loading empty config.") JsonObject(mutableMapOf()) } } @@ -129,7 +127,7 @@ abstract class ManagedConfig(val name: String) { } }.toMap()) file.parent.createDirectories() - file.writeText(NotEnoughUpdates.json.encodeToString(data)) + file.writeText(Firmament.json.encodeToString(data)) } @@ -155,7 +153,7 @@ abstract class ManagedConfig(val name: String) { override fun emitGuiElements(opt: Option<Boolean>, guiAppender: GuiAppender) { guiAppender.appendFullRow( - WToggleButton(Text.translatable("neu.config.${config.name}.${opt.propertyName}")).apply { + WToggleButton(Text.translatable("firmament.config.${config.name}.${opt.propertyName}")).apply { guiAppender.onReload { toggle = opt.value } setOnToggle { opt.value = it @@ -175,8 +173,8 @@ abstract class ManagedConfig(val name: String) { override fun emitGuiElements(opt: Option<Unit>, guiAppender: GuiAppender) { guiAppender.appendSplitRow( - WLabel(Text.translatable("neu.config.${config.name}.${opt.propertyName}")), - WButton(Text.translatable("neu.config.${config.name}.${opt.propertyName}")).apply { + WLabel(Text.translatable("firmament.config.${config.name}.${opt.propertyName}")), + WButton(Text.translatable("firmament.config.${config.name}.${opt.propertyName}")).apply { setOnClick { runnable() } diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/data/DataHolder.kt b/src/main/kotlin/moe/nea/firmament/util/data/DataHolder.kt index 6c9d8e8..4d66a96 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/data/DataHolder.kt +++ b/src/main/kotlin/moe/nea/firmament/util/data/DataHolder.kt @@ -1,11 +1,11 @@ -package moe.nea.notenoughupdates.util.data +package moe.nea.firmament.util.data import java.nio.file.Path import kotlinx.serialization.KSerializer import kotlin.io.path.exists import kotlin.io.path.readText import kotlin.io.path.writeText -import moe.nea.notenoughupdates.NotEnoughUpdates +import moe.nea.firmament.Firmament abstract class DataHolder<T>( val serializer: KSerializer<T>, @@ -22,18 +22,18 @@ abstract class DataHolder<T>( IDataHolder.putDataHolder(this::class, this) } - private val file: Path get() = NotEnoughUpdates.CONFIG_DIR.resolve("$name.json") + private val file: Path get() = Firmament.CONFIG_DIR.resolve("$name.json") protected fun readValueOrDefault(): T { if (file.exists()) try { - return NotEnoughUpdates.json.decodeFromString( + return Firmament.json.decodeFromString( serializer, file.readText() ) } catch (e: Exception) {/* Expecting IOException and SerializationException, but Kotlin doesn't allow multi catches*/ IDataHolder.badLoads.add(name) - NotEnoughUpdates.logger.error( + Firmament.logger.error( "Exception during loading of config file $name. This will reset this config.", e ) @@ -42,7 +42,7 @@ abstract class DataHolder<T>( } private fun writeValue(t: T) { - file.writeText(NotEnoughUpdates.json.encodeToString(serializer, t)) + file.writeText(Firmament.json.encodeToString(serializer, t)) } override fun save() { diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/data/IDataHolder.kt b/src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt index ccbf676..4fa8c38 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/data/IDataHolder.kt +++ b/src/main/kotlin/moe/nea/firmament/util/data/IDataHolder.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util.data +package moe.nea.firmament.util.data import java.util.concurrent.CopyOnWriteArrayList import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents @@ -6,8 +6,8 @@ import kotlin.reflect.KClass import net.minecraft.client.MinecraftClient import net.minecraft.server.command.CommandOutput import net.minecraft.text.Text -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.events.ScreenOpenEvent +import moe.nea.firmament.Firmament +import moe.nea.firmament.events.ScreenOpenEvent interface IDataHolder<T> { companion object { @@ -21,7 +21,7 @@ interface IDataHolder<T> { fun <T : IDataHolder<K>, K> markDirty(kClass: KClass<T>) { if (kClass !in allConfigs) { - NotEnoughUpdates.logger.error("Tried to markDirty '${kClass.qualifiedName}', which isn't registered as 'IConfigHolder'") + Firmament.logger.error("Tried to markDirty '${kClass.qualifiedName}', which isn't registered as 'IConfigHolder'") return } dirty.add(kClass) @@ -34,7 +34,7 @@ interface IDataHolder<T> { for (it in toSave) { val obj = allConfigs[it] if (obj == null) { - NotEnoughUpdates.logger.error("Tried to save '${it}', which isn't registered as 'ConfigHolder'") + Firmament.logger.error("Tried to save '${it}', which isn't registered as 'ConfigHolder'") continue } obj.save() diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/data/ProfileSpecificDataHolder.kt b/src/main/kotlin/moe/nea/firmament/util/data/ProfileSpecificDataHolder.kt index a2f78b1..c3e1d38 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/data/ProfileSpecificDataHolder.kt +++ b/src/main/kotlin/moe/nea/firmament/util/data/ProfileSpecificDataHolder.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util.data +package moe.nea.firmament.util.data import java.nio.file.Path import kotlinx.serialization.KSerializer @@ -10,8 +10,8 @@ import kotlin.io.path.listDirectoryEntries import kotlin.io.path.nameWithoutExtension import kotlin.io.path.readText import kotlin.io.path.writeText -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.util.SBData +import moe.nea.firmament.Firmament +import moe.nea.firmament.util.SBData abstract class ProfileSpecificDataHolder<S>( private val dataSerializer: KSerializer<S>, @@ -32,7 +32,7 @@ abstract class ProfileSpecificDataHolder<S>( IDataHolder.putDataHolder(this::class, this) } - private val configDirectory: Path get() = NotEnoughUpdates.CONFIG_DIR.resolve("profiles").resolve(configName) + private val configDirectory: Path get() = Firmament.CONFIG_DIR.resolve("profiles").resolve(configName) private fun readValues(): MutableMap<String, S> { if (!configDirectory.exists()) { @@ -43,10 +43,10 @@ abstract class ProfileSpecificDataHolder<S>( .filter { it.extension == "json" } .mapNotNull { try { - it.nameWithoutExtension to NotEnoughUpdates.json.decodeFromString(dataSerializer, it.readText()) + it.nameWithoutExtension to Firmament.json.decodeFromString(dataSerializer, it.readText()) } catch (e: Exception) { /* Expecting IOException and SerializationException, but Kotlin doesn't allow multi catches*/ IDataHolder.badLoads.add(configName) - NotEnoughUpdates.logger.error( + Firmament.logger.error( "Exception during loading of profile specific config file $it ($configName). This will reset that profiles config.", e ) @@ -67,7 +67,7 @@ abstract class ProfileSpecificDataHolder<S>( } c.forEach { (name, value) -> val f = configDirectory.resolve("$name.json") - f.writeText(NotEnoughUpdates.json.encodeToString(dataSerializer, value)) + f.writeText(Firmament.json.encodeToString(dataSerializer, value)) } } diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt b/src/main/kotlin/moe/nea/firmament/util/render/block.kt index 0d6c63b..1fd1393 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt +++ b/src/main/kotlin/moe/nea/firmament/util/render/block.kt @@ -1,4 +1,4 @@ -package moe.nea.notenoughupdates.util.render +package moe.nea.firmament.util.render import com.mojang.blaze3d.systems.RenderSystem import org.joml.Matrix4f diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/textutil.kt b/src/main/kotlin/moe/nea/firmament/util/textutil.kt index ac640be..b12d6c4 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/textutil.kt +++ b/src/main/kotlin/moe/nea/firmament/util/textutil.kt @@ -1,9 +1,9 @@ -package moe.nea.notenoughupdates.util +package moe.nea.firmament.util import net.minecraft.text.LiteralTextContent import net.minecraft.text.Text import net.minecraft.text.TextContent -import moe.nea.notenoughupdates.NotEnoughUpdates +import moe.nea.firmament.Firmament class TextMatcher(text: Text) { @@ -29,7 +29,7 @@ class TextMatcher(text: Text) { is LiteralTextContent -> content.string TextContent.EMPTY -> "" else -> { - NotEnoughUpdates.logger.warn("TextContent of type ${content.javaClass} not understood.") + Firmament.logger.warn("TextContent of type ${content.javaClass} not understood.") return false } } diff --git a/src/main/kotlin/moe/nea/notenoughupdates/commands/rome.kt b/src/main/kotlin/moe/nea/notenoughupdates/commands/rome.kt deleted file mode 100644 index a60073a..0000000 --- a/src/main/kotlin/moe/nea/notenoughupdates/commands/rome.kt +++ /dev/null @@ -1,66 +0,0 @@ -package moe.nea.notenoughupdates.commands - -import com.mojang.brigadier.CommandDispatcher -import io.github.cottonmc.cotton.gui.client.CottonClientScreen -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource -import net.minecraft.text.Text -import moe.nea.notenoughupdates.features.world.FairySouls -import moe.nea.notenoughupdates.gui.repoGui -import moe.nea.notenoughupdates.repo.RepoManager -import moe.nea.notenoughupdates.util.SBData -import moe.nea.notenoughupdates.util.ScreenUtil.setScreenLater - - -fun neuCommand() = literal("neu") { - thenLiteral("repo") { - thenLiteral("reload") { - thenLiteral("fetch") { - thenExecute { - source.sendFeedback(Text.translatable("notenoughupdates.repo.reload.network")) // TODO better reporting - RepoManager.launchAsyncUpdate() - } - } - thenExecute { - source.sendFeedback(Text.translatable("notenoughupdates.repo.reload.disk")) - RepoManager.reload() - } - } - thenExecute { - setScreenLater(CottonClientScreen(repoGui())) - } - } - thenLiteral("dev") { - thenLiteral("config") { - thenExecute { - FairySouls.TConfig.showConfigEditor() - } - } - thenLiteral("sbdata") { - thenExecute { - source.sendFeedback(Text.translatable("notenoughupdates.sbinfo.profile", SBData.profileCuteName)) - val locrawInfo = SBData.locraw - if (locrawInfo == null) { - source.sendFeedback(Text.translatable("notenoughupdates.sbinfo.nolocraw")) - } else { - source.sendFeedback(Text.translatable("notenoughupdates.sbinfo.server", locrawInfo.server)) - source.sendFeedback(Text.translatable("notenoughupdates.sbinfo.gametype", locrawInfo.gametype)) - source.sendFeedback(Text.translatable("notenoughupdates.sbinfo.mode", locrawInfo.mode)) - source.sendFeedback(Text.translatable("notenoughupdates.sbinfo.map", locrawInfo.map)) - } - - } - } - } -} - - -fun registerNeuCommand(dispatcher: CommandDispatcher<FabricClientCommandSource>) { - val neu = dispatcher.register(neuCommand()) - dispatcher.register(literal("alsoneu") { - redirect(neu) - }) -} - - - - diff --git a/src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt b/src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt deleted file mode 100644 index b2fba91..0000000 --- a/src/main/kotlin/moe/nea/notenoughupdates/gui/repogui.kt +++ /dev/null @@ -1,36 +0,0 @@ -package moe.nea.notenoughupdates.gui - -import net.minecraft.text.Text -import moe.nea.notenoughupdates.repo.RepoManager - -fun repoGui(): ConfigGui<RepoManager.Config> { - return ConfigGui(RepoManager) { - title(Text.translatable("notenoughupdates.gui.repo.title")) - toggle(Text.translatable("notenoughupdates.gui.repo.autoupdate"), RepoManager.Config::autoUpdate) - textfield( - Text.translatable("notenoughupdates.gui.repo.username"), - Text.translatable("notenoughupdates.gui.repo.hint.username"), - RepoManager.Config::user, - maxLength = 255 - ) - textfield( - Text.translatable("notenoughupdates.gui.repo.reponame"), - Text.translatable("notenoughupdates.gui.repo.hint.reponame"), - RepoManager.Config::repo - ) - textfield( - Text.translatable("notenoughupdates.gui.repo.branch"), - Text.translatable("notenoughupdates.gui.repo.hint.branch"), - RepoManager.Config::branch - ) - button( - Text.translatable("notenoughupdates.gui.repo.reset.label"), - Text.translatable("notenoughupdates.gui.repo.reset"), - ) { - RepoManager.data.user = "NotEnoughUpdates" - RepoManager.data.repo = "NotEnoughUpdates-REPO" - RepoManager.data.branch = "dangerous" - reload() - } - } -} |