Skip to content

Commit

Permalink
Add old glint speed + glint category
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixces committed Jan 9, 2025
1 parent 77763c3 commit 4b3b567
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 31 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ modmenu_version=13.0.0
yacl_version=3.6.2+1.21.4-fabric

# Mod Properties
mod_version=1.0.0-dev-9
mod_version=1.0.0-dev-10
maven_group=btw.mixces
archives_base_name=animatium
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package btw.mixces.animatium.mixins;

import btw.mixces.animatium.config.AnimatiumConfig;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.client.renderer.RenderStateShard;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(RenderStateShard.class)
public class MixinRenderStateShard {
@ModifyExpressionValue(method = "setupGlintTexturing", at = @At(value = "CONSTANT", args = "doubleValue=8.0"))
private static double animatium$disableSpeedMultiplier(double original) {
return AnimatiumConfig.instance().getOldGlintSpeed() ? 1.0D : original;
}

@ModifyExpressionValue(method = "setupGlintTexturing", at = @At(value = "CONSTANT", args = "floatValue=110000.0"))
private static float animatium$oldSpeedValue$4873(float original) {
return AnimatiumConfig.instance().getOldGlintSpeed() ? 4873.0F : original;
}

@ModifyExpressionValue(method = "setupGlintTexturing", at = @At(value = "CONSTANT", args = "floatValue=30000.0"))
private static float animatium$oldSpeedValue$3000(float original) {
return AnimatiumConfig.instance().getOldGlintSpeed() ? 3000.0F : original;
}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/btw/mixces/animatium/AnimatiumClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AnimatiumClient : ClientModInitializer {
// Info
@JvmStatic
val VERSION = 1.0
val DEVELOPMENT_VERSION = Optional.ofNullable(9)
val DEVELOPMENT_VERSION = Optional.ofNullable(10)

@JvmStatic
fun location(path: String): ResourceLocation {
Expand Down
70 changes: 45 additions & 25 deletions src/main/kotlin/btw/mixces/animatium/config/AnimatiumConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,46 @@ class AnimatiumConfig {
category.group(itemFixesGroup.build())
}

// Glint
run {
val glintGroup = OptionGroup.createBuilder()
glintGroup.name(Component.translatable("animatium.category.items.group.glint"))
glintGroup.option(
Option.createBuilder<Boolean>()
.name(Component.translatable("animatium.oldGlintSpeed"))
.description(OptionDescription.of(Component.translatable("animatium.oldGlintSpeed.description")))
.binding(
defaults.oldGlintSpeed,
{ config.oldGlintSpeed },
{ newVal -> config.oldGlintSpeed = newVal })
.controller(TickBoxControllerBuilder::create)
.build()
)
glintGroup.option(
Option.createBuilder<Boolean>()
.name(Component.translatable("animatium.disableGlintOnItemDrops2D"))
.description(OptionDescription.of(Component.translatable("animatium.disableGlintOnItemDrops2D.description")))
.binding(
defaults.disableGlintOnItemDrops2D,
{ config.disableGlintOnItemDrops2D },
{ newVal -> config.disableGlintOnItemDrops2D = newVal })
.controller(TickBoxControllerBuilder::create)
.build()
)
glintGroup.option(
Option.createBuilder<Boolean>()
.name(Component.translatable("animatium.disableGlintOnItemFramed2D"))
.description(OptionDescription.of(Component.translatable("animatium.disableGlintOnItemFramed2D.description")))
.binding(
defaults.disableGlintOnItemFramed2D,
{ config.disableGlintOnItemFramed2D },
{ newVal -> config.disableGlintOnItemFramed2D = newVal })
.controller(TickBoxControllerBuilder::create)
.build()
)
category.group(glintGroup.build())
}

// Other
run {
val otherGroup = OptionGroup.createBuilder()
Expand Down Expand Up @@ -948,28 +988,6 @@ class AnimatiumConfig {
.controller(TickBoxControllerBuilder::create)
.build()
)
otherGroup.option(
Option.createBuilder<Boolean>()
.name(Component.translatable("animatium.disableGlintOnItemDrops2D"))
.description(OptionDescription.of(Component.translatable("animatium.disableGlintOnItemDrops2D.description")))
.binding(
defaults.disableGlintOnItemDrops2D,
{ config.disableGlintOnItemDrops2D },
{ newVal -> config.disableGlintOnItemDrops2D = newVal })
.controller(TickBoxControllerBuilder::create)
.build()
)
otherGroup.option(
Option.createBuilder<Boolean>()
.name(Component.translatable("animatium.disableGlintOnItemFramed2D"))
.description(OptionDescription.of(Component.translatable("animatium.disableGlintOnItemFramed2D.description")))
.binding(
defaults.disableGlintOnItemFramed2D,
{ config.disableGlintOnItemFramed2D },
{ newVal -> config.disableGlintOnItemFramed2D = newVal })
.controller(TickBoxControllerBuilder::create)
.build()
)
otherGroup.option(
Option.createBuilder<Boolean>()
.name(Component.translatable("animatium.oldDurabilityBarColors"))
Expand Down Expand Up @@ -1005,7 +1023,6 @@ class AnimatiumConfig {
)
category.group(otherGroup.build())
}

builder.category(category.build())
}

Expand Down Expand Up @@ -1240,11 +1257,14 @@ class AnimatiumConfig {
@SerialEntry var itemDrops2D = true
@SerialEntry var itemFramed2D = true
@SerialEntry var item2DColors = true
@SerialEntry var disableGlintOnItemDrops2D = false
@SerialEntry var disableGlintOnItemFramed2D = false
@SerialEntry var oldDurabilityBarColors = true
@SerialEntry var oldItemRarities = true
@SerialEntry var showHeldItemInBoat = true

@SerialEntry var oldGlintSpeed = true
@SerialEntry var disableGlintOnItemDrops2D = false
@SerialEntry var disableGlintOnItemFramed2D = false

@SerialEntry var oldFishingRodTextureStackCheck = true
@SerialEntry var fishingRodLineInterpolation = false
@SerialEntry var noMoveFishingRodLine = false
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/animatium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"client": [
"MixinMinecraft",
"MixinOverlayTexture",
"MixinRenderStateShard",
"MixinSpriteContents",
"accessor.AbstractSelectionListAccessor",
"accessor.CameraAccessor",
Expand Down
11 changes: 7 additions & 4 deletions src/main/resources/assets/animatium/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,19 @@
"animatium.itemFramed2D.description": "Makes framed items render 2D (not blocks).",
"animatium.item2DColors": "Bring back the old 2D item color",
"animatium.item2DColors.description": "Restores the old color of 2D items by swapping the Y and Z components of the vertex normal.",
"animatium.disableGlintOnItemDrops2D": "Disable glint on dropped items",
"animatium.disableGlintOnItemDrops2D.description": "Disables the enchantment glint on dropped items. Intended to be used along side the 2D dropped items feature to match <1.7.x.",
"animatium.disableGlintOnItemFramed2D": "Disable glint on framed items",
"animatium.disableGlintOnItemFramed2D.description": "Disables the enchantment glint on framed items. Intended to be used along side the 2D framed items feature to match <1.7.x.",
"animatium.oldDurabilityBarColors": "Restore old durability bar colors",
"animatium.oldDurabilityBarColors.description": "Restores the old durability damage colors from <1.11.",
"animatium.oldItemRarities": "Restore old item rarities",
"animatium.oldItemRarities.description": "Restores the old rarities for items visually from <1.21.2. (also old trident rarity from <1.21)",
"animatium.showHeldItemInBoat": "Show held item in boat",
"animatium.showHeldItemInBoat.description": "Shows your held item while you're in a moving boat like <=1.8.x.",
"animatium.category.items.group.glint": "Enchantment Glint",
"animatium.oldGlintSpeed": "Old enchantment glint speed",
"animatium.oldGlintSpeed.description": "Restores the old enchantment glint speed like in <=1.8.x.",
"animatium.disableGlintOnItemDrops2D": "Disable glint on dropped items",
"animatium.disableGlintOnItemDrops2D.description": "Disables the enchantment glint on dropped items. Intended to be used along side the 2D dropped items feature to match <1.7.x.",
"animatium.disableGlintOnItemFramed2D": "Disable glint on framed items",
"animatium.disableGlintOnItemFramed2D.description": "Disables the enchantment glint on framed items. Intended to be used along side the 2D framed items feature to match <1.7.x.",
"animatium.category.items.group.fishing_rod": "Fishing Rod",
"animatium.oldFishingRodTextureStackCheck": "Disable fishing rod stack texture check",
"animatium.oldFishingRodTextureStackCheck.description": "Brings back old fishing rod stack texture check from <=1.8.",
Expand Down

0 comments on commit 4b3b567

Please sign in to comment.