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;
}
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;
}
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);
}
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;
}
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);
}
}
}
Aggregations