private bool onSealClick()
        {
            BlockEntityBarrel bebarrel = capi.World.BlockAccessor.GetBlockEntity(BlockEntityPosition) as BlockEntityBarrel;

            if (bebarrel == null || bebarrel.Sealed)
            {
                return(true);
            }

            if (!bebarrel.CanSeal)
            {
                return(true);
            }

            bebarrel.SealBarrel();

            capi.Network.SendBlockEntityPacket(BlockEntityPosition.X, BlockEntityPosition.Y, BlockEntityPosition.Z, 1337);
            Vec3d pos = BlockEntityPosition.ToVec3d().Add(0.5, 0.5, 0.5);

            capi.World.PlaySoundAt(new AssetLocation("sounds/player/seal"), pos.X, pos.Y, pos.Z, null);

            TryClose();

            return(true);
        }
Exemple #2
0
        private bool onMixClick()
        {
            BlockEntityCauld becauld = capi.World.BlockAccessor.GetBlockEntity(BlockEntityPosition) as BlockEntityCauld;

            if (becauld == null)
            {
                return(true);
            }

            becauld.MixCauld();
            capi.Network.SendBlockEntityPacket(BlockEntityPosition.X, BlockEntityPosition.Y, BlockEntityPosition.Z, 1337);
            Vec3d pos = BlockEntityPosition.ToVec3d().Add(0.5, 0.5, 0.5);

            capi.World.PlaySoundAt(new AssetLocation("sounds/player/seal"), pos.X, pos.Y, pos.Z, null);

            return(true);
        }