Search in sources :

Example 46 with NbtCompound

use of net.minecraft.nbt.NbtCompound in project bewitchment by MoriyaShiine.

the class TaglockHolderBlockEntity method toInitialChunkDataNbt.

@Override
public NbtCompound toInitialChunkDataNbt() {
    NbtCompound nbt = super.toInitialChunkDataNbt();
    writeNbt(nbt);
    return nbt;
}
Also used : NbtCompound(net.minecraft.nbt.NbtCompound)

Example 47 with NbtCompound

use of net.minecraft.nbt.NbtCompound in project bewitchment by MoriyaShiine.

the class WitchAltarBlockEntity method toInitialChunkDataNbt.

@Override
public NbtCompound toInitialChunkDataNbt() {
    NbtCompound nbt = super.toInitialChunkDataNbt();
    writeNbt(nbt);
    return nbt;
}
Also used : NbtCompound(net.minecraft.nbt.NbtCompound)

Example 48 with NbtCompound

use of net.minecraft.nbt.NbtCompound in project bewitchment by MoriyaShiine.

the class SyncContractsPacket method send.

public static void send(PlayerEntity player) {
    PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
    NbtCompound contracts = new NbtCompound();
    contracts.put("Contracts", BWComponents.CONTRACTS_COMPONENT.get(player).toNbtContract());
    buf.writeNbt(contracts);
    ServerPlayNetworking.send((ServerPlayerEntity) player, ID, buf);
}
Also used : NbtCompound(net.minecraft.nbt.NbtCompound) PacketByteBuf(net.minecraft.network.PacketByteBuf)

Example 49 with NbtCompound

use of net.minecraft.nbt.NbtCompound in project bewitchment by MoriyaShiine.

the class DragonsBloodChestBlockEntity method toInitialChunkDataNbt.

@Override
public NbtCompound toInitialChunkDataNbt() {
    NbtCompound nbt = super.toInitialChunkDataNbt();
    writeNbt(nbt);
    return nbt;
}
Also used : NbtCompound(net.minecraft.nbt.NbtCompound)

Example 50 with NbtCompound

use of net.minecraft.nbt.NbtCompound in project bewitchment by MoriyaShiine.

the class BrewingRecipeRegistryMixin method craft.

@Inject(method = "craft", at = @At(value = "INVOKE", shift = At.Shift.BEFORE, ordinal = 0, target = "Lnet/minecraft/potion/PotionUtil;setPotion(Lnet/minecraft/item/ItemStack;Lnet/minecraft/potion/Potion;)Lnet/minecraft/item/ItemStack;"), cancellable = true)
private static void craft(ItemStack input, ItemStack ingredient, CallbackInfoReturnable<ItemStack> callbackInfo) {
    if (ingredient.hasNbt()) {
        NbtCompound nbt = ingredient.getNbt();
        if (nbt.getBoolean("BewitchmentBrew")) {
            ItemStack potionStack = new ItemStack(input.getItem() == Items.GUNPOWDER ? Items.SPLASH_POTION : input.getItem() == Items.DRAGON_BREATH ? Items.LINGERING_POTION : Items.POTION);
            potionStack.getOrCreateNbt().copyFrom(nbt);
            callbackInfo.setReturnValue(potionStack);
        }
    }
}
Also used : NbtCompound(net.minecraft.nbt.NbtCompound) ItemStack(net.minecraft.item.ItemStack) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

NbtCompound (net.minecraft.nbt.NbtCompound)318 NbtList (net.minecraft.nbt.NbtList)93 ItemStack (net.minecraft.item.ItemStack)69 NbtElement (net.minecraft.nbt.NbtElement)28 IOException (java.io.IOException)25 LiteralText (net.minecraft.text.LiteralText)24 Identifier (net.minecraft.util.Identifier)24 Inject (org.spongepowered.asm.mixin.injection.Inject)21 BlockPos (net.minecraft.util.math.BlockPos)20 NbtString (net.minecraft.nbt.NbtString)16 File (java.io.File)13 HashMap (java.util.HashMap)10 List (java.util.List)9 Text (net.minecraft.text.Text)9 Vec3d (net.minecraft.util.math.Vec3d)9 Map (java.util.Map)8 Items (net.minecraft.item.Items)8 TranslatableText (net.minecraft.text.TranslatableText)8 HashSet (java.util.HashSet)7 BlockEntity (net.minecraft.block.entity.BlockEntity)7