Skip to content

Commit

Permalink
Temp solution for #113
Browse files Browse the repository at this point in the history
- Any sync-related issues will be delayed until after the PCASyncProtocol refactoring.

Signed-off-by: Hendrix-Shen <HendrixShen@hendrixshen.top>
  • Loading branch information
Hendrix-Shen committed Jul 15, 2024
1 parent 837b944 commit 8cf5891
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.plusls.MasaGadget.mixin.mod_tweak.tweakeroo.inventoryPreviewSupportTradeOfferList;

import org.spongepowered.asm.mixin.Mixin;
import top.hendrixshen.magiclib.api.preprocess.DummyClass;

@Mixin(DummyClass.class)
public class MixinAbstractVillager {
}
1 change: 1 addition & 0 deletions src/main/resources/masa_gadget_mod.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
"defaultRequire": 1
},
"mixins": [
"mod_tweak.tweakeroo.inventoryPreviewSupportTradeOfferList.MixinAbstractVillager"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.plusls.MasaGadget.mixin.mod_tweak.tweakeroo.inventoryPreviewSupportTradeOfferList;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.plusls.MasaGadget.game.Configs;
import net.minecraft.world.entity.npc.AbstractVillager;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(AbstractVillager.class)
public class MixinAbstractVillager {
@WrapOperation(
method = "getOffers",
at = @At(
value = "FIELD",
target = "Lnet/minecraft/world/level/Level;isClientSide:Z"
)
)
private boolean forgiveInvoke(Level instance, @NotNull Operation<Boolean> original) {
return original.call(instance) && !Configs.inventoryPreviewSupportTradeOfferList.getBooleanValue();
}
}

0 comments on commit 8cf5891

Please sign in to comment.