mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
Update CreateNBTProcessors.java
This commit is contained in:
parent
208b88f93d
commit
b1565391a4
1 changed files with 8 additions and 0 deletions
|
@ -9,7 +9,10 @@ import net.createmod.catnip.nbt.NBTProcessors;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
public class CreateNBTProcessors {
|
||||
public static void register() {
|
||||
|
@ -26,6 +29,11 @@ public class CreateNBTProcessors {
|
|||
if (!data.contains("Book", Tag.TAG_COMPOUND))
|
||||
return data;
|
||||
CompoundTag book = data.getCompound("Book");
|
||||
|
||||
// Writable books can't have click events, so they're safe to keep
|
||||
ResourceLocation writableBookResource = ForgeRegistries.ITEMS.getKey(Items.WRITABLE_BOOK);
|
||||
if (writableBookResource != null && book.getString("id").equals(writableBookResource.toString()))
|
||||
return data;
|
||||
|
||||
if (!book.contains("tag", Tag.TAG_COMPOUND))
|
||||
return data;
|
||||
|
|
Loading…
Add table
Reference in a new issue