Skip to content

Epic Armor Customization GUI #1215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b4c06ef
start creating the screen
viciscat Mar 4, 2025
620bd06
trim selection
viciscat Mar 7, 2025
a92746a
colo(u)ring and button in inventory
viciscat Mar 17, 2025
5e61d4a
translation and little touches
viciscat Mar 17, 2025
89a4cad
translation and little touches
viciscat Mar 17, 2025
7e0764d
things i forgot
viciscat Mar 17, 2025
9ab44ce
Merge branch 'master' into epic-armor-customization-gui
viciscat Mar 17, 2025
5c5ca1b
remove debug stuff oops
viciscat Apr 15, 2025
fb869a1
Merge branch 'master' into epic-armor-customization-gui
viciscat Apr 15, 2025
e3dad45
replace speed by duration
viciscat Apr 15, 2025
9b15d62
Merge branch 'master' into epic-armor-customization-gui
viciscat Apr 25, 2025
62466fa
1.12.5
viciscat Apr 27, 2025
b958c7f
some docs and things
viciscat Apr 29, 2025
ef9b46e
requested changes
viciscat May 5, 2025
e24c3a5
fix crash in tests
viciscat May 7, 2025
dae4735
Merge branch 'master' into epic-armor-customization-gui
viciscat May 9, 2025
e2abee0
changes!
viciscat May 9, 2025
72a19e2
clean up
kevinthegreat1 May 12, 2025
e3e324b
Test animated dye interpolation
kevinthegreat1 May 28, 2025
0347b24
Merge remote-tracking branch 'origin/master' into fork/viciscat/epic-…
kevinthegreat1 May 28, 2025
57022d1
Add DFU for animated dye and item background
kevinthegreat1 May 28, 2025
ed9d9f9
Add slider steps
kevinthegreat1 May 28, 2025
a16a790
Add config data fixer test
kevinthegreat1 May 28, 2025
28161ef
Draw trim material item
kevinthegreat1 May 28, 2025
e9973a6
remove old stuff
viciscat May 29, 2025
b3f4623
Clean up interpolate and gui code
kevinthegreat1 May 30, 2025
f1286e7
supplier
viciscat May 31, 2025
917d65e
180
viciscat May 31, 2025
28b09be
grrrrr
viciscat May 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.apache.commons.lang3.function.Consumers;

