-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change wizard armour to not give potency, but reduced mana cost
- Loading branch information
1 parent
222552d
commit b060435
Showing
9 changed files
with
64 additions
and
12 deletions.
There are no files selected for viewing
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
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
45 changes: 45 additions & 0 deletions
45
src/main/java/dev/cammiescorner/arcanuscontinuum/mixin/common/ItemStackMixin.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,45 @@ | ||
package dev.cammiescorner.arcanuscontinuum.mixin.common; | ||
|
||
import com.google.common.collect.Multimap; | ||
import com.llamalad7.mixinextras.sugar.Share; | ||
import com.llamalad7.mixinextras.sugar.ref.LocalRef; | ||
import dev.cammiescorner.arcanuscontinuum.api.entities.ArcanusEntityAttributes; | ||
import net.minecraft.client.item.TooltipContext; | ||
import net.minecraft.entity.EquipmentSlot; | ||
import net.minecraft.entity.attribute.EntityAttribute; | ||
import net.minecraft.entity.attribute.EntityAttributeModifier; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.text.MutableText; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Formatting; | ||
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.ModifyArg; | ||
import org.spongepowered.asm.mixin.injection.Slice; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | ||
|
||
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Mixin(ItemStack.class) | ||
public abstract class ItemStackMixin { | ||
@Inject(method = "getTooltip", at = @At(value = "INVOKE", | ||
target = "Ljava/util/Map$Entry;getValue()Ljava/lang/Object;" | ||
), locals = LocalCapture.CAPTURE_FAILSOFT) | ||
private void arcanuscontinuum$captureEntry(PlayerEntity player, TooltipContext context, CallbackInfoReturnable<List<Text>> cir, List list, MutableText mutableText, int i, EquipmentSlot[] var6, int var7, int var8, EquipmentSlot equipmentSlot, Multimap multimap, Iterator var11, Map.Entry<EntityAttribute, EntityAttributeModifier> entry, @Share("entry") LocalRef<Map.Entry<EntityAttribute, EntityAttributeModifier>> ref) { | ||
ref.set(entry); | ||
} | ||
|
||
@ModifyArg(method = "getTooltip", slice = @Slice(from = @At(value = "FIELD", | ||
target = "Lnet/minecraft/util/Formatting;BLUE:Lnet/minecraft/util/Formatting;" | ||
)), at = @At(value = "INVOKE", | ||
target = "Lnet/minecraft/text/MutableText;formatted(Lnet/minecraft/util/Formatting;)Lnet/minecraft/text/MutableText;" | ||
)) | ||
private Formatting arcanuscontinuum$switchColour(Formatting formatting, @Share("entry") LocalRef<Map.Entry<EntityAttribute, EntityAttributeModifier>> ref) { | ||
return ref.get().getKey() == ArcanusEntityAttributes.MANA_COST_MULT.get() ? (formatting == Formatting.BLUE ? Formatting.RED : Formatting.BLUE) : formatting; | ||
} | ||
} |
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