Fixed double packet sending on single-player and LAN worlds.
This commit is contained in:
@ -55,6 +55,7 @@ public class TotemOfRevivingItem extends Item {
|
|||||||
@Override
|
@Override
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public ActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand) {
|
public ActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand) {
|
||||||
|
if (!world.isClientSide) { return super.use(world, player, hand); }
|
||||||
if (player.isCrouching()) {
|
if (player.isCrouching()) {
|
||||||
TotemOfReviving.INSTANCE.sendToServer(new C2SRequestTotemTarget(player.getUUID(), hand));
|
TotemOfReviving.INSTANCE.sendToServer(new C2SRequestTotemTarget(player.getUUID(), hand));
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user