public class SkyblockerConfigManager {
public static final int CONFIG_VERSION = 3;
public static final int CONFIG_VERSION = 4;
private static final Path CONFIG_FILE = FabricLoader.getInstance().getConfigDir().resolve("skyblocker.json");
private static final ConfigClassHandler<SkyblockerConfig> HANDLER = ConfigClassHandler.createBuilder(SkyblockerConfig.class)
.serializer(config -> GsonConfigSerializerBuilder.create(config)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.hysky.skyblocker.config.configs;

import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.skyblock.item.CustomArmorAnimatedDyes;
import de.hysky.skyblocker.skyblock.item.CustomArmorTrims;
import de.hysky.skyblocker.skyblock.item.custom.CustomArmorAnimatedDyes;
import de.hysky.skyblocker.skyblock.item.custom.CustomArmorTrims;
import de.hysky.skyblocker.skyblock.item.slottext.SlotTextMode;
import dev.isxander.yacl3.config.v2.api.SerialEntry;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ private static DataFixer build() {
builder.addFixer(new ConfigFix1(schema2, true));
Schema schema3 = builder.addSchema(3, Schema::new);
builder.addFixer(new ConfigFix2QuickNav(schema3, true));
Schema schema4 = builder.addSchema(4, Schema::new);
builder.addFixer(new ConfigFix3AnimatedDyeAndItemBackground(schema4, true));

return builder.build().fixer();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package de.hysky.skyblocker.config.datafixer;

import com.mojang.datafixers.DSL;
import com.mojang.datafixers.TypeRewriteRule;
import com.mojang.datafixers.schemas.Schema;
import com.mojang.serialization.Dynamic;
import net.minecraft.util.math.ColorHelper;

import java.util.stream.Stream;

public class ConfigFix3AnimatedDyeAndItemBackground extends ConfigDataFix {
public ConfigFix3AnimatedDyeAndItemBackground(Schema outputSchema, boolean changesType) {
super(outputSchema, changesType);
}

@Override
protected TypeRewriteRule makeRule() {
return fixTypeEverywhereTyped(
"ConfigFix3AnimatedDyeAndItemBackground",
getInputSchema().getType(ConfigDataFixer.CONFIG_TYPE),
typed -> typed.update(DSL.remainderFinder(), this::fix)
);
}

private <T> Dynamic<T> fix(Dynamic<T> dynamic) {
return fixVersion(dynamic).update("general", general -> general
.update("customAnimatedDyes", customAnimatedDyes -> customAnimatedDyes
.updateMapValues(customAnimatedDye -> customAnimatedDye.mapSecond(this::fixCustomAnimatedDye))
)
.update("itemInfoDisplay", itemInfoDisplay -> itemInfoDisplay
.renameField("itemRarityBackgroundStyle", "itemBackgroundStyle")
.renameField("itemRarityBackgroundsOpacity", "itemBackgroundOpacity")
)
);
}

private <T> Dynamic<T> fixCustomAnimatedDye(Dynamic<T> customAnimatedDye) {
return customAnimatedDye
.set("keyframes", customAnimatedDye.createList(Stream.of(
customAnimatedDye.emptyMap()
.set("color", customAnimatedDye.createInt(ColorHelper.fullAlpha(customAnimatedDye.get("color1").asInt(0))))
.set("time", customAnimatedDye.createFloat(0)),
customAnimatedDye.emptyMap()
.set("color", customAnimatedDye.createInt(ColorHelper.fullAlpha(customAnimatedDye.get("color2").asInt(0))))
.set("time", customAnimatedDye.createFloat(1))
)))
.remove("color1")
.remove("color2")
// Samples is how many steps the animation has, and tickDelay is how long each step takes in ticks.
.set("duration", customAnimatedDye.createFloat(customAnimatedDye.get("samples").asInt(20) * customAnimatedDye.get("tickDelay").asInt(1) / 20f))
.remove("samples")
.remove("tickDelay");
}
}
4 changes: 2 additions & 2 deletions src/main/java/de/hysky/skyblocker/debug/Debug.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import de.hysky.skyblocker.skyblock.events.EventNotifications;
import de.hysky.skyblocker.utils.Constants;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.datafixer.ItemStackComponentizationFixer;
import de.hysky.skyblocker.utils.Utils;
import de.hysky.skyblocker.utils.networth.NetworthCalculator;
import net.azureaaron.networth.Calculation;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
Expand Down Expand Up @@ -150,7 +150,7 @@ public enum DumpFormat {
JSON {
@Override
public Text format(ItemStack stack) {
return Text.literal(SkyblockerMod.GSON_COMPACT.toJson(ItemUtils.EMPTY_ALLOWING_ITEMSTACK_CODEC.encodeStart(ItemStackComponentizationFixer.getRegistryLookup().getOps(JsonOps.INSTANCE), stack).getOrThrow()));
return Text.literal(SkyblockerMod.GSON_COMPACT.toJson(ItemUtils.EMPTY_ALLOWING_ITEMSTACK_CODEC.encodeStart(Utils.getRegistryWrapperLookup().getOps(JsonOps.INSTANCE), stack).getOrThrow()));
}
},
SNBT {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.llamalad7.mixinextras.injector.ModifyReturnValue;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.item.CustomArmorTrims;
import de.hysky.skyblocker.skyblock.item.custom.CustomArmorTrims;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.Utils;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.llamalad7.mixinextras.sugar.Local;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.item.CustomArmorAnimatedDyes;
import de.hysky.skyblocker.skyblock.item.custom.CustomArmorAnimatedDyes;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.Utils;
import net.minecraft.component.type.DyedColorComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package de.hysky.skyblocker.mixins.accessors;

import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.equipment.EquipmentModelLoader;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(EntityRenderDispatcher.class)
public interface EntityRenderDispatcherAccessor {
@Accessor
EquipmentModelLoader getEquipmentModelLoader();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package de.hysky.skyblocker.mixins.accessors;

import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.texture.SpriteContents;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(SpriteContents.class)
public interface SpriteContentsAccessor {
@Accessor
NativeImage getImage();
}

This file was deleted.

Loading