Continue migration

This commit is contained in:
Aleksey 2021-04-12 16:34:13 +03:00
parent 47ed597358
commit 33dbfbe633
263 changed files with 1450 additions and 1486 deletions

View file

@ -3,7 +3,7 @@ package ru.betterend.item;
import java.util.List;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.world.entity.player.PlayerEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.server.level.ServerPlayer;
@ -26,11 +26,11 @@ public class GuideBookItem extends PatternedItem {
}
public GuideBookItem() {
super(EndItems.makeItemSettings().maxCount(1));
super(EndItems.makeItemSettings().stacksTo(1));
}
@Override
public TypedActionResult<ItemStack> use(Level world, PlayerEntity user, Hand hand) {
public TypedActionResult<ItemStack> use(Level world, Player user, Hand hand) {
if (!world.isClientSide && user instanceof ServerPlayer) {
PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
return TypedActionResult.success(user.getStackInHand(hand));