[Change] update guidebook format to make it work on 1.20+ (ny noah1510)
This commit is contained in:
parent
51af33aaca
commit
d16ab8d1a7
3 changed files with 9 additions and 6 deletions
|
@ -8,6 +8,7 @@ import org.betterx.betterend.util.LangUtil;
|
|||
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;
|
||||
|
@ -16,6 +17,8 @@ import net.minecraft.world.item.ItemStack;
|
|||
import net.minecraft.world.item.TooltipFlag;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GuideBookItem extends ModelProviderItem {
|
||||
|
@ -32,10 +35,10 @@ public class GuideBookItem extends ModelProviderItem {
|
|||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
||||
//TODO: 1.19.3 Re-Enable once patchouli is available
|
||||
// if (!world.isClientSide && user instanceof ServerPlayer) {
|
||||
// PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
||||
// return InteractionResultHolder.success(user.getItemInHand(hand));
|
||||
// }
|
||||
if (!world.isClientSide && user instanceof ServerPlayer) {
|
||||
PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
||||
return InteractionResultHolder.success(user.getItemInHand(hand));
|
||||
}
|
||||
return InteractionResultHolder.consume(user.getItemInHand(hand));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue