Replace references to NEU with Firmament

This commit is contained in:
nea
2023-05-16 01:23:43 +02:00
parent 96c546cc73
commit ead6762eb1
70 changed files with 354 additions and 360 deletions

View File

@@ -12,4 +12,4 @@ max_line_length = 120
[*.kt]
ij_kotlin_name_count_to_use_star_import = 99999
ij_kotlin_name_count_to_use_star_import_for_members = 99999
ij_kotlin_imports_layout = *, |, kotlinx.**, kotlin.**, net.minecraft.**, moe.nea.notenoughupdates.**, |, $*
ij_kotlin_imports_layout = *, |, kotlinx.**, kotlin.**, net.minecraft.**, moe.nea.firmament.**, |, $*

View File

@@ -13,13 +13,13 @@ plugins {
loom {
clientOnlyMinecraftJar()
accessWidenerPath.set(project.file("src/main/resources/notenoughupdates.accesswidener"))
accessWidenerPath.set(project.file("src/main/resources/firmament.accesswidener"))
runs {
removeIf { it.name != "client" }
named("client") {
property("devauth.enabled", "true")
property("fabric.log.level", "info")
property("notenoughupdates.debug", "true")
property("firmament.debug", "true")
/*
vmArg("-XX:+AllowEnhancedClassRedefinition")
vmArg("-XX:HotswapAgent=fatjar")
@@ -145,6 +145,6 @@ tasks.processResources {
tasks.license {
scanConfiguration(project.configurations.compileClasspath.get())
outputFile.set(file("$buildDir/LICENSES-NEU.json"))
outputFile.set(file("$buildDir/LICENSES-FIRMAMENT.json"))
licenseFormatter.set(moe.nea.licenseextractificator.JsonLicenseFormatter())
}

View File

@@ -1,6 +1,5 @@
package moe.nea.notenoughupdates.init;
package moe.nea.firmament.init;
import moe.nea.notenoughupdates.NotEnoughUpdates;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
@@ -21,8 +20,8 @@ public class MixinPlugin implements IMixinConfigPlugin {
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return Boolean.getBoolean("notenoughupdates.debug") ||
!mixinClassName.startsWith("moe.nea.notenoughupdates.mixins.devenv");
return Boolean.getBoolean("firmament.debug") ||
!mixinClassName.startsWith("moe.nea.firmament.mixins.devenv");
}
@Override

View File

@@ -1,6 +1,6 @@
package moe.nea.notenoughupdates.mixins;
package moe.nea.firmament.mixins;
import moe.nea.notenoughupdates.events.ParticleSpawnEvent;
import moe.nea.firmament.events.ParticleSpawnEvent;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
import net.minecraft.util.math.Vec3d;

View File

@@ -1,6 +1,6 @@
package moe.nea.notenoughupdates.mixins;
package moe.nea.firmament.mixins;
import moe.nea.notenoughupdates.events.WorldReadyEvent;
import moe.nea.firmament.events.WorldReadyEvent;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

View File

@@ -1,7 +1,7 @@
package moe.nea.notenoughupdates.mixins;
package moe.nea.firmament.mixins;
import com.mojang.authlib.GameProfile;
import moe.nea.notenoughupdates.events.ServerChatLineReceivedEvent;
import moe.nea.firmament.events.ServerChatLineReceivedEvent;
import net.minecraft.client.network.message.MessageHandler;
import net.minecraft.network.message.MessageType;
import net.minecraft.network.message.SignedMessage;

View File

@@ -1,6 +1,6 @@
package moe.nea.notenoughupdates.mixins;
package moe.nea.firmament.mixins;
import moe.nea.notenoughupdates.events.ScreenOpenEvent;
import moe.nea.firmament.events.ScreenOpenEvent;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import org.jetbrains.annotations.Nullable;

View File

@@ -1,6 +1,6 @@
package moe.nea.notenoughupdates.mixins;
package moe.nea.firmament.mixins;
import moe.nea.notenoughupdates.events.WorldRenderLastEvent;
import moe.nea.firmament.events.WorldRenderLastEvent;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.LightmapTextureManager;

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.mixins.accessor;
package moe.nea.firmament.mixins.accessor;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.screen.slot.Slot;

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.mixins.devenv;
package moe.nea.firmament.mixins.devenv;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.util.Identifier;

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.mixins.devenv;
package moe.nea.firmament.mixins.devenv;
import net.minecraft.entity.projectile.FishingBobberEntity;
import org.slf4j.Logger;

View File

@@ -1,10 +1,9 @@
package moe.nea.notenoughupdates.mixins.devenv;
package moe.nea.firmament.mixins.devenv;
import net.minecraft.scoreboard.Scoreboard;
import org.slf4j.Logger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Scoreboard.class)

View File

@@ -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()

View File

@@ -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

View File

@@ -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)
})
}

View File

@@ -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()

View File

@@ -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"
}
}

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.events
package moe.nea.firmament.events
/**
* An event that can be fired by a [NEUEventBus].

View File

@@ -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)
}
}
}

View File

@@ -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

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.events
package moe.nea.firmament.events
import net.minecraft.client.gui.screen.Screen

View File

@@ -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.

View File

@@ -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.

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.events
package moe.nea.firmament.events
class WorldReadyEvent : NEUEvent() {
companion object : NEUEventBus<WorldReadyEvent>()

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.events
package moe.nea.firmament.events
import org.joml.Matrix4f
import net.minecraft.client.render.Camera

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 {

View File

@@ -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

View File

@@ -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
}
}
}

View File

@@ -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()
}
}
}

View File

@@ -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

View File

@@ -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")

View File

@@ -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 {

View File

@@ -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

View File

@@ -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) {

View File

@@ -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(

View File

@@ -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"

View File

@@ -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

View File

@@ -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> {

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.util
package moe.nea.firmament.util
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.util
package moe.nea.firmament.util
import java.util.*
import net.minecraft.nbt.AbstractNbtNumber

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.util
package moe.nea.firmament.util
import kotlinx.serialization.Serializable

View File

@@ -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

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.util
package moe.nea.firmament.util
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.ExperimentalCoroutinesApi

View File

@@ -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) {

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.util
package moe.nea.firmament.util
import kotlin.time.Duration
import kotlin.time.ExperimentalTime

View File

@@ -1,4 +1,4 @@
package moe.nea.notenoughupdates.util
package moe.nea.firmament.util
import kotlin.time.Duration
import kotlin.time.ExperimentalTime

View File

@@ -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()
}

View File

@@ -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() {

View File

@@ -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()

View File

@@ -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))
}
}

View File

@@ -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

View File

@@ -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
}
}

View File

@@ -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)
})
}

View File

@@ -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()
}
}
}

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,26 @@
{
"firmament.repo.reload.network": "Trying to redownload the repository",
"firmament.repo.reload.disk": "Reloading repository from disk. This may lag a bit.",
"firmament.repo.cache": "Recaching items",
"firmament.repo.brokenitem": "Failed to render item: %s",
"firmament.gui.repo.title": "firmament Repo Settings",
"firmament.gui.repo.autoupdate": "Auto Update",
"firmament.gui.repo.username": "Repo Username",
"firmament.gui.repo.hint.username": "NotEnoughUpdates",
"firmament.gui.repo.reponame": "Repo Name",
"firmament.gui.repo.hint.reponame": "NotEnoughUpdates-REPO",
"firmament.gui.repo.branch": "Repo Branch",
"firmament.gui.repo.hint.branch": "dangerous",
"firmament.gui.repo.reset": "Reset",
"firmament.gui.repo.reset.label": "Reset to Defaults",
"firmament.sbinfo.nolocraw": "No locraw data available",
"firmament.sbinfo.profile": "Current profile cutename: %s",
"firmament.sbinfo.server": "Locraw Server: %s",
"firmament.sbinfo.gametype": "Locraw Gametype: %s",
"firmament.sbinfo.mode": "Locraw Mode: %s",
"firmament.sbinfo.map": "Locraw Map: %s",
"firmament.config.fairy-souls.show": "Show Fairy Soul Waypoints",
"firmament.config.fairy-souls.reset": "Reset Collected Fairy Souls",
"firmament.config.fishing-warning.display-warning": "Display a warning when you are about to hook a fish",
"firmament.config.fishing-warning.highlight-wake-chain": "Highlight fishing particles"
}

View File

@@ -1,26 +0,0 @@
{
"notenoughupdates.repo.reload.network": "Trying to redownload the repository",
"notenoughupdates.repo.reload.disk": "Reloading repository from disk. This may lag a bit.",
"notenoughupdates.repo.cache": "Recaching items",
"notenoughupdates.repo.brokenitem": "Failed to render item: %s",
"notenoughupdates.gui.repo.title": "NotEnoughUpdates Repo Settings",
"notenoughupdates.gui.repo.autoupdate": "Auto Update",
"notenoughupdates.gui.repo.username": "Repo Username",
"notenoughupdates.gui.repo.hint.username": "NotEnoughUpdates",
"notenoughupdates.gui.repo.reponame": "Repo Name",
"notenoughupdates.gui.repo.hint.reponame": "NotEnoughUpdates-REPO",
"notenoughupdates.gui.repo.branch": "Repo Branch",
"notenoughupdates.gui.repo.hint.branch": "dangerous",
"notenoughupdates.gui.repo.reset": "Reset",
"notenoughupdates.gui.repo.reset.label": "Reset to Defaults",
"notenoughupdates.sbinfo.nolocraw": "No locraw data available",
"notenoughupdates.sbinfo.profile": "Current profile cutename: %s",
"notenoughupdates.sbinfo.server": "Locraw Server: %s",
"notenoughupdates.sbinfo.gametype": "Locraw Gametype: %s",
"notenoughupdates.sbinfo.mode": "Locraw Mode: %s",
"notenoughupdates.sbinfo.map": "Locraw Map: %s",
"neu.config.fairy-souls.show": "Show Fairy Soul Waypoints",
"neu.config.fairy-souls.reset": "Reset Collected Fairy Souls",
"neu.config.fishing-warning.display-warning": "Display a warning when you are about to hook a fish",
"neu.config.fishing-warning.highlight-wake-chain": "Highlight fishing particles"
}

View File

@@ -1,9 +1,9 @@
{
"schemaVersion": 1,
"id": "notenoughupdates",
"id": "firmament",
"version": "${version}",
"name": "Not Enough Updates",
"description": "Not Enough Updates - A mod for Hypixel Skyblock",
"name": "Firmament",
"description": "Firmament powered by NEU",
"authors": [
{
"name": "Linnea Gräf",
@@ -14,30 +14,30 @@
],
"contact": {
"discord": "https://discord.gg/moulberry",
"sources": "https://git.nea.moe/nea/NotEnoughUpdates1.19/"
"sources": "https://git.nea.moe/nea/firmament/"
},
"license": "ARR",
"icon": "assets/notenoughupdates/icon.png",
"icon": "assets/firmament/icon.png",
"environment": "client",
"entrypoints": {
"main": [
{
"adapter": "kotlin",
"value": "moe.nea.notenoughupdates.NotEnoughUpdates"
"value": "moe.nea.firmament.NotEnoughUpdates"
}
],
"client": [
{
"adapter": "kotlin",
"value": "moe.nea.notenoughupdates.NotEnoughUpdates"
"value": "moe.nea.firmament.NotEnoughUpdates"
}
],
"rei_client": [
"moe.nea.notenoughupdates.rei.NEUReiPlugin"
"moe.nea.firmament.rei.FirmamentReiPlugin"
]
},
"mixins": [
"notenoughupdates.mixins.json"
"firmament.mixins.json"
],
"depends": {
"fabric": "*",

View File

@@ -1,7 +1,7 @@
{
"required": true,
"plugin": "moe.nea.notenoughupdates.init.MixinPlugin",
"package": "moe.nea.notenoughupdates.mixins",
"plugin": "moe.nea.firmament.init.MixinPlugin",
"package": "moe.nea.firmament.mixins",
"compatibilityLevel": "JAVA_16",
"client": [
"MixinDownloadingTerrainScreen",