diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-02 03:48:33 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-04-02 03:48:33 +0200 |
commit | 94455031f150c4fb7120f7eba1d2ae5ce0694087 (patch) | |
tree | 60e07f9537112dd3ca2078bc5c06f1a831fd4058 /src/main | |
parent | 2105991a3ff36cf3c02795919b751d4db782083a (diff) | |
download | potato-crimes-94455031f150c4fb7120f7eba1d2ae5ce0694087.tar.gz potato-crimes-94455031f150c4fb7120f7eba1d2ae5ce0694087.tar.bz2 potato-crimes-94455031f150c4fb7120f7eba1d2ae5ce0694087.zip |
Use official yarn build
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/moe/nea/potatocrime/mixin/ShillCarrotsToVillagerPatch.java | 3 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/potatocrime/PotatoCrime.kt | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/moe/nea/potatocrime/mixin/ShillCarrotsToVillagerPatch.java b/src/main/java/moe/nea/potatocrime/mixin/ShillCarrotsToVillagerPatch.java index e091069..f4e3079 100644 --- a/src/main/java/moe/nea/potatocrime/mixin/ShillCarrotsToVillagerPatch.java +++ b/src/main/java/moe/nea/potatocrime/mixin/ShillCarrotsToVillagerPatch.java @@ -7,6 +7,7 @@ import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; +import net.minecraft.sound.SoundEvents; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.world.World; @@ -32,6 +33,7 @@ public abstract class ShillCarrotsToVillagerPatch extends MerchantEntity { if (this.isAlive() && !this.hasCustomer() && !this.isSleeping()) { if (itemInHand.isOf(Items.CARROT)) { if (!isClient()) { + playSound(SoundEvents.ENTITY_VILLAGER_TRADE); itemInHand.setCount(itemInHand.getCount() - 1); player.giveItemStack(new ItemStack(Items.EMERALD)); player.sendMessage(PotatoTranslations.INSTANCE.getVillagerTrade().format()); @@ -40,6 +42,7 @@ public abstract class ShillCarrotsToVillagerPatch extends MerchantEntity { } if (itemInHand.isOf(Items.GOLDEN_CARROT)) { if (!isClient()) { + playSound(SoundEvents.ENTITY_VILLAGER_TRADE); itemInHand.setCount(itemInHand.getCount() - 1); player.giveItemStack(new ItemStack(Items.EMERALD_BLOCK)); player.sendMessage(PotatoTranslations.INSTANCE.getVillagerTrade().format()); diff --git a/src/main/kotlin/moe/nea/potatocrime/PotatoCrime.kt b/src/main/kotlin/moe/nea/potatocrime/PotatoCrime.kt index 9aec040..c59b76c 100644 --- a/src/main/kotlin/moe/nea/potatocrime/PotatoCrime.kt +++ b/src/main/kotlin/moe/nea/potatocrime/PotatoCrime.kt @@ -54,8 +54,6 @@ object PotatoCrime : ModInitializer { fun hasContraband(entity: ServerPlayerEntity): Boolean { return entity.inventory - .getMatchingStacks { it.isIn(PotatoRegistry.carrotIshItems) } - .isNotEmpty() - + .contains { it.isIn(PotatoRegistry.carrotIshItems) } } }
\ No newline at end of file |