Equipment Compare [Fabric]

Equipment Compare [Fabric]

11M Downloads

Unconditionally cancelled inject causing compatibility issues on Fabric

enjarai opened this issue ยท 2 comments

commented

The Fabric version of this mod contains an inject mixin in KeyMapping that is unconditionally cancelled. This is effectively the same as using an overwrite mixin, and is very bad practice:

@Inject(method = "resetMapping", at = @At(value = "HEAD"), cancellable = true)
private static void resetMapping(CallbackInfo info)
{
MAP.clear();
Iterator<?> var0 = ALL.values().iterator();
while (var0.hasNext())
{
KeyMapping keyMapping = (KeyMapping)var0.next();
if (!keyMapping.equals(EquipmentCompare.showComparisonTooltip))
{
MAP.put(keyMapping.key, keyMapping);
}
}
info.cancel();
}

Doing your mixin this way creates incompatibilities with one of my mods (specifically here (uses Yarn)) and is likely to create issues with other mods that modify keybind behaviour.

If possible, it'd be great if you could switch to a more limited injection scope, potentially making use of the excellent @WrapWithCondition provided by MixinExtras.

commented

Is a fix planned for this? If not, mind if I create a PR for it?

commented