This commit is contained in:
2025-10-01 21:21:21 +02:00
parent f67c0fe3af
commit 6fbd0b2bb2
3 changed files with 10 additions and 8 deletions

View File

@@ -3,7 +3,6 @@ package com.kasetoatz.stasisrods.mixin;
import net.minecraft.block.BlockState;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.NbtComponent;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.entity.player.PlayerEntity;
@@ -16,7 +15,6 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -32,10 +30,14 @@ public class FishingRodItemMixin
@Inject(method="use", at=@At("HEAD"), cancellable = true)
public void use(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<ActionResult> cir)
{
if (world.isClient())
{
return;
}
ItemStack stack = user.getStackInHand(hand);
if (tryDiscardPlaceholder(stack, world.getServer()))
{
stack.damage(1, user, LivingEntity.getSlotForHand(hand));
stack.damage(1, user, hand.getEquipmentSlot());
world.playSound(
null,
user.getX(),

View File

@@ -7,7 +7,7 @@
"authors": [],
"contact": {},
"license": "MIT",
"environment": "server",
"environment": "*",
"mixins": [
"stasisrods.mixins.json"
],