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

@@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://modmuss50.me/fabric.html # check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.8 minecraft_version=1.21.9
yarn_mappings=1.21.8+build.1 yarn_mappings=1.21.9+build.1
loader_version=0.17.2 loader_version=0.17.2
# Mod Properties # Mod Properties
mod_version=1.0 mod_version=1.1
maven_group=com.kasetoatz maven_group=com.kasetoatz
archives_base_name=StasisRods archives_base_name=StasisRods
# Dependencies # Dependencies
# check this on https://modmuss50.me/fabric.html # check this on https://modmuss50.me/fabric.html
fabric_version=0.133.4+1.21.8 fabric_version=0.133.14+1.21.9

View File

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

View File

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