generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Any sync-related issues will be delayed until after the PCASyncProtocol refactoring. Signed-off-by: Hendrix-Shen <HendrixShen@hendrixshen.top>
- Loading branch information
1 parent
837b944
commit 8cf5891
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...ixin/mod_tweak/tweakeroo/inventoryPreviewSupportTradeOfferList/MixinAbstractVillager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...ixin/mod_tweak/tweakeroo/inventoryPreviewSupportTradeOfferList/MixinAbstractVillager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |