Fixed Compiletime issue
This commit is contained in:
parent
fd2559e038
commit
a8856fff15
94 changed files with 562 additions and 574 deletions
|
@ -5,7 +5,7 @@ import org.betterx.bclib.items.ModelProviderItem;
|
|||
import org.betterx.betterend.registry.EndItems;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -31,7 +31,7 @@ public class EnchantedItem extends ModelProviderItem {
|
|||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public BlockModel getItemModel(ResourceLocation resourceLocation) {
|
||||
ResourceLocation sourceId = Registry.ITEM.getKey(source);
|
||||
ResourceLocation sourceId = BuiltInRegistries.ITEM.getKey(source);
|
||||
return ModelsHelper.createItemModel(sourceId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ 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;
|
||||
|
@ -17,8 +16,6 @@ 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 {
|
||||
|
@ -34,10 +31,11 @@ public class GuideBookItem extends ModelProviderItem {
|
|||
|
||||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
||||
if (!world.isClientSide && user instanceof ServerPlayer) {
|
||||
PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
||||
return InteractionResultHolder.success(user.getItemInHand(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));
|
||||
// }
|
||||
return InteractionResultHolder.consume(user.getItemInHand(hand));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue