[Change] Re-Enabled Patchouli

This commit is contained in:
Frank 2022-06-30 15:30:20 +02:00
parent 50c305adc9
commit 372d7ddd13
3 changed files with 7 additions and 6 deletions

View file

@ -40,7 +40,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}"
modApi "vazkii.patchouli:Patchouli:${project.patchouli_version}"
println "Using local BCLib: ${local_bclib}"
if (local_bclib) {
implementation(project(path: ":BCLib", configuration: 'dev'))

View file

@ -13,8 +13,8 @@ maven_group=org.betterx.betterend
archives_base_name=better-end
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
patchouli_version=55-FABRIC-SNAPSHOT
bclib_version=2.0.6
rei_version=9.0.472
patchouli_version=1.19-73-FABRIC
bclib_version=2.0.7
rei_version=9.1.500
trinkets_version=3.4.0
cca_version=5.0.0-beta.1

View file

@ -17,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 {
@ -33,8 +35,7 @@ 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));