blob: eef185561b34570a434fffc7cec439ae7b2b6dab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
//package com.thatgravyboat.skyblockhud.mixins;
//
//import at.lorenz.mod.LorenzMod;
//import com.thatgravyboat.skyblockhud.api.item.IAbility;
//import com.thatgravyboat.skyblockhud.handlers.CooldownHandler;
//import java.util.regex.Matcher;
//import net.minecraft.item.ItemStack;
//import net.minecraft.nbt.NBTTagCompound;
//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;
//
//@Mixin(ItemStack.class)
//public class MixinItemStack implements IAbility {
//
// private String ability;
// private int abilityTime;
//
// @Inject(method = "setTagCompound", at = @At("HEAD"))
// public void onNbt(NBTTagCompound nbt, CallbackInfo ci) {
// if (LorenzMod.config != null && !LorenzMod.config.misc.hideItemCooldowns) {
// Matcher abilityMatcher = CooldownHandler.getAbility(nbt);
// if (abilityMatcher != null) {
// ability = abilityMatcher.group(1);
// try {
// abilityTime = Integer.parseInt(abilityMatcher.group(2).trim());
// } catch (Exception ignored) {}
// }
// }
// }
//
// @Override
// public String getAbility() {
// return ability;
// }
//
// @Override
// public int getAbilityTime() {
// return abilityTime;
// }
//}
|