Hackily fix server crash

This commit is contained in:
Vincent Lee 2022-01-23 17:21:16 -08:00 committed by gamma-delta
parent fb2ebc568a
commit e21a3495f9

View file

@ -20,7 +20,7 @@ public class ItemWand extends Item {
@Override
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) {
if (world.isClientSide()) {
Minecraft.getInstance().setScreen(new GuiSpellcasting(hand));
ClientAccess.openSpellcastGui(hand);
}
player.awardStat(Stats.ITEM_USED.get(this));
@ -28,4 +28,10 @@ public class ItemWand extends Item {
return InteractionResultHolder.success(player.getItemInHand(hand));
}
private static class ClientAccess {
public static void openSpellcastGui(InteractionHand hand) {
Minecraft.getInstance().setScreen(new GuiSpellcasting(hand));
}
}
}