-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/client/java/com/bawnorton/bettertrims/mixin/client/ArmorTrimMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.bawnorton.bettertrims.mixin.client; | ||
|
||
import com.bawnorton.bettertrims.effect.ArmorTrimEffects; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.trim.ArmorTrim; | ||
import net.minecraft.registry.DynamicRegistryManager; | ||
import net.minecraft.screen.ScreenTexts; | ||
import net.minecraft.text.Text; | ||
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.callback.CallbackInfo; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(ArmorTrim.class) | ||
public abstract class ArmorTrimMixin { | ||
@Inject(method = "appendTooltip", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z", ordinal = 2, shift = At.Shift.AFTER)) | ||
private static void addEffectTooltip(ItemStack stack, DynamicRegistryManager registryManager, List<Text> tooltip, CallbackInfo ci, @Local ArmorTrim trim) { | ||
ArmorTrimEffects.forEachEffect(stack, effect -> tooltip.add(ScreenTexts.space().append(effect.getTooltip().copy().fillStyle(trim.getMaterial().value().description().getStyle())))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ | |
"defaultRequire": 1 | ||
}, | ||
"mixins": [ | ||
"ArmorTrimMixin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"effect.bettertrims.quartz.tooltip": "Gain More Experience", | ||
"effect.bettertrims.iron.tooltip": "Mine Faster", | ||
"effect.bettertrims.netherite.tooltip": "Fire Resistant", | ||
"effect.bettertrims.redstone.tooltip": "Move Faster", | ||
"effect.bettertrims.copper.tooltip": "Swim Faster", | ||
"effect.bettertrims.gold.tooltip": "Piglins Ignore You", | ||
"effect.bettertrims.emerald.tooltip": "Villagers Like You", | ||
"effect.bettertrims.diamond.tooltip": "Harder to Kill", | ||
"effect.bettertrims.lapis.tooltip": "More Enchantable", | ||
"effect.bettertrims.amethyst.tooltip": "Stronger Potion Effects", | ||
"effect.bettertrims.platinum.tooltip": "Illagers Ignore You", | ||
"effect.bettertrims.silver.tooltip": "Stronger at Night" | ||
} |