[Change] update guidebook format to make it work on 1.20+ (ny noah1510)
This commit is contained in:
parent
5cc922381b
commit
a199db3769
3 changed files with 13 additions and 10 deletions
|
@ -86,7 +86,7 @@ dependencies {
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
|
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
|
||||||
|
|
||||||
//1.19.3 modApi "vazkii.patchouli:Patchouli:${project.patchouli_version}"
|
modApi "vazkii.patchouli:Patchouli:${project.patchouli_version}"
|
||||||
println "Using local BCLib: ${local_bclib}"
|
println "Using local BCLib: ${local_bclib}"
|
||||||
if (local_bclib) {
|
if (local_bclib) {
|
||||||
implementation(project(path: ":BCLib", configuration: 'dev'))
|
implementation(project(path: ":BCLib", configuration: 'dev'))
|
||||||
|
|
|
@ -18,9 +18,9 @@ maven_group=org.betterx.betterend
|
||||||
archives_base_name=better-end
|
archives_base_name=better-end
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
patchouli_version=1.19-73-FABRIC
|
patchouli_version=1.20.1-84-FABRIC
|
||||||
bclib_version=3.30.0
|
bclib_version=3.0.14
|
||||||
rei_version=14.0.680
|
rei_version=12.0.622
|
||||||
emi_version=1.0.3+1.20
|
emi_version=1.0.28+1.20.1
|
||||||
trinkets_version=3.7.0
|
trinkets_version=3.7.0
|
||||||
cca_version=5.2.1
|
cca_version=5.2.2
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.betterx.betterend.util.LangUtil;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResultHolder;
|
import net.minecraft.world.InteractionResultHolder;
|
||||||
import net.minecraft.world.entity.player.Player;
|
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.item.TooltipFlag;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
|
import vazkii.patchouli.api.PatchouliAPI;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class GuideBookItem extends ModelProviderItem {
|
public class GuideBookItem extends ModelProviderItem {
|
||||||
|
@ -32,10 +35,10 @@ public class GuideBookItem extends ModelProviderItem {
|
||||||
@Override
|
@Override
|
||||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
||||||
//TODO: 1.19.3 Re-Enable once patchouli is available
|
//TODO: 1.19.3 Re-Enable once patchouli is available
|
||||||
// if (!world.isClientSide && user instanceof ServerPlayer) {
|
if (!world.isClientSide && user instanceof ServerPlayer) {
|
||||||
// PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
||||||
// return InteractionResultHolder.success(user.getItemInHand(hand));
|
return InteractionResultHolder.success(user.getItemInHand(hand));
|
||||||
// }
|
}
|
||||||
return InteractionResultHolder.consume(user.getItemInHand(hand));
|
return InteractionResultHolder.consume(user.getItemInHand(hand));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue