Skip to content

Commit

Permalink
fix boolean logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Wide-Cat committed May 4, 2024
1 parent cc675ed commit e8f7ef0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public class BundleItemMixin {
@ModifyExpressionValue(method = "getTooltipData", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;contains(Lnet/minecraft/component/DataComponentType;)Z", ordinal = 0))
private boolean modifyContains1(boolean original) {
BetterTooltips bt = Modules.get().get(BetterTooltips.class);
return (bt.isActive() && bt.tooltip.get()) || original;
return !(bt.isActive() && bt.tooltip.get()) && original;
}

@ModifyExpressionValue(method = "getTooltipData", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;contains(Lnet/minecraft/component/DataComponentType;)Z", ordinal = 1))
private boolean modifyContains2(boolean original) {
BetterTooltips bt = Modules.get().get(BetterTooltips.class);
return (bt.isActive() && bt.additional.get()) || original;
return !(bt.isActive() && bt.additional.get()) && original;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ private boolean modifyCanPlaceText(boolean original) {
@ModifyExpressionValue(method = "getTooltip", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;contains(Lnet/minecraft/component/DataComponentType;)Z", ordinal = 0))
private boolean modifyContainsTooltip(boolean original) {
BetterTooltips bt = Modules.get().get(BetterTooltips.class);
return (bt.isActive() && bt.tooltip.get()) || original;
return !(bt.isActive() && bt.tooltip.get()) && original;
}

@ModifyExpressionValue(method = "getTooltip", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;contains(Lnet/minecraft/component/DataComponentType;)Z", ordinal = 3))
private boolean modifyContainsAdditional(boolean original) {
BetterTooltips bt = Modules.get().get(BetterTooltips.class);
return (bt.isActive() && bt.additional.get()) || original;
return !(bt.isActive() && bt.additional.get()) && original;
}

@Inject(method = "finishUsing", at = @At("HEAD"))
Expand Down

0 comments on commit e8f7ef0

Please sign in to comment.