Continue mapping migration
This commit is contained in:
parent
99ade39404
commit
f03fd03bd0
499 changed files with 12567 additions and 12723 deletions
|
@ -1,17 +1,16 @@
|
|||
package ru.betterend.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.item.TooltipContext;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResultHolder;
|
||||
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;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
@ -19,28 +18,26 @@ import ru.betterend.util.LangUtil;
|
|||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
|
||||
public class GuideBookItem extends PatternedItem {
|
||||
public final static ResourceLocation BOOK_ID = BetterEnd.makeID("guidebook");
|
||||
public static final Item GUIDE_BOOK = EndItems.registerItem(BOOK_ID, new GuideBookItem());
|
||||
|
||||
public static void register() {
|
||||
}
|
||||
|
||||
public GuideBookItem() {
|
||||
super(EndItems.makeItemSettings().stacksTo(1));
|
||||
}
|
||||
|
||||
public final static ResourceLocation BOOK_ID = BetterEnd.makeID("guidebook");
|
||||
public static final Item GUIDE_BOOK = EndItems.registerItem(BOOK_ID, new GuideBookItem());
|
||||
|
||||
public static void register() {}
|
||||
|
||||
public GuideBookItem() {
|
||||
super(EndItems.makeItemSettings().stacksTo(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TypedActionResult<ItemStack> use(Level world, Player user, Hand hand) {
|
||||
if (!world.isClientSide && user instanceof ServerPlayer) {
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
||||
if (!world.isClientSide && user instanceof ServerPlayer) {
|
||||
PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
||||
return TypedActionResult.success(user.getStackInHand(hand));
|
||||
return InteractionResultHolder.success(user.getItemInHand(hand));
|
||||
}
|
||||
return TypedActionResult.consume(user.getStackInHand(hand));
|
||||
return InteractionResultHolder.consume(user.getItemInHand(hand));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendTooltip(ItemStack stack, Level world, List<Text> tooltip, TooltipContext context) {
|
||||
tooltip.add(
|
||||
LangUtil.getText("book.betterend", "subtitle").formatted(Formatting.DARK_PURPLE, Formatting.ITALIC));
|
||||
public void appendHoverText(ItemStack stack, Level world, List<Component> tooltip, TooltipFlag context) {
|
||||
tooltip.add(LangUtil.getText("book.betterend", "subtitle").withStyle(ChatFormatting.DARK_PURPLE, ChatFormatting.ITALIC));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue