Skip to content

Commit

Permalink
remove apothic attribute compat
Browse files Browse the repository at this point in the history
  • Loading branch information
iron431 committed Oct 22, 2024
1 parent e33631e commit 709e347
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package io.redspace.ironsspellbooks.mixin;

import dev.shadowsoffire.apothic_attributes.api.IFormattableAttribute;
import io.redspace.ironsspellbooks.api.attribute.MagicPercentAttribute;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.item.TooltipFlag;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(MagicPercentAttribute.class)
public class Compat$apothic_attributes$AttributeHandler implements IFormattableAttribute {
public class Compat$apothic_attributes$AttributeHandler {/*implements IFormattableAttribute {
public MutableComponent toValueComponent(AttributeModifier.Operation op, double value, TooltipFlag flag) {
return Component.translatable("apothic_attributes.value.percent", FORMAT.format(value * 100.0));
}
}*/
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.redspace.ironsspellbooks.mixin;

import io.redspace.ironsspellbooks.IronsSpellbooks;
import net.neoforged.fml.loading.FMLLoader;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
Expand All @@ -23,13 +22,11 @@ public String getRefMapperConfig() {

@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
IronsSpellbooks.LOGGER.debug("shouldApplyMixin: {}", mixinClassName);
// Internal format of Compat$MODID$MixinName to automatically *not* apply mixins with that modid missing
var nameT = mixinClassName.split("\\.");
var name = nameT[nameT.length - 1];
if (name.startsWith("Compat")) {
String modid = name.substring(7, name.lastIndexOf('$'));
IronsSpellbooks.LOGGER.debug("compat mixin detection: modid: {}", modid);
return FMLLoader.getLoadingModList().getModFileById(modid) != null;
}
return true;
Expand Down

0 comments on commit 709e347

Please sign in to comment.