Fix GUI for TR Manual

This commit is contained in:
drcrazy 2021-06-18 12:14:08 +03:00
parent 75f14c145c
commit 193dc94f80
2 changed files with 21 additions and 23 deletions

View file

@ -44,16 +44,13 @@ public class ManualItem extends Item {
}
@Override
public TypedActionResult<ItemStack> use(final World world, final PlayerEntity player,
final Hand hand) {
if (world.isClient) {
openGui(player);
}
public TypedActionResult<ItemStack> use(final World world, final PlayerEntity player, final Hand hand) {
if (world.isClient) { openGui(); }
return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand));
}
@Environment(EnvType.CLIENT)
private void openGui(PlayerEntity playerEntity) {
MinecraftClient.getInstance().openScreen(new GuiManual(playerEntity));
private void openGui() {
MinecraftClient.getInstance().openScreen(new GuiManual());
}
}