-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- increase bite cooldown from 6 -> 10 seconds - decrease bleeding bite duration from 5 -> 3 seconds - remove suspicious stew effects for werewolves
- Loading branch information
1 parent
ee1a765
commit 39059bb
Showing
5 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
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
33 changes: 33 additions & 0 deletions
33
src/main/java/de/teamlapen/werewolves/mixin/SuspiciousStewItemMixin.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,33 @@ | ||
package de.teamlapen.werewolves.mixin; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyReceiver; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import de.teamlapen.werewolves.util.Helper; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.SuspiciousStewItem; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.SuspiciousEffectHolder; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
import java.util.function.Consumer; | ||
|
||
@Mixin(SuspiciousStewItem.class) | ||
public class SuspiciousStewItemMixin { | ||
|
||
@WrapOperation(method = "finishUsingItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/SuspiciousStewItem;listPotionEffects(Lnet/minecraft/world/item/ItemStack;Ljava/util/function/Consumer;)V")) | ||
private void finishUsing(ItemStack pStack, Consumer<SuspiciousEffectHolder.EffectEntry> pOutput, Operation<Void> original, ItemStack originalStack, Level pLevel, LivingEntity pEntityLiving) { | ||
if (!Helper.canEat(pEntityLiving, pStack)) { | ||
ItemStack copy = pStack.copy(); | ||
CompoundTag tag = copy.getTag(); | ||
if (tag != null) { | ||
tag.remove("effects"); | ||
} | ||
pStack = copy; | ||
} | ||
original.call(pStack, pOutput); | ||
} | ||
} |
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
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
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