diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b8bf38..b3638c51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +**Ensure you back up your playerex config before updating to this version and using it!** + +## Additions 💖 +- Added a `LifecycleConfig` enum on the playerex config: `ON_TICK` | `ON_EVERY_SECOND`. + - This has been applied to Health Regeneration, and you can adjust it in the config. Default is `ON_EVERY_SECOND`. + ## Changes 🌽 -- Resolved an issue with `ON_TICK` and renamed it to `ON_EVERY_SECOND`. - - The counter to reset was not present, but this has been fixed now. \ No newline at end of file +- Rearranged the config in its entirety. +- Everything is nested and opened by default. +- Everything labeled in `AdvancedSettings` has been adjusted to reflect better in their respective components internally. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 35106bb0..0e65b829 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,8 +8,8 @@ loader=fabric # Fabric Properties minecraft_version=1.20.1 -loader_version=0.15.11 -fabric_kotlin_version=1.12.0+kotlin.2.0.10 +loader_version=0.16.7 +fabric_kotlin_version=1.12.3+kotlin.2.0.21 loom_version=1.8-SNAPSHOT # Mappings @@ -17,7 +17,7 @@ parchment_version=1.20.1:2023.09.03 quilt_mappings_version=23 # Mod Properties -mod_version=4.0.0+1.20.1-beta.10 +mod_version=4.0.0+1.20.1-beta.11 maven_group=com.bibireden.playerex archives_base_name=playerex-directors-cut diff --git a/src/client/java/com/bibireden/playerex/mixin/EntityRendererMixin.java b/src/client/java/com/bibireden/playerex/mixin/EntityRendererMixin.java index fadcf8dd..375fffdf 100644 --- a/src/client/java/com/bibireden/playerex/mixin/EntityRendererMixin.java +++ b/src/client/java/com/bibireden/playerex/mixin/EntityRendererMixin.java @@ -18,7 +18,7 @@ @Mixin(EntityRenderer.class) abstract class EntityRendererMixin { @Unique - private boolean playerex$shouldRenderLevel() { return PlayerEX.CONFIG.getShowLevelOnNameplates(); } + private boolean playerex$shouldRenderLevel() { return PlayerEX.CONFIG.getVisualSettings().getShowLevelOnNameplates(); } @ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/EntityRenderer;renderNameTag(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/network/chat/Component;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V"), index = 1) private Component playerex$renderLabelIfPresent(Component text, @Local(argsOnly = true) Entity entity) { diff --git a/src/client/kotlin/com/bibireden/playerex/PlayerEXClient.kt b/src/client/kotlin/com/bibireden/playerex/PlayerEXClient.kt index 5a5d3008..0e5066cc 100644 --- a/src/client/kotlin/com/bibireden/playerex/PlayerEXClient.kt +++ b/src/client/kotlin/com/bibireden/playerex/PlayerEXClient.kt @@ -55,7 +55,7 @@ object PlayerEXClient : ClientModInitializer { PlayerEXMenuRegistry.register(PlayerEX.id("attributes"), PlayerEXAttributesMenu::class.java) ClientTickEvents.END_CLIENT_TICK.register { client -> - if (PlayerEX.CONFIG.disableUI) return@register + if (PlayerEX.CONFIG.featureSettings.disableUI) return@register while (KEYBINDING_MAIN_SCREEN.consumeClick()) { if (client.screen == null) client.setScreen(PlayerEXScreen()) diff --git a/src/main/java/com/bibireden/playerex/mixin/ItemStackMixin.java b/src/main/java/com/bibireden/playerex/mixin/ItemStackMixin.java index 280fe69c..84d9a257 100644 --- a/src/main/java/com/bibireden/playerex/mixin/ItemStackMixin.java +++ b/src/main/java/com/bibireden/playerex/mixin/ItemStackMixin.java @@ -52,7 +52,7 @@ abstract class ItemStackMixin { @Inject(method = "use(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/InteractionResultHolder;", at = @At(value = "HEAD"), cancellable = true) public void preventUse(Level level, Player player, InteractionHand usedHand, CallbackInfoReturnable> cir) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; ItemStack stack = (ItemStack)(Object)this; if (PlayerEXUtil.isBroken(stack)) { @@ -62,7 +62,7 @@ public void preventUse(Level level, Player player, InteractionHand usedHand, Cal @Inject(method = "useOn(Lnet/minecraft/world/item/context/UseOnContext;)Lnet/minecraft/world/InteractionResult;", at = @At(value = "HEAD"), cancellable = true) public void preventUseOnBlock(UseOnContext context, CallbackInfoReturnable cir) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; ItemStack stack = (ItemStack)(Object)this; if (PlayerEXUtil.isBroken(stack)) { @@ -72,7 +72,7 @@ public void preventUseOnBlock(UseOnContext context, CallbackInfoReturnable cir) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; ItemStack stack = (ItemStack)(Object)this; if (PlayerEXUtil.isBroken(stack)) { @@ -82,7 +82,7 @@ public void preventDamage(int amount, RandomSource random, ServerPlayer user, Ca @Inject(method = "hurtAndBreak(ILnet/minecraft/world/entity/LivingEntity;Ljava/util/function/Consumer;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;getItem()Lnet/minecraft/world/item/Item;"), cancellable = true) public void preventBreak(int amount, T entity, Consumer onBroken, CallbackInfo ci) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; ItemStack stack = (ItemStack)(Object)this; if (stack.getItem().builtInRegistryHolder().is(PlayerEXTags.UNBREAKABLE_ITEMS)) { @@ -97,7 +97,7 @@ public void preventBreak(int amount, T entity, Consumer @Inject(method = "setDamageValue(I)V", at = @At(value = "HEAD")) public void removeBrokenOnRepair(int damage, CallbackInfo ci) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; ItemStack stack = (ItemStack)(Object)this; if (PlayerEXUtil.isBroken(stack) && damage < stack.getDamageValue()) { @@ -109,7 +109,7 @@ public void removeBrokenOnRepair(int damage, CallbackInfo ci) { @Inject(method = "getAttributeModifiers(Lnet/minecraft/world/entity/EquipmentSlot;)Lcom/google/common/collect/Multimap;", at = @At(value = "RETURN"), cancellable = true) public void preventArmour(EquipmentSlot slot, CallbackInfoReturnable> cir) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; ItemStack stack = (ItemStack)(Object)this; HashMultimap hashmap = HashMultimap.create(cir.getReturnValue()); @@ -125,7 +125,7 @@ public void preventArmour(EquipmentSlot slot, CallbackInfoReturnable cir) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; Player player = (Player)(Object)this; if (PlayerEXUtil.isBroken(player.getItemInHand(hand))) { @@ -43,7 +43,7 @@ public void preventInteract(Entity entityToInteractOn, InteractionHand hand, Cal @Inject(method = "blockActionRestricted(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/GameType;)Z", at = @At(value = "HEAD"), locals = LocalCapture.CAPTURE_FAILEXCEPTION, cancellable = true) public void preventBreakBlock(Level level, BlockPos pos, GameType gameMode, CallbackInfoReturnable cir) { - if (!PlayerEX.CONFIG.getItemBreakingEnabled()) return; + if (!PlayerEX.CONFIG.getFeatureSettings().getItemBreakingEnabled()) return; Player player = (Player)(Object)this; if (PlayerEXUtil.isBroken(player.getMainHandItem())) { diff --git a/src/main/kotlin/com/bibireden/playerex/PlayerEX.kt b/src/main/kotlin/com/bibireden/playerex/PlayerEX.kt index 4f701fed..5f8a2e9e 100644 --- a/src/main/kotlin/com/bibireden/playerex/PlayerEX.kt +++ b/src/main/kotlin/com/bibireden/playerex/PlayerEX.kt @@ -12,6 +12,8 @@ import com.bibireden.playerex.api.event.LivingEntityEvents import com.bibireden.playerex.api.event.PlayerEXSoundEvents import com.bibireden.playerex.api.event.PlayerEntityEvents import com.bibireden.playerex.config.PlayerEXConfig +import com.bibireden.playerex.config.PlayerEXConfigModel +import com.bibireden.playerex.config.PlayerEXConfigModel.Lifecycle import com.bibireden.playerex.ext.component import com.bibireden.playerex.factory.* import com.bibireden.playerex.networking.NetworkingChannels @@ -69,7 +71,14 @@ object PlayerEX : ModInitializer { ServerPlayerEvents.COPY_FROM.register(EventFactory::reset) LivingEntityEvents.ON_HEAL.register(EventFactory::healed) - LivingEntityEvents.ON_EVERY_SECOND.register(EventFactory::healthRegeneration) + + if (CONFIG.lifecycleSettings.healthRegeneration == Lifecycle.ON_EVERY_SECOND) { + LivingEntityEvents.ON_EVERY_SECOND.register(EventFactory::healthRegeneration) + } + else { + LivingEntityEvents.ON_TICK.register(EventFactory::healthRegeneration) + } + LivingEntityEvents.ON_DAMAGE.register(EventFactory::onDamage) LivingEntityEvents.SHOULD_DAMAGE.register(EventFactory::shouldDamage) diff --git a/src/main/kotlin/com/bibireden/playerex/api/event/LivingEntityEvents.kt b/src/main/kotlin/com/bibireden/playerex/api/event/LivingEntityEvents.kt index 3f529563..17875d91 100644 --- a/src/main/kotlin/com/bibireden/playerex/api/event/LivingEntityEvents.kt +++ b/src/main/kotlin/com/bibireden/playerex/api/event/LivingEntityEvents.kt @@ -29,16 +29,28 @@ object LivingEntityEvents { }} /** - * Fired once at the end of {@link LivingEntity#tick()}, every 20 ticks (1 second). + * Fired once at the end of [LivingEntity.tick]. + */ + @JvmField + val ON_TICK: Event = EventFactory.createArrayBacked(OnTick::class.java) { callbacks -> OnTick { entity -> callbacks.forEach { it.onTick(entity) } }} + + /** + * Fired once at the end of [LivingEntity.tick], every `20` ticks (~1 second). */ @JvmField val ON_EVERY_SECOND: Event = EventFactory.createArrayBacked(OnEverySecond::class.java) { callbacks -> OnEverySecond { entity -> callbacks.forEach { it.onEverySecond(entity) } }} /** - * Fired before {@link LivingEntity#damage(DamageSource, float)}; allows the amount of damage to be modified before it is used in any way. - * Can be used to perform logic prior to the damage method, and can return the original damage to avoid modifying the value. + * Fired before [LivingEntity.hurt]. + * + * This allows the amount of damage to be modified before it is used in any way. + * It can be used to perform logic prior to the damage method, + * and can return the original damage to avoid modifying the value. + * * The original value is the incoming damage, followed by the result of this event by any previous registries. - * Setting the output to 0 is an unreliable way to negate incoming damage depending on other mods installed. Instead, use {@link LivingEntityEvents#SHOUL_DAMAGE}. + * + * Setting the output to 0 is an unreliable way to negate incoming damage depending on other mods installed. + * Instead, use [LivingEntityEvents.SHOULD_DAMAGE]. */ @JvmField val ON_DAMAGE: Event = EventFactory.createArrayBacked(Damaged::class.java) { callbacks -> Damaged { entity, source, original -> @@ -48,8 +60,12 @@ object LivingEntityEvents { }} /** - * Fired after: [LivingEntity.isInvulnerableTo], [net.minecraft.world.World.isClient], [LivingEntity.isDead], - * ([DamageSource.isFire] && [LivingEntity.hasStatusEffect] for Fire Resistance), and [LivingEntity.isSleeping] + * Fired after: + * - [LivingEntity.isInvulnerableTo], + * - [net.minecraft.world.World.isClient], + * - [LivingEntity.isDeadOrDying], + * - ([DamageSource] && [LivingEntity.hasEffect] for Fire Resistance), and [LivingEntity.isSleeping] + * * is checked, but before all other logic is performed. Can be used to cancel the method and prevent damage from being taken by returning false. * Returning true allows the logic to continue. */ @@ -67,6 +83,10 @@ object LivingEntityEvents { fun shouldHeal(livingEntity: LivingEntity, original: Float): Boolean } + fun interface OnTick { + fun onTick(livingEntity: LivingEntity) + } + fun interface OnEverySecond { fun onEverySecond(livingEntity: LivingEntity) } diff --git a/src/main/kotlin/com/bibireden/playerex/components/experience/ExperienceDataComponent.kt b/src/main/kotlin/com/bibireden/playerex/components/experience/ExperienceDataComponent.kt index bd428c9a..34835481 100644 --- a/src/main/kotlin/com/bibireden/playerex/components/experience/ExperienceDataComponent.kt +++ b/src/main/kotlin/com/bibireden/playerex/components/experience/ExperienceDataComponent.kt @@ -7,24 +7,18 @@ import kotlin.math.max import kotlin.math.min import kotlin.random.Random -class ExperienceDataComponent( - val chunk: ChunkAccess, - private var _ticks: Int = 0, - private var _restorativeForceTicks: Int = PlayerEX.CONFIG.restorativeForceTicks, - private var _restorativeForceMultiplier: Int = PlayerEX.CONFIG.restorativeForceMultiplier, - private var _expNegationFactor: Float = 1.0F, - private var _expNegationMultiplier: Int = PlayerEX.CONFIG.expNegationFactor -) : IExperienceDataComponent { +class ExperienceDataComponent(val chunk: ChunkAccess, private var _ticks: Int = 0, private var _expNegationFactor: Float = 1.0F) : IExperienceDataComponent { override fun updateExperienceNegationFactor(amount: Int): Boolean { - if (Random.nextFloat() > this._expNegationFactor) return true; + if (Random.nextFloat() > this._expNegationFactor) return true - val dynamicMultiplier = this._expNegationMultiplier + ((1.0F - this._expNegationMultiplier) * (1.0F - (0.1F * amount))) + val negFactor = PlayerEX.CONFIG.advancedSettings.expNegationFactor + val dynamicMultiplier = negFactor + ((1.0F - negFactor) * (1.0F - (0.1F * amount))) this._expNegationFactor = max(this._expNegationFactor * dynamicMultiplier, 0.0F) this.chunk.isUnsaved = true return false } - override fun resetExperienceNegationFactor() { this._expNegationMultiplier = 1 } + override fun resetExperienceNegationFactor() { PlayerEX.CONFIG.advancedSettings.expNegationFactor = 1 } override fun readFromNbt(tag: CompoundTag) { this._expNegationFactor = tag.getFloat("exp_factor") @@ -36,10 +30,10 @@ class ExperienceDataComponent( override fun serverTick() { if (this._expNegationFactor == 1.0F) return - if (this._ticks < this._restorativeForceTicks) this._ticks++ + if (this._ticks < PlayerEX.CONFIG.advancedSettings.restorativeForceTicks) this._ticks++ else { this._ticks = 0 - this._expNegationFactor = min(this._expNegationFactor * this._restorativeForceMultiplier, 1.0F) + this._expNegationFactor = min(this._expNegationFactor * PlayerEX.CONFIG.advancedSettings.restorativeForceMultiplier, 1.0F) this.chunk.isUnsaved = true } } diff --git a/src/main/kotlin/com/bibireden/playerex/components/player/PlayerDataComponent.kt b/src/main/kotlin/com/bibireden/playerex/components/player/PlayerDataComponent.kt index 09fc0635..b8f82744 100644 --- a/src/main/kotlin/com/bibireden/playerex/components/player/PlayerDataComponent.kt +++ b/src/main/kotlin/com/bibireden/playerex/components/player/PlayerDataComponent.kt @@ -179,7 +179,7 @@ class PlayerDataComponent( val isEnoughExperience = player.experienceLevel >= required || override if (isEnoughExperience) { - val skillPoints = CONFIG.skillPointsPerLevelUp * amount + val skillPoints = CONFIG.levelingSettings.skillPointsPerLevelUp * amount if (!override) player.giveExperienceLevels(-required) this.addSkillPoints(skillPoints) diff --git a/src/main/kotlin/com/bibireden/playerex/config/PlayerEXConfigModel.kt b/src/main/kotlin/com/bibireden/playerex/config/PlayerEXConfigModel.kt index d6254169..00e3294c 100644 --- a/src/main/kotlin/com/bibireden/playerex/config/PlayerEXConfigModel.kt +++ b/src/main/kotlin/com/bibireden/playerex/config/PlayerEXConfigModel.kt @@ -10,79 +10,97 @@ import io.wispforest.owo.ui.core.Color @Modmenu(modId = PlayerEX.MOD_ID) @Config(name = "playerex-config", wrapperName = "PlayerEXConfig") class PlayerEXConfigModel { - @SectionHeader("client_options") + @SectionHeader("server_options") - @Sync(SyncMode.NONE) - @JvmField - var tooltip: Tooltip = Tooltip.Vanilla + @JvmField @Nest @Expanded var levelingSettings = LevelingSettings() + @JvmField @Nest @Expanded var featureSettings = FeatureSettings() + @JvmField @Nest @Expanded var lifecycleSettings = LifecycleSettings() + @JvmField @Nest @Expanded var advancedSettings = AdvancedSettings() - @Sync(SyncMode.NONE) - @JvmField - var showLevelOnNameplates: Boolean = true + @SectionHeader("client_options") - data class SoundSettings( - @Sync(SyncMode.NONE) - @JvmField - @RangeConstraint(min = 0.0, max = 150.0) - var levelUpVolume: Int = 100, + @JvmField @Nest @Expanded var visualSettings = VisualSettings() + @JvmField @Nest @Expanded var soundSettings = SoundSettings() - @Sync(SyncMode.NONE) + // SERVER + data class LevelingSettings( + @Sync(SyncMode.OVERRIDE_CLIENT) @JvmField - @RangeConstraint(min = 0.0, max = 150.0) - var skillUpVolume: Int = 100, + var skillPointsPerLevelUp: Int = 1, - @Sync(SyncMode.NONE) + @Sync(SyncMode.OVERRIDE_CLIENT) @JvmField - @RangeConstraint(min = 0.0, max = 150.0) - var refundVolume: Int = 100 + @Hook + var levelFormula: String = "stairs(x,0.2,2.4,17,10,25)" ) - @JvmField @Nest var soundSettings = SoundSettings() + data class FeatureSettings( + @Sync(SyncMode.OVERRIDE_CLIENT) + @JvmField + var resetOnDeath: Boolean = false, - data class VisualSettings( - @Sync(SyncMode.NONE) + @Sync(SyncMode.OVERRIDE_CLIENT) @JvmField - var nameplateColor: Color = Color.ofRgb(0xFFAA00), + var itemBreakingEnabled: Boolean = true, + + @Sync(SyncMode.OVERRIDE_CLIENT) + @JvmField + var disableUI: Boolean = false ) - @JvmField @Nest var visualSettings = VisualSettings() + data class LifecycleSettings( + @Sync(SyncMode.OVERRIDE_CLIENT) + @RestartRequired + @JvmField + var healthRegeneration: Lifecycle = Lifecycle.ON_EVERY_SECOND, + ) - @SectionHeader("server_options") - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - var resetOnDeath: Boolean = false + data class AdvancedSettings( + @Sync(SyncMode.OVERRIDE_CLIENT) + @JvmField + var restorativeForceTicks: Int = 600, - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - var itemBreakingEnabled: Boolean = true + @Sync(SyncMode.OVERRIDE_CLIENT) + @JvmField + var restorativeForceMultiplier: Int = 110, - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - var disableUI: Boolean = false + @Sync(SyncMode.OVERRIDE_CLIENT) + @JvmField + var expNegationFactor: Int = 95 + ) - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - var skillPointsPerLevelUp: Int = 1 + // CLIENT + data class VisualSettings( + @Sync(SyncMode.NONE) + @JvmField + var showLevelOnNameplates: Boolean = true, - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - @Hook - var levelFormula: String = "stairs(x,0.2,2.4,17,10,25)" + @Sync(SyncMode.NONE) + @JvmField + var nameplateColor: Color = Color.ofRgb(0xFFAA00), -// @JvmField -// var expression: Expression + @Sync(SyncMode.NONE) + @JvmField + var tooltip: Tooltip = Tooltip.Vanilla + ) - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - var restorativeForceTicks: Int = 600 + data class SoundSettings( + @Sync(SyncMode.NONE) + @JvmField + @RangeConstraint(min = 0.0, max = 100.0) + var levelUpVolume: Int = 100, - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - var restorativeForceMultiplier: Int = 110 + @Sync(SyncMode.NONE) + @JvmField + @RangeConstraint(min = 0.0, max = 100.0) + var skillUpVolume: Int = 100, - @Sync(SyncMode.OVERRIDE_CLIENT) - @JvmField - var expNegationFactor: Int = 95 + @Sync(SyncMode.NONE) + @JvmField + @RangeConstraint(min = 0.0, max = 100.0) + var refundVolume: Int = 100 + ) enum class Tooltip { Default, Vanilla, PlayerEX } + enum class Lifecycle { ON_TICK, ON_EVERY_SECOND } } \ No newline at end of file diff --git a/src/main/kotlin/com/bibireden/playerex/factory/EventFactory.kt b/src/main/kotlin/com/bibireden/playerex/factory/EventFactory.kt index eb5a6883..78a9a292 100644 --- a/src/main/kotlin/com/bibireden/playerex/factory/EventFactory.kt +++ b/src/main/kotlin/com/bibireden/playerex/factory/EventFactory.kt @@ -18,7 +18,7 @@ import net.minecraft.world.entity.projectile.AbstractArrow object EventFactory { fun reset(oldPlayer: ServerPlayer, newPlayer: ServerPlayer, isAlive: Boolean) { - val factor = if (PlayerEX.CONFIG.resetOnDeath) 0 else 100 + val factor = if (PlayerEX.CONFIG.featureSettings.resetOnDeath) 0 else 100 // attempt reconciliation (oldPlayer.component as PlayerDataComponent).modifiers.forEach { (rl, value) -> val attr = BuiltInRegistries.ATTRIBUTE[rl] ?: return@forEach diff --git a/src/main/kotlin/com/bibireden/playerex/util/PlayerEXUtil.kt b/src/main/kotlin/com/bibireden/playerex/util/PlayerEXUtil.kt index 751ecf53..fb188c69 100644 --- a/src/main/kotlin/com/bibireden/playerex/util/PlayerEXUtil.kt +++ b/src/main/kotlin/com/bibireden/playerex/util/PlayerEXUtil.kt @@ -30,7 +30,7 @@ object PlayerEXUtil { @JvmStatic private fun createExpression(): Expression { - return ExpressionBuilder(PlayerEX.CONFIG.levelFormula).variable(VARIABLE).function(STAIRCASE_FUNCTION).build() + return ExpressionBuilder(PlayerEX.CONFIG.levelingSettings.levelFormula).variable(VARIABLE).function(STAIRCASE_FUNCTION).build() } @JvmStatic diff --git a/src/main/resources/assets/playerex/lang/en_us.json b/src/main/resources/assets/playerex/lang/en_us.json index a87678f7..9f103e90 100644 --- a/src/main/resources/assets/playerex/lang/en_us.json +++ b/src/main/resources/assets/playerex/lang/en_us.json @@ -165,29 +165,38 @@ "text.config.playerex-config.section.client_options": "Client Options", "text.config.playerex-config.section.server_options": "Server Options", - "text.config.playerex-config.option.tooltip": "Tooltip", "text.config.playerex-config.enum.tooltip.default": "Default", "text.config.playerex-config.enum.tooltip.playerex": [ {"text": "PlayerEX", "color": "#FF4646"} ], "text.config.playerex-config.enum.tooltip.vanilla": "Vanilla", + "text.config.playerex-config.enum.lifecycle.on_tick": "ON_TICK", + "text.config.playerex-config.enum.lifecycle.on_every_second": "ON_EVERY_SECOND", - "text.config.playerex-config.option.showLevelOnNameplates": "Show Level on Nameplates", + "text.config.playerex-config.category.levelingSettings": "Leveling Options", + "text.config.playerex-config.option.levelingSettings.skillPointsPerLevelUp": "Skill Points per. Level Up", + "text.config.playerex-config.option.levelingSettings.levelFormula": "Leveling Formula", - "text.config.playerex-config.category.soundSettings": "Sound Options", - "text.config.playerex-config.option.soundSettings.levelUpVolume": "Level Up Volume", - "text.config.playerex-config.option.soundSettings.skillUpVolume": "Skill Up Volume", - "text.config.playerex-config.option.soundSettings.refundVolume": "Refund Volume", + "text.config.playerex-config.category.featureSettings": "Feature Options", + "text.config.playerex-config.option.featureSettings.resetOnDeath": "Reset on Death", + "text.config.playerex-config.option.featureSettings.itemBreakingEnabled": "Item Breaking Enabled", + "text.config.playerex-config.option.featureSettings.disableUI": "Disable UI", + + "text.config.playerex-config.category.lifecycleSettings": "Lifecycle Options", + "text.config.playerex-config.option.lifecycleSettings.healthRegeneration": "Health Regeneration", + + "text.config.playerex-config.category.advancedSettings": "Advanced Options", + "text.config.playerex-config.option.advancedSettings.restorativeForceTicks": "Restorative Force Ticks", + "text.config.playerex-config.option.advancedSettings.restorativeForceMultiplier": "Restorative Force Multiplier", + "text.config.playerex-config.option.advancedSettings.expNegationFactor": "Experience Negation Factor", "text.config.playerex-config.category.visualSettings": "Visual Options", + "text.config.playerex-config.option.visualSettings.showLevelOnNameplates": "Show Level on Nameplates", "text.config.playerex-config.option.visualSettings.nameplateColor": "Nameplate Color", + "text.config.playerex-config.option.visualSettings.tooltip": "Tooltip", - "text.config.playerex-config.option.resetOnDeath": "Reset on Death", - "text.config.playerex-config.option.skillPointsPerLevelUp": "Skill Points per. Level Up", - "text.config.playerex-config.option.levelFormula": "Leveling Formula", - "text.config.playerex-config.option.restorativeForceTicks": "Restorative Force Ticks", - "text.config.playerex-config.option.restorativeForceMultiplier": "Restorative Force Multiplier", - "text.config.playerex-config.option.expNegationFactor": "Experience Negation Factor", - - "text.config.playerex-config.option.disableUI": "Disable UI" + "text.config.playerex-config.category.soundSettings": "Sound Options", + "text.config.playerex-config.option.soundSettings.levelUpVolume": "Level Up Volume", + "text.config.playerex-config.option.soundSettings.skillUpVolume": "Skill Up Volume", + "text.config.playerex-config.option.soundSettings.refundVolume": "Refund Volume" } \ No newline at end of file