This commit is contained in:
radimous 2024-11-21 21:19:31 +01:00
parent 9f7c3df47e
commit 87f94725dd
4 changed files with 27 additions and 17 deletions

View file

@ -173,8 +173,8 @@ dependencies {
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
//VH
implementation fg.deobf("curse.maven:vault-hunters-official-mod-458203:5631250")
// implementation fg.deobf("curse.maven:wolds-vaults-official-mod-958799:5622985")
implementation fg.deobf("curse.maven:vault-hunters-official-mod-458203:5925633")
//deps
implementation fg.deobf("curse.maven:curios-309927:4418032")
implementation fg.deobf("curse.maven:sophisticated-backpacks-vault-hunters-edition-696425:4287544")

View file

@ -38,7 +38,7 @@ mod_name=VHat Can I Roll?
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GNU LGPL 3.0
# The mod version. See https://semver.org/
mod_version=1.1
mod_version=1.2
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View file

@ -6,15 +6,15 @@ import iskallia.vault.config.gear.VaultGearTierConfig;
import iskallia.vault.gear.attribute.VaultGearAttribute;
import iskallia.vault.gear.attribute.VaultGearAttributeRegistry;
import iskallia.vault.gear.attribute.ability.AbilityLevelAttribute;
import iskallia.vault.gear.attribute.ability.special.base.SpecialAbilityModification;
import iskallia.vault.gear.attribute.config.BooleanFlagGenerator;
import iskallia.vault.gear.attribute.config.ConfigurableAttributeGenerator;
import iskallia.vault.gear.attribute.custom.EffectGearAttribute;
import iskallia.vault.gear.attribute.custom.effect.EffectGearAttribute;
import iskallia.vault.init.ModConfigs;
import iskallia.vault.util.TextComponentUtils;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.fml.LogicalSide;
@ -55,7 +55,7 @@ public class Helper {
Map<String, Integer> groupCounts = countGroups(lvl, affixTagGroup, modifierGroup, legendary);
List<String> grList = new ArrayList<>();
Map<String, List<Component>> groupedModifiers = new HashMap<>();
for (VaultGearTierConfig.ModifierTierGroup modifierTierGroup : modifierGroup.get(affixTagGroup)) {
ArrayList<VaultGearTierConfig.ModifierTier<?>> mTierList;
if (legendary) {
@ -71,22 +71,32 @@ public class Helper {
Component newMod = getVal(
Objects.requireNonNull(VaultGearAttributeRegistry.getAttribute(modifierTierGroup.getAttribute())),
mTierList);
if (groupCounts.get(modGr) > 1 && !grList.contains(modGr)) {
grList.add(modGr);
}
int index = grList.indexOf(modGr); // index used to determine color
MutableComponent full;
if (index == -1) {
full = new TextComponent(" ");
} else {
full = new TextComponent("").withStyle(COLORS[index % COLORS.length]);
if (groupCounts.get(modGr) > 1) {
groupedModifiers.computeIfAbsent(modGr, k -> new ArrayList<>()).add(newMod);
continue;
}
MutableComponent full = new TextComponent(" ");
full.append(newMod);
if (Config.ALLOW_DUPE.get() || !(modList.get(modList.size() - 1).getString()).equals(full.getString())) { //dumb way to fix ability lvl+ duplication
modList.add(full);
}
}
boolean useNums = false;
if (groupedModifiers.size() > COLORS.length) {
// more than 7 groups is a bit crazy, but just in case
useNums = true;
}
int i = 0;
for (var modGr: groupedModifiers.values()) {
for (var mod: modGr) {
MutableComponent full = new TextComponent(useNums ? i + " " : "").withStyle(COLORS[i % COLORS.length]);
full.append(mod);
modList.add(full);
}
i++;
}
modList.add(TextComponent.EMPTY);
}
@ -226,7 +236,7 @@ public class Helper {
var abName = optSkill.get().getName();
abComp.append(res);
abComp.append(" to level of ");
abComp.append(new TextComponent(abName).withStyle(SpecialAbilityModification.getAbilityStyle()));
abComp.append(new TextComponent(abName).withStyle(Style.EMPTY.withColor(14076214)));
return abComp;
}
}

View file

@ -1,6 +1,6 @@
package com.radimous.vhatcaniroll.mixin;
import iskallia.vault.gear.attribute.custom.EffectGearAttribute;
import iskallia.vault.gear.attribute.custom.effect.EffectGearAttribute;
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;