Add files via upload

Re-added Patchouli integration
This commit is contained in:
Daturachan 2022-06-10 15:05:53 +02:00 committed by GitHub
parent 03c39d4a69
commit ec50c13ed2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,7 @@ import ru.bclib.items.ModelProviderItem;
import ru.betterend.BetterEnd;
import ru.betterend.registry.EndItems;
import ru.betterend.util.LangUtil;
import vazkii.patchouli.api.PatchouliAPI;
import java.util.List;
@ -32,8 +33,8 @@ public class GuideBookItem extends ModelProviderItem {
@Override
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
if (!world.isClientSide && user instanceof ServerPlayer) {
//TODO: reanable Patchouli once it is available for 1.18
//PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
return InteractionResultHolder.success(user.getItemInHand(hand));
}
return InteractionResultHolder.consume(user.getItemInHand(hand));